Re: [RFC net-next v4 5/9] net: napi: Add napi_config

From: Joe Damato
Date: Tue Oct 08 2024 - 18:28:17 EST


On Tue, Oct 08, 2024 at 03:17:01PM -0700, Jakub Kicinski wrote:
> On Tue, 1 Oct 2024 23:52:36 +0000 Joe Damato wrote:
> > static inline void netdev_set_defer_hard_irqs(struct net_device *netdev,
> > u32 defer)
> > {
> > + unsigned int count = max(netdev->num_rx_queues,
> > + netdev->num_tx_queues);
> > struct napi_struct *napi;
> > + int i;
> >
> > WRITE_ONCE(netdev->napi_defer_hard_irqs, defer);
> > list_for_each_entry(napi, &netdev->napi_list, dev_list)
> > napi_set_defer_hard_irqs(napi, defer);
> > +
> > + if (netdev->napi_config)
>
> Could this ever be NULL ?

Ah, good catch. I think this was an artifact from a previous
revision where it could have been. But, I'll double check.

In the current proposed implementation, however, I don't think it
can be NULL as it is always allocated.