[PATCH 22/54] net/bnxt: fix default rss config
Manish Kurup
manish.kurup at broadcom.com
Tue Sep 30 02:35:32 CEST 2025
From: Sriharsha Basavapatna <sriharsha.basavapatna at broadcom.com>
On Thor2, the set of supported RSS hash types reported in
dev_info->flow_type_rss_offloads includes both IPV6 and
IPV6_FLOW_LABEL. However, hardware support is mutually exculsive.
That is, either hash type IPV6 or IPV6_FLOW_LABEL can be
specified, but not both.
But, an application (such as testpmd) that sets the default
hash types based on dev_info could end up specifying both bits
in rss_conf->rss_hf field. This results in an error when both
are set in HWRM_VNIC_RSS_CFG command.
testpmd> port config all rss default
bnxt_hwrm_vnic_rss_cfg_p5(): error 2:0:00000000:0000
Configuration of RSS hash at ethernet port 0 failed with
error (22): Invalid argument.
bnxt_hwrm_vnic_rss_cfg_p5(): error 2:0:00000000:0000
Configuration of RSS hash at ethernet port 1 failed with
error (22): Invalid argument.
Fix this issue by specifying only hash type IPV6_FLOW_LABEL in
the hwrm, when both are specified in the rte command. This works
since the hw includes IPV6 src and dst fields also in its hash
function when the type is IPV6_FLOW_LABEL.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 11 +++++++++++
drivers/net/bnxt/bnxt_vnic.c | 10 +++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7edfd8ca89..7177941e09 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2485,6 +2485,17 @@ static int bnxt_rss_hash_conf_get_op(struct rte_eth_dev *eth_dev,
memcpy(rss_conf->rss_key, vnic->rss_hash_key, len);
}
bnxt_hwrm_rss_to_rte_hash_conf(vnic, &rss_conf->rss_hf);
+ /* HASH_TYPE_IPV6_FLOW_LABEL and HASH_TYPE_IPV6 are mutually
+ * exclusive in hardware. See related comments in
+ * bnxt_rte_to_hwrm_hash_types(). If the cached user config
+ * has both bits enabled, make sure both are reported in
+ * conf_get_op().
+ */
+ if (bp->rss_conf.rss_hf &&
+ (bp->rss_conf.rss_hf &
+ (RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_IPV6_FLOW_LABEL)) &&
+ (rss_conf->rss_hf & RTE_ETH_RSS_IPV6_FLOW_LABEL))
+ rss_conf->rss_hf |= RTE_ETH_RSS_IPV6;
rss_conf->rss_hf |=
bnxt_hwrm_to_rte_rss_level(bp, vnic->hash_mode);
} else {
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 637e9b9aa4..f0ec87198f 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -285,8 +285,16 @@ uint32_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type)
hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6;
if (rte_type & RTE_ETH_RSS_NONFRAG_IPV6_UDP)
hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6;
- if (rte_type & RTE_ETH_RSS_IPV6_FLOW_LABEL)
+ if (rte_type & RTE_ETH_RSS_IPV6_FLOW_LABEL) {
+ /* HASH_TYPE_IPV6_FLOW_LABEL and HASH_TYPE_IPV6 are mutually
+ * exclusive. If both bits are specified in rte_type, set only
+ * HASH_TYPE_IPV6_FLOW_LABEL in hardware since it subsumes
+ * HASH_TYPE_IPV6 (see comments for HASH_TYPE_IPV6_FLOW_LABEL
+ * in hsi.h).
+ */
hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL;
+ hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6;
+ }
if (rte_type & RTE_ETH_RSS_ESP)
hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 |
HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV6;
--
2.39.5 (Apple Git-154)
More information about the dev
mailing list