if_flags usage etc.

Luigi Rizzo rizzo at icir.org
Thu Jan 26 22:52:48 PST 2006


On Thu, Jan 26, 2006 at 09:03:22PM -0700, M. Warner Losh wrote:
> In message: <20060124075437.B67285 at xorpc.icir.org>
>             Luigi Rizzo <rizzo at icir.org> writes:
> : - some drivers try to manipulate flags that they should not e.g.
> : 	if_ed
> : 		sets IFF_ALTPHYS (IFF_LINK*, but it is almost a capability here)
> 
> Why is this wrong?

if possible, i think each IFF_ flag should be modified only by one entity (the
stack or the driver). This way you can split them into different variables
and reduce the amount of synchronization required to access them.

The link flags are kind-of special in that some drivers use them to request
a specific media, others (e.g. ed here, but some others too) to report up
whatever they found by probing the link.

I guess (though haven't looked in detail) that the "mii" approach has
a cleaner way to deal with these issues.

	cheers
	luigi


More information about the freebsd-current mailing list