patch 'net/hns3: fix variable type mismatch' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:34:19 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.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 06/27/23. 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=22.11-staging

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From f2dd43a6e92ab5fb9a99e2a2816141525ca9d5c2 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui at huawei.com>
Date: Mon, 22 May 2023 21:17:38 +0800
Subject: [PATCH] net/hns3: fix variable type mismatch
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 ]

Loop conditions are compared with different variable types,
which may cause overflow risks.

Fixes: 67d010346933 ("net/hns3: adjust data type of some variables")
Fixes: 6ee07e3cb589 ("net/hns3: fix insecure way to query MAC statistics")

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
 .mailmap                      | 1 +
 drivers/net/hns3/hns3_regs.c  | 3 ++-
 drivers/net/hns3/hns3_stats.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 73f729c4c6..44d9bd97c6 100644
--- a/.mailmap
+++ b/.mailmap
@@ -298,6 +298,7 @@ Deepak Khandelwal <deepak.khandelwal at intel.com>
 Deepak Kumar Jain <deepak.k.jain at intel.com>
 Deirdre O'Connor <deirdre.o.connor at intel.com>
 Dekel Peled <dekelp at nvidia.com> <dekelp at mellanox.com>
+Dengdui Huang <huangdengdui at huawei.com>
 Denis Pryazhennikov <denis.pryazhennikov at arknetworks.am>
 Dennis Marinus <dmarinus at amazon.com>
 Derek Chickles <derek.chickles at caviumnetworks.com>
diff --git a/drivers/net/hns3/hns3_regs.c b/drivers/net/hns3/hns3_regs.c
index 33392fd1f0..5d6f92e4bb 100644
--- a/drivers/net/hns3/hns3_regs.c
+++ b/drivers/net/hns3/hns3_regs.c
@@ -294,8 +294,9 @@ hns3_direct_access_regs(struct hns3_hw *hw, uint32_t *data)
 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	uint32_t *origin_data_ptr = data;
 	uint32_t reg_offset;
-	uint16_t i, j;
 	size_t reg_num;
+	uint16_t j;
+	size_t i;
 
 	/* fetching per-PF registers values from PF PCIe register space */
 	reg_num = sizeof(cmdq_reg_addrs) / sizeof(uint32_t);
diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index bad65fcbed..c2e692a2c5 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -317,7 +317,7 @@ hns3_update_mac_stats(struct hns3_hw *hw)
 	uint32_t stats_iterms;
 	uint64_t *desc_data;
 	uint32_t desc_num;
-	uint16_t i;
+	uint32_t i;
 	int ret;
 
 	/* The first desc has a 64-bit header, so need to consider it. */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:31:59.627130100 +0800
+++ 0041-net-hns3-fix-variable-type-mismatch.patch	2023-06-25 14:31:58.345773900 +0800
@@ -1 +1 @@
-From 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 Mon Sep 17 00:00:00 2001
+From f2dd43a6e92ab5fb9a99e2a2816141525ca9d5c2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 1bbac8785cdf51bc6c5005c6754eab4d517cc4b0 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index 863dbecdb0..f00c1e5457 100644
+index 73f729c4c6..44d9bd97c6 100644
@@ -25 +27 @@
-@@ -301,6 +301,7 @@ Deepak Khandelwal <deepak.khandelwal at intel.com>
+@@ -298,6 +298,7 @@ Deepak Khandelwal <deepak.khandelwal at intel.com>


More information about the stable mailing list