Re: git: fe33e0ab83d1 - main - ifnet/API: Move the IfAPI from if_var.h to if.h

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Fri, 13 Jan 2023 02:22:42 UTC
On Thu, 12 Jan 2023 16:55:43 -0800
Gleb Smirnoff <glebius@freebsd.org> wrote:

>   Justin,
> 
> On Thu, Jan 12, 2023 at 07:01:14PM -0500, Justin Hibbits wrote:
> J> > 1) Leave it in if_var.h and start a new header where we will move
> J> > stuff that should stay private from drivers. Drivers keep using
> J> > if_var.h. 2) Create a new header with DrvAPI. Drivers to stop
> J> > useing if_var.h and switch to new header file.
> J> > 
> J> > I personally prefer 1), as it follows what we have started to do
> J> > long time ago, see c29e1ad9304, c3322cb91ca, 76039bc84fa,
> J> > eedc7fd9e87.
> J> > 
> J> > [1]
> J> > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/net_if.h.html
> J> >   
> J> 
> J> I'll revert this, but I think we should discuss further how to
> J> approach this, since on our call last week I got the impression
> J> that the DrvAPI does belong in if.h, with if_var.h being
> J> exclusively used by netstack.  
> 
> My fail to properly articulate that. :( Sorry
> 
> Do you agree with this plan:
> 
> 1) DrvAPI stays in if_var.h. Today all drivers already include it.
> 2) struct ifnet (and possibly later more stuff) goes to if_private.h.
>    Alternative names: if_priv.h, if_kern.h, anything else? This file
>    is not supposed to be used by drivers.
> 3) if_var.h _temporarily_ includes if_private.h.
>    Removing this include and trying to compile we can very quickly
>    check how close are we to final removal.
> 4) Eventually if_var.h stops including if_private.h.
> 

This seems fair.  There are already a bunch of foo_private.h files in
sys/, so that nomenclature works for me.  I'll get working on it in the
morning.

- Justin