patch 'net/hns3: fix hard-coded default value of UMV space' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:04:49 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/26. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/d9e7338b59aa0d0f44993871f630b0bd76bb433c

Thanks.

Kevin

---
>From d9e7338b59aa0d0f44993871f630b0bd76bb433c Mon Sep 17 00:00:00 2001
From: Shuaisong Yang <yangshuaisong at h-partners.com>
Date: Wed, 4 Nov 2026 20:40:33 +0800
Subject: [PATCH] net/hns3: fix hard-coded default value of UMV space

[ upstream commit 18083ae8b947988d194bf143c21198ec60f58f1f ]

Currently, the driver obtains the PF's UMV (unicast MAC VLAN) table
space from the board configuration, and falls back to the hard-coded
default value HNS3_DEFAULT_UMV_SPACE_PER_PF (384 = 3072 / 8) when
the firmware reports an empty umv_space field.

The hard-coded value is only accurate for chips with a 3072-entry UMV
table. On chips whose total UMV table size is smaller than 3072, every
PF still requests 384 entries: the first initialized PF occupies the
whole table while the others get nothing, which makes adding unicast
MAC or VLAN entries fail on those ports.

Fix this by obtaining the UMV size from the device specifications
command, whose umv_size field is the default value allocated by the
firmware policy. The requested size is determined at allocation time
in hns3_init_umv_space(), in the following priority:
  1. pf->cfg_umv_size, the user specified value from the board
     configuration
  2. pf->def_umv_size, the default value reported by the firmware
  3. the hard-coded default, as the last fallback for old firmware

Fixes: d51867db65c1 ("net/hns3: add initialization")

Signed-off-by: Shuaisong Yang <yangshuaisong at h-partners.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
 .mailmap                       |  1 +
 drivers/net/hns3/hns3_cmd.h    |  6 ++++--
 drivers/net/hns3/hns3_common.c |  1 +
 drivers/net/hns3/hns3_ethdev.c | 19 ++++++++++++-------
 drivers/net/hns3/hns3_ethdev.h |  3 ++-
 5 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/.mailmap b/.mailmap
index d5ddc450e4..f0fa29886e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1560,4 +1560,5 @@ Shrikrishna Khare <skhare at vmware.com>
 Shu Shen <shu.shen at radisys.com>
 Shuai Zhu <shuaix.zhu at intel.com>
+Shuaisong Yang <yangshuaisong at h-partners.com>
 Shuanglin Wang <shuanglin.wang at broadcom.com>
 Shujing Dong <shujing.dong at corigine.com>
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 2a2ec155ea..473c4f1ec4 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -1009,7 +1009,9 @@ struct hns3_dev_specs_0_cmd {
 
 struct hns3_dev_specs_1_cmd {
-	uint8_t rsv0[12];
+	uint8_t rsv0[8];
+	uint16_t umv_size;
+	uint8_t rsv1[2];
 	uint8_t min_tx_pkt_len;
-	uint8_t rsv1[11];
+	uint8_t rsv2[11];
 };
 
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index 28d7e94ffb..b593e32304 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -992,4 +992,5 @@ hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
 
 	hw->max_tm_rate = rte_le_to_cpu_32(req0->max_tm_rate);
+	hns->pf.def_umv_size = rte_le_to_cpu_16(req1->umv_size);
 }
 
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index b2eab7e1c5..ed5112a08f 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -1331,17 +1331,24 @@ hns3_init_umv_space(struct hns3_hw *hw)
 	struct hns3_pf *pf = &hns->pf;
 	uint16_t allocated_size = 0;
+	uint16_t wanted_umv_size;
 	int ret;
 
-	ret = hns3_set_umv_space(hw, pf->wanted_umv_size, &allocated_size,
+	wanted_umv_size = pf->cfg_umv_size;
+	if (wanted_umv_size == 0)
+		wanted_umv_size = pf->def_umv_size;
+	if (wanted_umv_size == 0)
+		wanted_umv_size = HNS3_DEFAULT_UMV_SPACE_PER_PF;
+
+	ret = hns3_set_umv_space(hw, wanted_umv_size, &allocated_size,
 				 true);
 	if (ret)
 		return ret;
 
-	if (allocated_size < pf->wanted_umv_size)
+	if (allocated_size < wanted_umv_size)
 		PMD_INIT_LOG(WARNING, "Alloc umv space failed, want %u, get %u",
-			     pf->wanted_umv_size, allocated_size);
+			     wanted_umv_size, allocated_size);
 
 	pf->max_umv_size = (!!allocated_size) ? allocated_size :
-						pf->wanted_umv_size;
+						wanted_umv_size;
 	pf->used_umv_size = 0;
 	return 0;
@@ -2561,6 +2568,4 @@ hns3_parse_cfg(struct hns3_cfg *cfg, struct hns3_cmd_desc *desc)
 					HNS3_CFG_UMV_TBL_SPACE_M,
 					HNS3_CFG_UMV_TBL_SPACE_S);
-	if (!cfg->umv_space)
-		cfg->umv_space = HNS3_DEFAULT_UMV_SPACE_PER_PF;
 
 	ext_rss_size_max = hns3_get_field(rte_le_to_cpu_32(req->param[2]),
@@ -2793,5 +2798,5 @@ hns3_get_board_configuration(struct hns3_hw *hw)
 	pf->tx_sch_mode = HNS3_FLAG_TC_BASE_SCH_MODE;
 
-	pf->wanted_umv_size = cfg.umv_space;
+	pf->cfg_umv_size = cfg.umv_space;
 
 	return ret;
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 209b042816..a4c9534ba5 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -838,5 +838,6 @@ struct hns3_pf {
 	bool support_multi_tc_pause;
 
-	uint16_t wanted_umv_size;
+	uint16_t cfg_umv_size;
+	uint16_t def_umv_size;
 	uint16_t max_umv_size;
 	uint16_t used_umv_size;
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:49.468423721 +0000
+++ 0363-net-hns3-fix-hard-coded-default-value-of-UMV-space.patch	2026-12-03 12:52:39.280938774 +0000
@@ -1 +1 @@
-From 18083ae8b947988d194bf143c21198ec60f58f1f Mon Sep 17 00:00:00 2001
+From d9e7338b59aa0d0f44993871f630b0bd76bb433c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 18083ae8b947988d194bf143c21198ec60f58f1f ]
+
@@ -27 +28,0 @@
-Cc: stable at dpdk.org
@@ -40 +41 @@
-index 754dd9e760..b4a4646568 100644
+index d5ddc450e4..f0fa29886e 100644
@@ -43 +44 @@
-@@ -1585,4 +1585,5 @@ Shrikrishna Khare <skhare at vmware.com>
+@@ -1560,4 +1560,5 @@ Shrikrishna Khare <skhare at vmware.com>
@@ -66 +67 @@
-index 29b51856d9..4ce7a2c722 100644
+index 28d7e94ffb..b593e32304 100644
@@ -76 +77 @@
-index dbe26df77d..45472722a9 100644
+index b2eab7e1c5..ed5112a08f 100644
@@ -123 +124 @@
-index b4feff4b94..836d0c5de8 100644
+index 209b042816..a4c9534ba5 100644



More information about the stable mailing list