Re: Modularizing the network stack with a driver API

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Wed, 23 Nov 2022 20:23:03 UTC
On Wed, 23 Nov 2022 15:09:01 -0500
George Neville-Neil <gnn@neville-neil.com> wrote:

> On 23 Nov 2022, at 14:33, Justin Hibbits wrote:
> 
> > Hi everyone,
> >
> > Back in 2014 Marcel Moolenaar started the thread "Roadmap for
> > ifnet(9) for FreeBSD 11"
> > (https://lists.freebsd.org/pipermail/freebsd-arch/2014-May/015379.html),
> > and after 8 years we want to revisit this.  This email is to kick
> > things off again, and further design discussions.
> >
> > I've spent time off and on as able over the last couple years
> > porting -CURRENT to this "DrvAPI", and have something that
> > compiles.  Much of the work was committed at the time of the
> > initial discussion in 2014, with enhancements done off and on since
> > then.  Also, much of the shortcomings listed at
> > https://wiki.freebsd.org/projects/ifnet have not been addressed at
> > all yet.
> >
> > Most of the work I've done in the recent port has been purely
> > mechanical and scripted, fixing build failures along the way.  The
> > current work in progress can be found in my personal repository at
> > https://github.com/chmeeedalf/freebsd/tree/drvapi .  The goal of
> > this first step is to get things started, address design feedback,
> > and move forward in main.
> >  
> 
> Can you say how this does (or does not) work with the ifLib effort?
> I'm happy to have a better driver API for our NIC drivers just
> wondering if this replaces, enhances, or has nothing to do with
> what's there now.  I know that only a few drivers picked up ifLib
> (Intel) the last time I looked.
> 
> Best,
> George

I think they're complementary.  Someone can correct my understanding,
but iflib looks like a driver library, taking care of the commonalities
of hardware drivers (transmit/receive queuing, packet processing), while
the DrvAPI is for interfacing with the network stack, abstracting the
stack away behind this API

- Justin