On Thu, 2005-17-11 at 22:03 -0500, jamal wrote: > > I will attempt some ascii art shortly. Actually if you agree with it > please include it in your patch so it is easier for people to make > changes in the future. >
ok, ascii art is hard - instead in pseudo code (please double check with the RFC); i am sure the states can be optimized, but here goes: switch oper state case NP: - If !stacked goto DOWN else goto LLD case LLD: - If told to go to up goto UP if at least one child is up and mode=default generate netlink event - If told to go to dormant and mode=dormant goto dormant if at least one child is dormant case DOWN: // netlink event when transitioning to UP - if told to transition to UP and mode default, goto UP - if told to transition to UP and mode to dormant, goto to DORMANT case DORMANT - if told to transition to up if stacked goto UP if at least one child is up if !stacked goto UP generate netlink event on transition to UP?? - if told to transition to DOWN if !stacked goto LLD if no children are up or dormant else goto DOWN generate netlink event either going to LLD or DOWN case UP - if told to goto DOWN go there if !stacked else goto LLD if all children are oper down emit netlink event for above transitions - if told to goto to DORMANT goto DORMANT "told to" is something along the lines of netif_carrier_down/up etc comments: -> I think NP state is useless mostly - thats why i left it as immediately transitioning without having to be told to do so. Perhaps some USB netdevices may find use for it; in typical big chasis routers it is used to indicate presence of a network device but absence of hardware. -> UP->DORMANT; i am not sure if that transition is needed. -> I didnt show UNKNOWN state; it's the default bizare state -> And the other important piece is stacking as well defined in section 3.1.14. A stacked interface can never just be down; it can only be LLD instead (because it depends on oper states of its children). Suggestion: we may need a IFF_flag for indicating something is stacked. When this flag is set together with IFF_RUNNING it implies UP; else if IFF_RUNNING is not set it implies it is LLD. 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