]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
eth: bnxt: keep the aRFS rmap updated when TPH is enabled
authorJakub Kicinski <kuba@kernel.org>
Mon, 3 Aug 2026 19:31:33 +0000 (12:31 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 10 Aug 2026 22:15:06 +0000 (15:15 -0700)
The TPH support must have broken aRFS in bnxt. IRQ can only have one
notifier, so installing the TPH notifier is overriding the one implicitly
installed by irq_cpu_rmap_add().

Make sure we call cpu_rmap_update() from the TPH notifier.

We need to be careful with the ordering and not free the rmap
until we unregistered the notifier. Note that moving the rmap
freeing after the early return in bnxt_free_irq() is fine -
there's no path that could leave rmap with irq_tbl being NULL.

Fixes: c214410c47d6 ("bnxt_en: Add TPH support in BNXT driver")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20260803193135.2030368-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 98c5d6d4b2cf71ad0e72d0a0ac42d866f4e156ba..505d1afea71c71bc6f350ee113b944ccd47afbfd 100644 (file)
@@ -11793,6 +11793,16 @@ static void bnxt_irq_affinity_notify(struct irq_affinity_notify *notify,
 
        irq = container_of(notify, struct bnxt_irq, affinity_notify);
 
+#ifdef CONFIG_RFS_ACCEL
+       if (irq->bp->dev->rx_cpu_rmap && irq->ring_nr < irq->bp->rx_nr_rings) {
+               err = cpu_rmap_update(irq->bp->dev->rx_cpu_rmap, irq->ring_nr,
+                                     mask);
+               if (err)
+                       netdev_warn(irq->bp->dev,
+                                   "aRFS rmap update failed: %d\n", err);
+       }
+#endif
+
        if (!irq->bp->tph_mode)
                return;
 
@@ -11866,10 +11876,6 @@ static void bnxt_free_irq(struct bnxt *bp)
        struct bnxt_irq *irq;
        int i;
 
-#ifdef CONFIG_RFS_ACCEL
-       free_irq_cpu_rmap(bp->dev->rx_cpu_rmap);
-       bp->dev->rx_cpu_rmap = NULL;
-#endif
        if (!bp->irq_tbl || !bp->bnapi)
                return;
 
@@ -11895,6 +11901,11 @@ static void bnxt_free_irq(struct bnxt *bp)
        /* Disable TPH support */
        pcie_disable_tph(bp->pdev);
        bp->tph_mode = 0;
+
+#ifdef CONFIG_RFS_ACCEL
+       free_irq_cpu_rmap(bp->dev->rx_cpu_rmap);
+       bp->dev->rx_cpu_rmap = NULL;
+#endif
 }
 
 static int bnxt_request_irq(struct bnxt *bp)