From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net, michael.chan@broadcom.com
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org,
pavan.chebbi@broadcom.com, bjorn@kernel.org, joe@dama.to,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 6/7] eth: bnxt_en: add a local bp variable in the IRQ affinity notifier
Date: Thu, 19 Nov 2026 19:52:13 -0800 [thread overview]
Message-ID: <20261120035214.369158-7-kuba@kernel.org> (raw)
In-Reply-To: <20261120035214.369158-1-kuba@kernel.org>
bnxt_irq_affinity_notify() refers to irq->bp in almost every
statement. Add a local variable to shorten the lines, the next
patch will make the conditions at the end of the function more
complex. No functional change.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v2: new patch
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index a74599c1447a..2c80a39eb8f0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11949,13 +11949,15 @@ static void bnxt_irq_affinity_notify(struct irq_affinity_notify *notify,
{
struct bnxt_irq *irq;
unsigned int cpu;
+ struct bnxt *bp;
int nid;
u16 tag;
irq = container_of(notify, struct bnxt_irq, affinity_notify);
+ bp = irq->bp;
- cpumask_copy(irq->bp->ring_cpu_mask[irq->ring_nr], mask);
- set_bit(irq->ring_nr, irq->bp->ring_affinity_set);
+ cpumask_copy(bp->ring_cpu_mask[irq->ring_nr], mask);
+ set_bit(irq->ring_nr, bp->ring_affinity_set);
/* Readers can't access ring_cpu_mask atomically, so pre-compute
* the info they care about (NUMA node, TPH tag) and store it
@@ -11963,32 +11965,31 @@ static void bnxt_irq_affinity_notify(struct irq_affinity_notify *notify,
*/
cpu = cpumask_first_and(mask, cpu_online_mask);
nid = cpu < nr_cpu_ids ? cpu_to_node(cpu) : NUMA_NO_NODE;
- WRITE_ONCE(irq->bp->ring_nid[irq->ring_nr], nid);
+ WRITE_ONCE(bp->ring_nid[irq->ring_nr], nid);
#ifdef CONFIG_RFS_ACCEL
- if (irq->bp->dev->rx_cpu_rmap && irq->ring_nr < irq->bp->rx_nr_rings) {
+ if (bp->dev->rx_cpu_rmap && irq->ring_nr < bp->rx_nr_rings) {
int err;
- err = cpu_rmap_update(irq->bp->dev->rx_cpu_rmap, irq->ring_nr,
- mask);
+ err = cpu_rmap_update(bp->dev->rx_cpu_rmap, irq->ring_nr, mask);
if (err)
- netdev_warn(irq->bp->dev,
+ netdev_warn(bp->dev,
"aRFS rmap update failed: %d\n", err);
}
#endif
- if (!irq->bp->tph_mode)
+ if (!bp->tph_mode)
return;
- if (irq->ring_nr >= irq->bp->rx_nr_rings)
+ if (irq->ring_nr >= bp->rx_nr_rings)
return;
- if (pcie_tph_get_cpu_st(irq->bp->pdev, TPH_MEM_TYPE_VM,
+ if (pcie_tph_get_cpu_st(bp->pdev, TPH_MEM_TYPE_VM,
cpumask_first(mask), &tag))
return;
WRITE_ONCE(irq->new_tag, tag);
- bnxt_queue_sp_work(irq->bp, BNXT_TPH_UPDATE_SP_EVENT);
+ bnxt_queue_sp_work(bp, BNXT_TPH_UPDATE_SP_EVENT);
}
static void bnxt_irq_affinity_release(struct kref *ref)
--
2.56.1
next prev parent reply other threads:[~2026-11-20 3:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 3:52 [PATCH net-next v2 0/7] eth: bnxt_en: allocate memory on the right NUMA node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 1/7] eth: bnxt_en: order event data before setting the sp_event bit Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 2/7] eth: bnxt_en: follow explicitly set IRQ affinity when placing page pool Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 3/7] eth: bnxt_en: allocate per-queue SW state on the queue's NUMA node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 4/7] eth: bnxt_en: explicitly keep device-only memory on the device's node Jakub Kicinski
2026-11-20 3:52 ` [PATCH net-next v2 5/7] eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node Jakub Kicinski
2026-11-20 3:52 ` Jakub Kicinski [this message]
2026-11-20 3:52 ` [PATCH net-next v2 7/7] eth: bnxt_en: restart Rx queues when their IRQ moves to another " 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=20261120035214.369158-7-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=joe@dama.to \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.