On Mar 12, 2010, at 8:30 AM, Qing Li wrote:

> I believe what Julian means is the following:
> 
> 1. in the driver, I do this
> 
>     ifp->if_flags |= IFF_KNOWS_LINK_STATE;
> 
> 2. In route.h, I do this
> 
>    if (ifp->flags & IFF_KNOWS_LINK_STATE) && (ifp->if_link_state ==
> LINK_STATE_UP)
>       return 1;

Please do *NOT* do this:

(1) Do not overload if_flags with more run-time set flags without well-defined 
atomicity properties
(2) Why isn't LINK_STATE_UNKNOWN already sufficient here?

The only change I think would be useful is adding a new IFCAP flag that allows 
a driver to statically declare that it will someday set the link state. But I 
don't think that helps with ECMP, that's just for the benefit of programs like 
dhclient that care about future events rather than current state.

Robert


> 
> -- Qing
> 
> 
> On Fri, Mar 12, 2010 at 12:26 AM, Robert N. M. Watson
> <rwat...@freebsd.org> wrote:
>> 
>> On Mar 12, 2010, at 8:11 AM, Qing Li wrote:
>> 
>>> I like Julian's suggestion because it is simple and very low risk.
>>> And there isn't a need to check for interface type any more.
>>> Here is why:
>>> 
>>> 1. The interfaces that are popular and modern are already supporting
>>>    link_state. So for these drivers, and there are just a few, I will go set
>>>    its if_flags to include "can change link_state".
>>> 
>>> 2. For the existing dated drivers, because that flag bit is never set,
>>>    no check is done.
>>> 
>>> 3. In the mean time, we try to convert the drivers progressively.
>>> 
>>> 4. If one wants to do ECMP and not having packets go into a black
>>>    hole when the physical link is down, that person can ping the ML
>>>    and ask for driver compatibility list. If we haven't converted that
>>>    particular driver by then, we will update the driver if it's capable
>>>    at that time.
>> 
>> 
>> Today, we support three link state values:
>> 
>> 170 /*
>> 171  * Values for if_link_state.
>> 172  */
>> 173 #define LINK_STATE_UNKNOWN      0       /* link invalid/unknown */
>> 174 #define LINK_STATE_DOWN         1       /* link is down */
>> 175 #define LINK_STATE_UP           2       /* link is up */
>> 
>> 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.
>> 
>> So the only question we don't know the answer to, at run-time, is whether a 
>> driver may *ever* set the link state (i.e., it thinks it knows how to), and 
>> hence whether or not tools like dhclient should try to wait for that to 
>> happen. That is the problem that an interface capability would solve.
>> 
>> For the purposes of ECMP, you just need to decide on your policy: map 
>> UNKNOWN to either UP or DOWN for your purposes.
>> 
>> Robert

_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to