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,
	David Arinzon <darinzon@amazon.com>
Subject: Re: [PATCH net-next v7 1/5] net: move ARFS rmap management to core
Date: Thu, 6 Feb 2025 18:29:41 -0800	[thread overview]
Message-ID: <20250206182941.12705a4d@kernel.org> (raw)
In-Reply-To: <20250204220622.156061-2-ahmed.zaki@intel.com>

On Tue,  4 Feb 2025 15:06:18 -0700 Ahmed Zaki wrote:
> +void netif_napi_set_irq_locked(struct napi_struct *napi, int irq)
> +{
> +	int rc;
> +
> +	/* Remove existing rmap entries */
> +	if (napi->dev->rx_cpu_rmap_auto &&
> +	    napi->irq != irq && napi->irq > 0)

this condition gets a bit hairy by the end of the series.
could you add a napi state bit that indicates that a notifier is
installed? Then here:

	if (napi->irq == irq)
		return;

	if (test_and_clear_bit(NAPI_STATE_HAS_NOTIFIER, &napi->state))
		irq_set_affinity_notifier(napi->irq, NULL);
	if (irq < 0)
		return;

And you can similarly simplify napi_disable_locked().

Speaking of which, why do the auto-removal in napi_disable()
rather than netif_napi_del() ? We don't reinstall on napi_enable()
and doing a disable() + enable() is fairly common during driver
reconfig.

> +		irq_set_affinity_notifier(napi->irq, NULL);
> +
> +	napi->irq = irq;
> +	if (irq > 0) {
> +		rc = napi_irq_cpu_rmap_add(napi, irq);
> +		if (rc)
> +			netdev_warn(napi->dev, "Unable to update ARFS map (%d)\n",

nit: not sure I'd grasp this message as a user, maybe:

	"Unable to install aRFS CPU to Rx queue mapping"

? Not great either, I guess.

  reply	other threads:[~2025-02-07  2:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 22:06 [PATCH net-next v7 0/5] net: napi: add CPU affinity to napi->config Ahmed Zaki
2025-02-04 22:06 ` [PATCH net-next v7 1/5] net: move ARFS rmap management to core Ahmed Zaki
2025-02-07  2:29   ` Jakub Kicinski [this message]
2025-02-10 15:04     ` Ahmed Zaki
2025-02-11  0:13       ` Jakub Kicinski
2025-02-04 22:06 ` [PATCH net-next v7 2/5] net: napi: add CPU affinity to napi_config Ahmed Zaki
2025-02-04 22:43   ` Joe Damato
2025-02-05 15:20     ` Ahmed Zaki
2025-02-07  2:33       ` Jakub Kicinski
2025-02-07  2:37   ` Jakub Kicinski
2025-02-04 22:06 ` [PATCH net-next v7 3/5] bnxt: use napi's irq affinity Ahmed Zaki
2025-02-04 22:06 ` [PATCH net-next v7 4/5] ice: " Ahmed Zaki
2025-02-04 22:06 ` [PATCH net-next v7 5/5] idpf: " Ahmed Zaki
2025-02-07  0:24 ` [PATCH net-next v7 0/5] net: napi: add CPU affinity to napi->config Joe Damato
2025-02-07 18:47 ` Jakub Kicinski

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=20250206182941.12705a4d@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=przemyslaw.kitszel@intel.com \
    --cc=shayagr@amazon.com \
    --cc=shayd@nvidia.com \
    --cc=tariqt@nvidia.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).