Re: [PATCH] 8021q/vlan: process NETDEV_GOING_DOWN

From: Eldad Zack
Date: Wed May 30 2012 - 15:11:10 EST



On Tue, 29 May 2012, David Miller wrote:
> From: Eldad Zack <eldad@xxxxxxxxxxxxxxx>
> Date: Wed, 30 May 2012 00:30:35 +0200
>
> > In the current flow, when you take down a physical device that has
> > VLANs configured on it, the NETDEV_GOING_DOWN notification will be
> > sent too late, i.e., no data can be sent to the wire anymore.
>
> Why do you need to send data? Any queued up data should be purged not
> sent.

In case a certain protocol needs to send a "dying gasp" packet, when you
administrativly shutdown the port (which is also what happens when you
restart the machine).

I'm working on an implementation of such protocol (LLDP) on my free
time. The specification says that it should send a (compact) shutdown
message, with the TTL field set to zero, so that other stations are informed
of the shutdown - and it works fine with the main interface, but not with
VLANs, since the notifier is called too late.
With that small change it works as well.

Another use for it would be the Ethernet CFM, which has a similar
requirement.

On the other hand, I might've missed something. Is there a better way to
be informed of a shutdown than listening for the GOING_DOWN
event, so the frame can be sent to the wire when it's appropriate?

Eldad
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/