patch 'net/i40e/base: fix repeated register dumps' has been queued to stable release 23.11.3

Xueming Li xuemingl at nvidia.com
Mon Nov 11 07:27:51 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.3

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/30/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7c44c1b3f8b013f9e53710ddc05663dfe98a8f33

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 7c44c1b3f8b013f9e53710ddc05663dfe98a8f33 Mon Sep 17 00:00:00 2001
From: Radoslaw Tyl <radoslawx.tyl at intel.com>
Date: Mon, 2 Sep 2024 10:54:33 +0100
Subject: [PATCH] net/i40e/base: fix repeated register dumps
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit efc6a6b1facfa160e5e72f55893a301a6b27c628 ]

Currently, when registers are dumped, the data inside them is changed,
so repeated dumps lead to unexpected results. Fix this by making
register list read-only.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Radoslaw Tyl <radoslawx.tyl at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/i40e/base/i40e_diag.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_diag.c b/drivers/net/i40e/base/i40e_diag.c
index b3c4cfd3aa..4ca102cdd5 100644
--- a/drivers/net/i40e/base/i40e_diag.c
+++ b/drivers/net/i40e/base/i40e_diag.c
@@ -55,7 +55,7 @@ static enum i40e_status_code i40e_diag_reg_pattern_test(struct i40e_hw *hw,
 	return I40E_SUCCESS;
 }

-static struct i40e_diag_reg_test_info i40e_reg_list[] = {
+static const struct i40e_diag_reg_test_info i40e_reg_list[] = {
 	/* offset               mask         elements   stride */
 	{I40E_QTX_CTL(0),       0x0000FFBF, 1, I40E_QTX_CTL(1) - I40E_QTX_CTL(0)},
 	{I40E_PFINT_ITR0(0),    0x00000FFF, 3, I40E_PFINT_ITR0(1) - I40E_PFINT_ITR0(0)},
@@ -81,28 +81,28 @@ enum i40e_status_code i40e_diag_reg_test(struct i40e_hw *hw)
 {
 	enum i40e_status_code ret_code = I40E_SUCCESS;
 	u32 reg, mask;
+	u32 elements;
 	u32 i, j;

 	for (i = 0; i40e_reg_list[i].offset != 0 &&
 					     ret_code == I40E_SUCCESS; i++) {

+		elements = i40e_reg_list[i].elements;
 		/* set actual reg range for dynamically allocated resources */
 		if (i40e_reg_list[i].offset == I40E_QTX_CTL(0) &&
 		    hw->func_caps.num_tx_qp != 0)
-			i40e_reg_list[i].elements = hw->func_caps.num_tx_qp;
+			elements = hw->func_caps.num_tx_qp;
 		if ((i40e_reg_list[i].offset == I40E_PFINT_ITRN(0, 0) ||
 		     i40e_reg_list[i].offset == I40E_PFINT_ITRN(1, 0) ||
 		     i40e_reg_list[i].offset == I40E_PFINT_ITRN(2, 0) ||
 		     i40e_reg_list[i].offset == I40E_QINT_TQCTL(0) ||
 		     i40e_reg_list[i].offset == I40E_QINT_RQCTL(0)) &&
 		    hw->func_caps.num_msix_vectors != 0)
-			i40e_reg_list[i].elements =
-				hw->func_caps.num_msix_vectors - 1;
+			elements = hw->func_caps.num_msix_vectors - 1;

 		/* test register access */
 		mask = i40e_reg_list[i].mask;
-		for (j = 0; j < i40e_reg_list[i].elements &&
-			    ret_code == I40E_SUCCESS; j++) {
+		for (j = 0; j < elements && ret_code == I40E_SUCCESS; j++) {
 			reg = i40e_reg_list[i].offset
 				+ (j * i40e_reg_list[i].stride);
 			ret_code = i40e_diag_reg_pattern_test(hw, reg, mask);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-11 14:23:08.297586475 +0800
+++ 0065-net-i40e-base-fix-repeated-register-dumps.patch	2024-11-11 14:23:05.162192839 +0800
@@ -1 +1 @@
-From efc6a6b1facfa160e5e72f55893a301a6b27c628 Mon Sep 17 00:00:00 2001
+From 7c44c1b3f8b013f9e53710ddc05663dfe98a8f33 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit efc6a6b1facfa160e5e72f55893a301a6b27c628 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list