patch 'net/bnx2x: fix possible infinite loop at startup' has been queued to stable release 22.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 21 00:41:33 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/22/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0ff8ac46bab033dd2366f450366cff20b2b9d4c4

Thanks.

Luca Boccassi

---
>From 0ff8ac46bab033dd2366f450366cff20b2b9d4c4 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 12 Nov 2024 09:43:55 -0800
Subject: [PATCH] net/bnx2x: fix possible infinite loop at startup

[ upstream commit a47272b052dd1c8c571a1c0b89b56aaa3ebf4351 ]

Coverity spotted that one of the loop conditions was always true.
Fix by initializing the variable using same logic as Linux
kernel driver.

Coverity issue: 362057
Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/bnx2x/bnx2x.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 8e6d2c5c80..a93642650a 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -10337,12 +10337,13 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc)
 	REG_WR(sc, PXP2_REG_RD_DISABLE_INPUTS, 0);
 
 	if (!CHIP_IS_E1x(sc)) {
-		int factor = 0;
+		int factor = CHIP_REV_IS_EMUL(sc) ? 1000 :
+				(CHIP_REV_IS_FPGA(sc) ? 400 : 0);
 
 		ecore_init_block(sc, BLOCK_PGLUE_B, PHASE_COMMON);
 		ecore_init_block(sc, BLOCK_ATC, PHASE_COMMON);
 
-/* let the HW do it's magic... */
+		/* let the HW do it's magic... */
 		do {
 			DELAY(200000);
 			val = REG_RD(sc, ATC_REG_ATC_INIT_DONE);
-- 
2.45.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-20 23:41:23.015527193 +0000
+++ 0008-net-bnx2x-fix-possible-infinite-loop-at-startup.patch	2024-11-20 23:41:22.700195467 +0000
@@ -1 +1 @@
-From a47272b052dd1c8c571a1c0b89b56aaa3ebf4351 Mon Sep 17 00:00:00 2001
+From 0ff8ac46bab033dd2366f450366cff20b2b9d4c4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a47272b052dd1c8c571a1c0b89b56aaa3ebf4351 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index af31ac4604..d96fcb55c9 100644
+index 8e6d2c5c80..a93642650a 100644
@@ -23 +24 @@
-@@ -10331,12 +10331,13 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc)
+@@ -10337,12 +10337,13 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc)


More information about the stable mailing list