From: Jakub Kicinski <kuba@kernel.org>
To: Ahmed Zaki <ahmed.zaki@intel.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH RFC net-next 1/2] net: napi: add CPU affinity to napi->config
Date: Sat, 7 Dec 2024 18:24:13 -0800 [thread overview]
Message-ID: <20241207182413.63a2c11a@kernel.org> (raw)
In-Reply-To: <20241206001209.213168-2-ahmed.zaki@intel.com>
On Thu, 5 Dec 2024 17:12:08 -0700 Ahmed Zaki wrote:
> +static inline void
> +netif_napi_affinity_notify(struct irq_affinity_notify *notify,
> + const cpumask_t *mask)
> +{
> + struct napi_struct *napi =
> + container_of(notify, struct napi_struct, affinity_notify);
> +
> + if (napi->config)
> + cpumask_copy(&napi->config->affinity_mask, mask);
> +}
> +
> +static inline void
> +netif_napi_affinity_release(struct kref __always_unused *ref) {}
>
> static inline void netif_napi_set_irq(struct napi_struct *napi, int irq)
> {
> napi->irq = irq;
> +
> + if (irq > 0 && napi->config) {
> + napi->affinity_notify.notify = netif_napi_affinity_notify;
> + napi->affinity_notify.release = netif_napi_affinity_release;
> + irq_set_affinity_notifier(irq, &napi->affinity_notify);
> + irq_set_affinity(irq, &napi->config->affinity_mask);
> + }
> }
Nice, thanks for following up!
Let's move this code to net/core/dev.c or a new file, it's getting
complex for a static inline since there's no perf implication.
next prev parent reply other threads:[~2024-12-08 2:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 0:12 [PATCH RFC net-next 0/2] net: napi: add CPU affinity to napi->config Ahmed Zaki
2024-12-06 0:12 ` [PATCH RFC net-next 1/2] " Ahmed Zaki
2024-12-08 2:24 ` Jakub Kicinski [this message]
2024-12-06 0:12 ` [PATCH RFC net-next 2/2] idpf: use napi's irq affinity Ahmed Zaki
2024-12-06 8:29 ` [Intel-wired-lan] " Paul Menzel
2024-12-06 17:58 ` 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=20241207182413.63a2c11a@kernel.org \
--to=kuba@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=netdev@vger.kernel.org \
/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).