svn commit: r205024 - head/sys/net

Robert N. M. Watson rwatson at freebsd.org
Fri Mar 12 08:49:44 UTC 2010


On Mar 12, 2010, at 8:44 AM, Julian Elischer wrote:

>>>>> I'm confused about Julian's proposal because it seems to me that we already know when a driver hasn't set or is unable to determine the link state: it will (should) be set to LINK_STATE_UNKNOWN by default.
> 
> the question is whether there is any other meaning for this state.
> For example "I have not started up yet"

Right now LINK_STATE_UNKNOWN conflates three different conditions:

(1) I haven't and won't ever set the link state
(2) I haven't yet, but may in the future set the link state
(3) I wanted to check the link state, and the hardware is $*$**£*@@ so I left or set this value instead

My preferred solution is to advertise driver capabilities via the driver capabilities flag, if_capabilities, and define a new flag IFCAP_LINKSTATE (or something similar) that allows a driver to declare that it is able to determine link state. If the flag is set, then components like ECMP, but also dhclient, can reasonably expect that the driver will do its best to provide link state information, addressing the difference between (1) and (2) when a value of LINK_STATE_UNKNOWN is found.

If we are able to explicitly handle (3) in any of our drivers, then a new link state definition should be defined, LINK_STATE_ERROR, which should be set by the driver if it declared ICAP_LINKSTATE but was unable, due to hardware failure, to check it.

Robert


More information about the svn-src-head mailing list