netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ahmed Zaki <ahmed.zaki@intel.com>
Cc: <netdev@vger.kernel.org>, <intel-wired-lan@lists.osuosl.org>,
	<andrew+netdev@lunn.ch>, <edumazet@google.com>,
	<horms@kernel.org>, <pabeni@redhat.com>, <davem@davemloft.net>,
	<michael.chan@broadcom.com>, <tariqt@nvidia.com>,
	<anthony.l.nguyen@intel.com>, <przemyslaw.kitszel@intel.com>,
	<jdamato@fastly.com>, <shayd@nvidia.com>,
	<akpm@linux-foundation.org>, <shayagr@amazon.com>,
	<kalesh-anakkur.purayil@broadcom.com>,
	<pavan.chebbi@broadcom.com>, <yury.norov@gmail.com>,
	<darinzon@amazon.com>
Subject: Re: [PATCH net-next v5 1/6] net: move ARFS rmap management to core
Date: Tue, 14 Jan 2025 17:38:05 -0800	[thread overview]
Message-ID: <20250114173805.23d254a9@kernel.org> (raw)
In-Reply-To: <5e9659aa-d21f-4ee9-8c0a-1d9191bbeb8c@intel.com>

On Tue, 14 Jan 2025 18:00:30 -0700 Ahmed Zaki wrote:
> > Similarly netif_napi_set_irq() may get called with -1 to clear
> > the IRQ number, which you currently treat at a real IRQ id, AFAICT.  
> 
> correct there is no handling for irq = -1. So netif_napi_set_irq() needs 
> to add the irq to the rmap only if it is > 0.
> 
> I need to clarify expectation of netif_napi_set_irq() because I only see 
> it called with irq = -1 in napi_add_weight. But you say it can be called 
> with irq = -1 to "clear" the IRQ.

I _think_ that's what Amritha had in mind. For queue <> NAPI linking
similarly we are expected to call the same helper with a NULL param.

> Does this mean that, if irq = -1, we need to "delete" the irq from rmap 
> if a valid irq already existed (which means this can happen as an 
> alternative to napi_del()/napi_diable())? or just skip adding irq to 
> rmap is enough?

I'm afraid we need both. Most drivers today simply never clear the IRQ,
they will just delete the NAPI and kfree() its memory. So we need to
"catch" NAPIs with IRQs assigned getting deleted and clean up the IRQ.

In the future some drivers may explicitly call the set with -1,
especially now that the IRQ has more implications than just getting
reported via netlink. We need to support that, too.

And for a good measure we should also throw in a warning if a driver
tries to set the IRQ but the IRQ is already set in the NAPI (not -1).

  reply	other threads:[~2025-01-15  1:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 17:10 [PATCH net-next v5 0/6] net: napi: add CPU affinity to napi->config Ahmed Zaki
2025-01-13 17:10 ` [PATCH net-next v5 1/6] net: move ARFS rmap management to core Ahmed Zaki
2025-01-14  9:33   ` Arinzon, David
2025-01-14 22:08   ` Jakub Kicinski
2025-01-15  1:00     ` Ahmed Zaki
2025-01-15  1:38       ` Jakub Kicinski [this message]
2025-01-13 17:10 ` [PATCH net-next v5 2/6] net: napi: add internal ARFS rmap management Ahmed Zaki
2025-01-13 17:10 ` [PATCH net-next v5 3/6] net: napi: add CPU affinity to napi_config Ahmed Zaki
2025-01-13 17:10 ` [PATCH net-next v5 4/6] bnxt: use napi's irq affinity Ahmed Zaki
2025-01-13 17:10 ` [PATCH net-next v5 5/6] ice: " Ahmed Zaki
2025-01-13 17:10 ` [PATCH net-next v5 6/6] idpf: " Ahmed Zaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250114173805.23d254a9@kernel.org \
    --to=kuba@kernel.org \
    --cc=ahmed.zaki@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=darinzon@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jdamato@fastly.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=shayagr@amazon.com \
    --cc=shayd@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).