[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250206183352.4cecc85e@kernel.org>
Date: Thu, 6 Feb 2025 18:33:52 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Ahmed Zaki <ahmed.zaki@...el.com>
Cc: Joe Damato <jdamato@...tly.com>, <netdev@...r.kernel.org>,
<intel-wired-lan@...ts.osuosl.org>, <andrew+netdev@...n.ch>,
<edumazet@...gle.com>, <horms@...nel.org>, <pabeni@...hat.com>,
<davem@...emloft.net>, <michael.chan@...adcom.com>, <tariqt@...dia.com>,
<anthony.l.nguyen@...el.com>, <przemyslaw.kitszel@...el.com>,
<shayd@...dia.com>, <akpm@...ux-foundation.org>, <shayagr@...zon.com>,
<kalesh-anakkur.purayil@...adcom.com>
Subject: Re: [PATCH net-next v7 2/5] net: napi: add CPU affinity to
napi_config
On Wed, 5 Feb 2025 08:20:20 -0700 Ahmed Zaki wrote:
> >> + if (napi->dev->rx_cpu_rmap_auto) {
> >> rc = napi_irq_cpu_rmap_add(napi, irq);
> >> if (rc)
> >> netdev_warn(napi->dev, "Unable to update ARFS map (%d)\n",
> >> rc);
> >> + } else if (napi->config && napi->dev->irq_affinity_auto) {
> >> + napi->notify.notify = netif_napi_irq_notify;
> >> + napi->notify.release = netif_napi_affinity_release;
> >> +
> >> + rc = irq_set_affinity_notifier(irq, &napi->notify);
> >> + if (rc)
> >> + netdev_warn(napi->dev, "Unable to set IRQ notifier (%d)\n",
> >> + rc);
> >> }
> >
> > Should there be a WARN_ON or WARN_ON_ONCE in here somewhere if the
> > driver calls netif_napi_set_irq_locked but did not link NAPI config
> > with a call to netif_napi_add_config?
> >
> > It seems like in that case the driver is buggy and a warning might
> > be helpful.
> >
>
> I think that is a good idea, if there is a new version I can add this in
> the second part of the if:
>
>
> if (WARN_ON_ONCE(!napi->config))
> return;
To be clear, this will make it illegal to set IRQ on a NAPI instance
before it's listed. Probably for the best if we also have auto-remove
in netif_napi_del().
Powered by blists - more mailing lists