patch 'net/hns3: fix hard-coded default value of UMV space' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 16 23:51:16 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
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/18/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/20b91d360d822d2d8ce3cde5bc017e1da48ea11e
Thanks.
Luca Boccassi
---
>From 20b91d360d822d2d8ce3cde5bc017e1da48ea11e 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 ace7dc94c7..060a46d203 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1501,6 +1501,7 @@ Shrey Khandelwal <s.khandelwal at f5.com>
Shreyansh Jain <shreyansh.jain at nxp.com>
Shrikrishna Khare <skhare at vmware.com>
Shuai Zhu <shuaix.zhu at intel.com>
+Shuaisong Yang <yangshuaisong at h-partners.com>
Shuanglin Wang <shuanglin.wang at broadcom.com>
Shuki Katzenelson <shuki at lightbitslabs.com>
Shun Hao <shunh at nvidia.com>
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index e21a2b652f..5105d3e02b 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -1006,9 +1006,11 @@ 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];
};
struct hns3_query_rpu_cmd {
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index dc70bf3cff..fdb7aed61f 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -992,6 +992,7 @@ hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
return;
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);
}
static int
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 0c9a83eca4..56e0a58eee 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -1330,19 +1330,26 @@ hns3_init_umv_space(struct hns3_hw *hw)
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(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;
}
@@ -2626,8 +2633,6 @@ hns3_parse_cfg(struct hns3_cfg *cfg, struct hns3_cmd_desc *desc)
cfg->umv_space = hns3_get_field(rte_le_to_cpu_32(req->param[1]),
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]),
HNS3_CFG_EXT_RSS_SIZE_M,
@@ -2858,7 +2863,7 @@ hns3_get_board_configuration(struct hns3_hw *hw)
hns3_set_bit(hw->hw_tc_map, 0, 1);
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 70ac2f66f8..ecbfa9dddb 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -841,7 +841,8 @@ struct hns3_pf {
bool support_fc_autoneg; /* support FC autonegotiate */
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.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-16 22:52:16.629523498 +0000
+++ 0002-net-hns3-fix-hard-coded-default-value-of-UMV-space.patch 2026-11-16 22:52:16.416231577 +0000
@@ -1 +1 @@
-From 18083ae8b947988d194bf143c21198ec60f58f1f Mon Sep 17 00:00:00 2001
+From 20b91d360d822d2d8ce3cde5bc017e1da48ea11e 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 ace7dc94c7..060a46d203 100644
@@ -43 +44,2 @@
-@@ -1584,6 +1584,7 @@ Shreyansh Jain <shreyansh.jain at nxp.com>
+@@ -1501,6 +1501,7 @@ Shrey Khandelwal <s.khandelwal at f5.com>
+ Shreyansh Jain <shreyansh.jain at nxp.com>
@@ -45 +46,0 @@
- Shu Shen <shu.shen at radisys.com>
@@ -49 +49,0 @@
- Shujing Dong <shujing.dong at corigine.com>
@@ -50,0 +51 @@
+ Shun Hao <shunh at nvidia.com>
@@ -52 +53 @@
-index 2a2ec155ea..473c4f1ec4 100644
+index e21a2b652f..5105d3e02b 100644
@@ -55 +56 @@
-@@ -1008,9 +1008,11 @@ struct hns3_dev_specs_0_cmd {
+@@ -1006,9 +1006,11 @@ struct hns3_dev_specs_0_cmd {
@@ -70 +71 @@
-index 29b51856d9..4ce7a2c722 100644
+index dc70bf3cff..fdb7aed61f 100644
@@ -73 +74 @@
-@@ -991,6 +991,7 @@ hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
+@@ -992,6 +992,7 @@ hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
@@ -82 +83 @@
-index dbe26df77d..45472722a9 100644
+index 0c9a83eca4..56e0a58eee 100644
@@ -116 +117 @@
-@@ -2560,8 +2567,6 @@ hns3_parse_cfg(struct hns3_cfg *cfg, struct hns3_cmd_desc *desc)
+@@ -2626,8 +2633,6 @@ hns3_parse_cfg(struct hns3_cfg *cfg, struct hns3_cmd_desc *desc)
@@ -125,2 +126,2 @@
-@@ -2792,7 +2797,7 @@ hns3_get_board_configuration(struct hns3_hw *hw)
- hns3_set_bit(hw->dcb_info.hw_tc_map, 0, 1);
+@@ -2858,7 +2863,7 @@ hns3_get_board_configuration(struct hns3_hw *hw)
+ hns3_set_bit(hw->hw_tc_map, 0, 1);
@@ -135 +136 @@
-index b4feff4b94..836d0c5de8 100644
+index 70ac2f66f8..ecbfa9dddb 100644
@@ -138 +139 @@
-@@ -837,7 +837,8 @@ struct hns3_pf {
+@@ -841,7 +841,8 @@ struct hns3_pf {
More information about the stable
mailing list