From: Jakub Kicinski <kuba@kernel.org>
To: Joe Damato <jdamato@fastly.com>
Cc: Ahmed Zaki <ahmed.zaki@intel.com>,
netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
andrew+netdev@lunn.ch, edumazet@google.com, pabeni@redhat.com,
davem@davemloft.net, michael.chan@broadcom.com,
tariqt@nvidia.com, anthony.l.nguyen@intel.com,
przemyslaw.kitszel@intel.com
Subject: Re: [PATCH v1 net-next 2/6] net: napi: add CPU affinity to napi->config
Date: Tue, 10 Dec 2024 20:21:11 -0800 [thread overview]
Message-ID: <20241210202111.7d3a2dc8@kernel.org> (raw)
In-Reply-To: <Z1eZXKe58ncARD2N@LQ3V64L9R2>
On Mon, 9 Dec 2024 17:29:00 -0800 Joe Damato wrote:
> My understanding when I attempted this was that using generic IRQ
> notifiers breaks ARFS [1], because IRQ notifiers only support a
> single notifier and so drivers with ARFS can't _also_ set their own
> notifiers for that.
Ah, you are so right, I forgot the details and was grepping for
notifier registration :S
> Two ideas were proposed in the thread I mentioned:
> 1. Have multiple notifiers per IRQ so that having a generic core
> based notifier wouldn't break ARFS.
> 2. Jakub mentioned calling cpu_rmap_update from the core so that a
> generic solution wouldn't be blocked.
>
> I don't know anything about option 1, so I looked at option 2.
>
> At the time when I read the code, it seemed that cpu_rmap_update
> required some state be passed in (struct irq_glue), so in that case,
> the only way to call cpu_rmap_update from the core would be to
> maintain some state about ARFS in the core, too, so that drivers
> which support ARFS won't be broken by this change.
>
> At that time there was no persistent per-NAPI config, but since
> there is now, there might be a way to solve this.
>
> Just guessing here, but maybe one way to solve this would be to move
> ARFS into the core by:
> - Adding a new bit in addition to NAPIF_F_IRQ_AFFINITY... I don't
> know NAPIF_F_ARFS_AFFINITY or something? so that drivers
> could express that they support ARFS.
> - Remove the driver calls to irq_cpu_rmap_add and make sure to
> pass the new bit in for drivers that support ARFS (in your
> changeset, I believe that would be at least ice, mlx4, and
> bnxt... possibly more?).
> - In the generic core code, if the ARFS bit is set then you pass
> in the state needed for ARFS to work, otherwise do what the
> proposed code is doing now.
SG, maybe I'd put the flag(s) in struct net_device, so that we are sure
the whole device either wants the new behavior or not.
I say flag(s) because idpf probably wants just to opt in for affinity
mask management, without ARFS. So pretty close to Ahmed's existing code.
ARFS support will require another flag to ask for rmap management in
the core as you describe.
next prev parent reply other threads:[~2024-12-11 4:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 0:26 [PATCH v1 net-next 0/6] net: napi: add CPU affinity to napi->config Ahmed Zaki
2024-12-10 0:26 ` [PATCH v1 net-next 1/6] net: napi: add irq_flags to napi struct Ahmed Zaki
2024-12-10 0:26 ` [PATCH v1 net-next 2/6] net: napi: add CPU affinity to napi->config Ahmed Zaki
2024-12-10 1:29 ` Joe Damato
2024-12-11 4:21 ` Jakub Kicinski [this message]
2024-12-11 16:33 ` Ahmed Zaki
2024-12-10 0:26 ` [PATCH v1 net-next 3/6] bnxt: use napi's irq affinity Ahmed Zaki
2024-12-10 0:26 ` [PATCH v1 net-next 4/6] mlx4: " Ahmed Zaki
2024-12-10 0:26 ` [PATCH v1 net-next 5/6] ice: " Ahmed Zaki
2024-12-10 0:26 ` [PATCH v1 net-next 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=20241210202111.7d3a2dc8@kernel.org \
--to=kuba@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jdamato@fastly.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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).