| From fbb3235765f7cea508d4df2b2770acd3f396e274 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Mon, 3 Aug 2026 12:31:34 -0700 |
| Subject: eth: bnxt: decrease indent in bnxt_request_irq() |
| |
| From: Jakub Kicinski <kuba@kernel.org> |
| |
| [ Upstream commit 0fd562c7b9e48e7958f7405e54bf98e8e22ad184 ] |
| |
| bnxt_request_irq() has unnecessary level of indentation. |
| Use continue instead. No need to re-fetch NUMA node for |
| each IRQ, move to the function level. |
| |
| No functional changes. |
| |
| Reviewed-by: Breno Leitao <leitao@debian.org> |
| Link: https://patch.msgid.link/20260803193135.2030368-4-kuba@kernel.org |
| Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
| Stable-dep-of: 51e96fa31f7e ("eth: bnxt: avoid deadlock when canceling IRQ affinity notifier") |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/net/ethernet/broadcom/bnxt/bnxt.c | 46 +++++++++++------------ |
| 1 file changed, 23 insertions(+), 23 deletions(-) |
| |
| diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
| index 4738c0b510bdf..35c8684d1b4ca 100644 |
| --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
| +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
| @@ -11768,6 +11768,7 @@ static void bnxt_free_irq(struct bnxt *bp) |
| |
| static int bnxt_request_irq(struct bnxt *bp) |
| { |
| + const int numa_node = dev_to_node(&bp->pdev->dev); |
| struct cpu_rmap *rmap = NULL; |
| int i, j, rc = 0; |
| unsigned long flags = 0; |
| @@ -11792,6 +11793,7 @@ static int bnxt_request_irq(struct bnxt *bp) |
| for (i = 0, j = 0; i < bp->cp_nr_rings; i++) { |
| int map_idx = bnxt_cp_num_to_irq_num(bp, i); |
| struct bnxt_irq *irq = &bp->irq_tbl[map_idx]; |
| + u16 tag; |
| |
| if (IS_ENABLED(CONFIG_RFS_ACCEL) && |
| rmap && bp->bnapi[i]->rx_ring) { |
| @@ -11810,33 +11812,31 @@ static int bnxt_request_irq(struct bnxt *bp) |
| netif_napi_set_irq_locked(&bp->bnapi[i]->napi, irq->vector); |
| irq->requested = 1; |
| |
| - if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) { |
| - int numa_node = dev_to_node(&bp->pdev->dev); |
| - u16 tag; |
| + if (!zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) |
| + continue; |
| |
| - irq->have_cpumask = 1; |
| - irq->msix_nr = map_idx; |
| - irq->ring_nr = i; |
| - cpumask_set_cpu(cpumask_local_spread(i, numa_node), |
| - irq->cpu_mask); |
| - rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask); |
| - if (rc) { |
| - netdev_warn(bp->dev, |
| - "Update affinity hint failed, IRQ = %d\n", |
| - irq->vector); |
| - break; |
| - } |
| + irq->have_cpumask = 1; |
| + irq->msix_nr = map_idx; |
| + irq->ring_nr = i; |
| + cpumask_set_cpu(cpumask_local_spread(i, numa_node), |
| + irq->cpu_mask); |
| + rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask); |
| + if (rc) { |
| + netdev_warn(bp->dev, |
| + "Update affinity hint failed, IRQ = %d\n", |
| + irq->vector); |
| + break; |
| + } |
| |
| - bnxt_register_irq_notifier(bp, irq); |
| + bnxt_register_irq_notifier(bp, irq); |
| |
| - /* Init ST table entry */ |
| - if (pcie_tph_get_cpu_st(irq->bp->pdev, TPH_MEM_TYPE_VM, |
| - cpumask_first(irq->cpu_mask), |
| - &tag)) |
| - continue; |
| + /* Init ST table entry */ |
| + if (pcie_tph_get_cpu_st(irq->bp->pdev, TPH_MEM_TYPE_VM, |
| + cpumask_first(irq->cpu_mask), |
| + &tag)) |
| + continue; |
| |
| - pcie_tph_set_st_entry(irq->bp->pdev, irq->msix_nr, tag); |
| - } |
| + pcie_tph_set_st_entry(irq->bp->pdev, irq->msix_nr, tag); |
| } |
| return rc; |
| } |
| -- |
| 2.53.0 |
| |