On Tue, 2005-15-11 at 20:28 +0100, Stefan Rompf wrote: > Am Dienstag 15 November 2005 15:16 schrieb jamal: > > > Having said that, perhaps thats where the concept of useroverride you > > have or IFF_WAIT needs to go. What should be done though is to select an > > "operational" mode via admin flags - example "the device is set by the > > admin to dormant state" or "the device is set to dial-on-demand mode" > > etc. > > And that's mostly what Thomas wants to do - but now let's look at a race > condition that makes IFF_WAIT needed. Example is 802.1X over ethernet. > > > For ethernet, we know that the driver won't call netif_dormant_on/off(). > Let's > see what happens when the link beat on an existing ethernet connection is > lost for a short time: > > Without 802.1X: > > -Link beat lost > -netif_carrier_off() by driver -> maps to OPER_DOWN > -link beat comes back > -netif_carrier_on() by driver -> maps to OPER_UP >
Yes, this would be the default admin state. > With 802.1X, userspace supplicant is fast enough to follow: > > -Link beat lost > -netif_carrier_off() by driver -> maps to OPER_DOWN > -supplicant reads netlink notification > -netif_dormant_on() by supplicant -> still maps to OPER_DOWN > -link beat comes back > -netif_carrier_on() by driver -> maps to OPER_DORMANT > -supplicant reads netlink messages, successfully authenticates via 802.1X > -netif_dormant_off() by supplicant -> OPER_UP > > > With 802.1X, userspace supplicant cannot follow: > > -Link beat lost > -netif_carrier_off() by driver -> maps to OPER_DOWN > -link beat comes back > -netif_carrier_on() by driver -> maps to OPER_UP, even though it should be > OPER_DORMANT now! > -supplicant reads notifications > -netif_dormant_on() by supplicant -> maps to OPER_DORMANT > -Rest as above > > As you see, we report a wrong OPER_UP here. For Thomas' suggestion, IFF_WAIT > avoids this. I use OPERU_UP_UNTIL_DORMANT for the same purpose. > Heres what i meant by doing this via admin state control from user space. * The first thing you do is configure the netdevice to the admin mode of operation. This is very close to what BSD (and some vendors) allow for sync PPP (I will try to find a url or look up ifconfig man pages on BSD). IOW, you do this when you ifconfig a device; mode1: default as you pointed out for ethernet mode2: goes into dormant instead of up when the ethernet link is detected. other modes: add here as needed.. If you select admin mode 1, your ethernet oper status will never go between down<->UP. instead it will go from dormant<->Down. Only admin can move it from dormant<->UP. Having said the above: * It is my opinion that the IFF_XXX admin flags for changing the state are sufficient and a cleaner way to go. Thomas has this approach. * It is my opinion that dev->operstate_kernel is the way to go for storing internal state and that this should map whats in 2863. This is the approach you took. To sum up the above, a hybrid patch with your and Thomas' approach is the way to go. cheers, jamal - 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