Am Montag 07 November 2005 14:50 schrieb Thomas Graf: > > -migrate VLAN + BONDING to use OPER_LOWERLAYERDOWN > > I think that bonding should check on the administrative status of > its slaves as well. Why not check for OPER_UP?
Yes, currently it seems to ignore admin status and does not even maintain its own operative status. > I still don't see the point in OPER_DORMANTL3DOWN vs. OPER_DORMANTL3UP. Seems my English is really bad ;-) > Can't we put the driver, stacked interface, etc. in charge for dropping > packets which shouldn't be let through yet? I would favour this and have > the dormant state limited to link layer responsibilities. Imagine this situation: +---+ | 1 | +---+ | +---+ +---+ +----| 2 |---| 3 | A +---+ B +---+ | | +---+ ----+-------+-----| 4 | C +---+ 1,2,3,4 are acting as routers with the quagga daemon running. A,B,C are networks. Now (1) wants to reach (4). Normally, the packet would travel to (2) via (A), from there to (4) via (C). But what happens when the link from (2) to (C) fails? The routing protocol would realize it (actually it was me how has added IFF_RUNNING support to quagga) and add a route to (C) via (3) on (B). However, the "connected" route would still have precedence and the linux IP stack on (2) would happily try to continue using the broken link to (C), even if we add juju magic to the link layer to recognize and drop L3 packets. That's why I think L3 protocols should be responsible for not using a broken link and why we need OPER_DORMANTL3DOWN. OPER_DORMANTL3UP is another beast. Dial on demand interfaces may be dormant, but of course layer L3 must consider routes pointing to them, or they would never dial. I see this clearly as a kernel problem, we should not expect userspace to workaround this limitation. And it's even useful without a routing daemon if a host has more than one network interface. > char access is not guaranteed to be atomic, just use int for the states. OTOH, we don't need to be completely atomic as the netif_carrier_*-functions already require driver controlled synchronisation. We just need to make sure that the caches are coherent before linkwatch kernel thread runs. > +#define IFF_LINK_UP 0x2000 /* lower link up */ > +#define IFF_DORMANT 0x4000 /* waiting for external event */ > +#define IFF_WAIT 0x8000 /* auto. enter dormant state */ > +int dev_oper_state(struct net_device *dev) > +{ > + if (!netif_device_present(dev)) > + return IF_OPER_NOTPRESENT; > + > + if (!netif_running(dev)) > + return IF_OPER_DOWN; No, !netif_running() is ADMIN down, mostly representing the IFF_UP flag. > + if (!netif_carrier_ok(dev)) > + return IF_OPER_LOWERLAYERDOWN; No, this is OPER_DOWN. LOWERLAYERDOWN is IMHO f.e. for VLANs stacked on a physical interface that is OPER_DOWN. > void netif_carrier_on(struct net_device *dev) > { > + if ((dev->flags & IFF_WAIT) && > + test_bit(__LINK_STATE_NOCARRIER, &dev->state)) > + netif_dormant_on(dev); That would be for avoiding the userspace supplicant race I assume. Bad problem here: To allow software/userspace controlled probe and association packets, wireless devices must not go to netif_carrier_off() anymore when the association is lost or must have a way to transmit packets without using the kernel scheduler ;-( May be wireless developers could live with this limitation. Your solution would work for Krzysztof and for WPA/802.1X, but with the limitation I've just mentioned. However, as it does not define a clear point for L3 protocols to start, it would not enhance support for routing daemons and dialup interfaces, what my idea can do. As I've already used linux boxes as routers in a redundant topology, I consider this important. What to do now? I have the impression that most arguments are said. Maybe someone like acme or davem should chime in and decide which direction to take? Stefan - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html