Roadmap for ifnet(9) for FreeBSD 11

Rui Paulo rpaulo at FreeBSD.org
Thu May 29 03:48:15 UTC 2014


On May 28, 2014, at 9:34, Marcel Moolenaar <marcel at xcllnt.net> wrote:

> All,
> 
> The ifnet structure represents a network interface. Right now it
> is known to all NIC drivers as well as to all protocols. This
> means that whenever we change the structure, we need at minimum
> recompile all drivers, but usually also change them. This severely
> slow downs the development in this area and also makes it hard, if
> not, impossible to merge things back to stable branches.
> 
> There were at least 3 efforts on fixing this:
> 
> 1)  Juniper’s JUNOS is a FreeBSD based operating system that has
>    its own (alternative) network stack, but that leverages the
>    network drivers from FreeBSD. Juniper mechanically changed all
>    ifnet dereferences to to accessor methods. This could have
>    been incorporated as early as 2011, but lacked good follow
>    through. Marcel Moolenaar was prime contact for this.
> 
> 2)  Andre Oppermann was sponsored in 2013 by the FreeBSD
>    Foundation to make ifnet(9) opaque. This is not complete as of
>    the time of this writing.
> 
> 3)  Gleb Smirnoff also planned to work on opaque ifnet(9), but
>    that always has been delayed due to 1) and 2).

This is indeed needed, but it would be nice to understand what would happen if the community has comments about your patch. Will Juniper be able to integrate back those comments?  For example, I think the type "if_t" should be "ifnet_t".  Another comment I have is: why do you have to cast if_t to (struct ifnet *) in all the accessor methods?  It would be better to create a private header typedef'ing if_t to struct ifnet, avoiding the copy & paste casting.  

--
Rui Paulo





More information about the freebsd-arch mailing list