Re: [PATCH v5 2/8] net/nfb: create one ethdev per ethernet port

Stephen Hemminger
2026-01-27T14:13:26Z

On Tue, 27 Jan 2026 09:12:21 +0100
Martin Spinler <spinler@cesnet.cz> wrote:

> On Mon, 2026-01-26 at 16:37 -0800, Stephen Hemminger wrote:
> > > +TAILQ_HEAD(nfb_pmd_internals_head, pmd_internals);
> >
> > You should put static in front of TAILQ_HEAD so that the head is not
> > global if you don't need it to be.
> >
> > > +static struct nfb_pmd_internals_head nfb_eth_dev_list =
> > > + TAILQ_HEAD_INITIALIZER(nfb_eth_dev_list);
> > > +
>
> I don't understand this. The static is already in front of the
> nfb_eth_dev_list global variable.
>
>
> The TAILQ_HEAD() just defines a struct (not a variable), which is
> visible just in the one .c file.
>
> When I use static, as you suggest (or as I think you suggest):
> static TAILQ_HEAD(nfb_pmd_internals_head, pmd_internals);
> $ ninja
> [2/30] Compiling C object ... net_nfb_nfb_ethdev.c.o
> ...nfb_ethdev.c:49:1: warning: useless storage class specifier in empty
> declaration

Your right, I just saw that in other drivers.