On Mon, 2005-14-11 at 16:53 +0100, Krzysztof Halasa wrote:
> jamal <[EMAIL PROTECTED]> writes:
> 

> "Dormant" is not a flag (1 bit) but rather a specific set of flags
> (exactly as there is no "running" nor "l2down" bits). So set_dormant*()
> (with bit flags) doesn't make much sense unless it changes multiple
> flags which would be crazy. get_dormant() - if needed - does make sense,
> though.
> 

I think the kernel oper state (having just looked at Stefans patch) is
needed and should totally reflect the 2863 states.
The exporting to user space needs to be done cleanly via flags.
We already have IFF_RUNNING which essentially when set implies 
DOWN or UP state. We need DORMANT and LOWERLAYERDOWN. As i said to 
Stefan, I wasnt sure if we need to expose the other states to user
state. PRESENT is essentially only a momentary state which quickly
transitions to DOWN state, so i doubt if it is needed. UNKNOWN may need
to be reflected. LOWERLAYERDOWN only makes sense if the netdevice is
stacked - and therefore can never be set on unstacked netdevices.
DORMANT is when the oper state is awaiting for an event to (typically)
transition to UP.

> I.e.,
> 
>    down = 1 <=> admin = 0
>  l2down = 1 <=> admin = 1 & carrier = 0
> dormant = 1 <=> admin = 1 & carrier = 1 & protocol = 0
> running = 1 <=> admin = 1 & carrier = 1 & protocol = 1
> 
> That is how I think we should derive SNMP states from bit flags. We
> could extend it later to include things like dormant-l3up (if really
> needed, I doubt it). The above table is complete, it covers all
> possible flag combinations and it should stay that way if a new flag
> is added.
> 
> Of course if we go with "enum" this all doesn't matter: we would have
> down (admin down), l2down, dormant and running as separate values, with
> no "protocol" nor "carrier" names.

I am not sure i followed %100 what you said - but we just need to focus
on exporting oper state and we should be fine.
In the kernel, oper state is overruled by admin status as described in
2863.

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

Reply via email to