diff --git a/patches.suse/bnxt_en-Fix-mqprio-and-XDP-ring-checking-logic.patch b/patches.suse/bnxt_en-Fix-mqprio-and-XDP-ring-checking-logic.patch new file mode 100644 index 0000000..ad4ec0c --- /dev/null +++ b/patches.suse/bnxt_en-Fix-mqprio-and-XDP-ring-checking-logic.patch @@ -0,0 +1,45 @@ +From: Michael Chan <michael.chan@broadcom.com> +Date: Fri, 10 Feb 2023 12:31:55 -0500 +Subject: bnxt_en: Fix mqprio and XDP ring checking logic +Patch-mainline: v6.2 +Git-commit: 2038cc592811209de20c4e094ca08bfb1e6fbc6c +References: bsc#1209079 + +In bnxt_reserve_rings(), there is logic to check that the number of TX +rings reserved is enough to cover all the mqprio TCs, but it fails to +account for the TX XDP rings. So the check will always fail if there +are mqprio TCs and TX XDP rings. As a result, the driver always fails +to initialize after the XDP program is attached and the device will be +brought down. A subsequent ifconfig up will also fail because the +number of TX rings is set to an inconsistent number. Fix the check to +properly account for TX XDP rings. If the check fails, set the number +of TX rings back to a consistent number after calling netdev_reset_tc(). + +Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.") +Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com> +Signed-off-by: Michael Chan <michael.chan@broadcom.com> +Signed-off-by: David S. Miller <davem@davemloft.net> +Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -9239,10 +9239,14 @@ int bnxt_reserve_rings(struct bnxt *bp, + netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc); + return rc; + } +- if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) { ++ if (tcs && (bp->tx_nr_rings_per_tc * tcs != ++ bp->tx_nr_rings - bp->tx_nr_rings_xdp)) { + netdev_err(bp->dev, "tx ring reservation failure\n"); + netdev_reset_tc(bp->dev); +- bp->tx_nr_rings_per_tc = bp->tx_nr_rings; ++ if (bp->tx_nr_rings_xdp) ++ bp->tx_nr_rings_per_tc = bp->tx_nr_rings_xdp; ++ else ++ bp->tx_nr_rings_per_tc = bp->tx_nr_rings; + return -ENOMEM; + } + return 0; diff --git a/series.conf b/series.conf index c30ecbf..6dc361a 100644 --- a/series.conf +++ b/series.conf @@ -36882,6 +36882,7 @@ patches.suse/module-Don-t-wait-for-GOING-modules.patch patches.suse/rds-rds_rm_zerocopy_callback-use-list_first_entry.patch patches.suse/Fix-page-corruption-caused-by-racy-check-in-__free_pages.patch + patches.suse/bnxt_en-Fix-mqprio-and-XDP-ring-checking-logic.patch patches.suse/fbdev-Fix-invalid-page-access-after-closing-deferred.patch patches.suse/ibmvnic-Toggle-between-queue-types-in-affinity-mappi.patch patches.suse/rds-rds_rm_zerocopy_callback-correct-order-for-list_add_tail.patch