patch 'net/hns3: separate setting RSS types' has been queued to stable release 22.11.2
Xueming Li
xuemingl at nvidia.com
Sun Apr 9 17:24:28 CEST 2023
Hi,
FYI, your patch has been queued to stable release 22.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/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/log/?h=22.11-staging/commit/679028a2ee4dc7c491d0129986d5e2bafc0277ca
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 679028a2ee4dc7c491d0129986d5e2bafc0277ca Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Fri, 10 Mar 2023 17:35:11 +0800
Subject: [PATCH] net/hns3: separate setting RSS types
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ]
The settings of RSS types comes from the ethdev ops (like, dev_configure
and rss_hash_update) and rte_flow API. For the ethdev ops, driver has to
save it so as to it can be restored when reset is triggered.
While rte_flow API no need to maintain this field, it can be restored by
the saved rule.
Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
drivers/net/hns3/hns3_flow.c | 3 ++-
drivers/net/hns3/hns3_rss.c | 22 ++++++++++++++--------
drivers/net/hns3/hns3_rss.h | 1 +
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 875c0eec11..9e51891bd9 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1433,6 +1433,7 @@ hns3_disable_rss(struct hns3_hw *hw)
ret = hns3_set_rss_tuple_by_rss_hf(hw, 0);
if (ret)
return ret;
+ hw->rss_info.rss_hf = 0;
return 0;
}
@@ -1580,7 +1581,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
/* Filter the unsupported flow types */
flow_types = conf->conf.types ?
rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
- hw->rss_info.conf.types;
+ hw->rss_info.rss_hf;
if (flow_types != rss_flow_conf.types)
hns3_warn(hw, "modified RSS types based on hardware support,"
" requested:0x%" PRIx64 " configured:0x%" PRIx64,
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 751033d98f..f51d70a8e5 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -628,9 +628,6 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
return ret;
}
- /* Update supported flow types when set tuple success */
- hw->rss_info.conf.types = rss_hf;
-
return 0;
}
@@ -648,7 +645,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
struct rte_eth_rss_conf *rss_conf)
{
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- uint64_t rss_hf_bk = hw->rss_info.conf.types;
+ uint64_t rss_hf_bk = hw->rss_info.rss_hf;
uint8_t key_len = rss_conf->rss_key_len;
uint64_t rss_hf = rss_conf->rss_hf;
uint8_t *key = rss_conf->rss_key;
@@ -673,6 +670,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
/* Update the shadow RSS key with user specified */
memcpy(hw->rss_info.key, key, hw->rss_key_size);
}
+ hw->rss_info.rss_hf = rss_hf;
rte_spinlock_unlock(&hw->lock);
return 0;
@@ -1030,6 +1028,7 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
/* Default hash algorithm */
rss_cfg->hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
+ hw->rss_info.rss_hf = 0;
memcpy(rss_cfg->key, hns3_hash_key,
RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
@@ -1067,15 +1066,22 @@ hns3_config_rss(struct hns3_adapter *hns)
return ret;
/*
- * When muli-queue RSS mode flag is not set or unsupported tuples are
+ * When multi-queue RSS mode flag is not set or unsupported tuples are
* set, disable all tuples.
*/
- rss_hf = hw->rss_info.conf.types;
+ rss_hf = hw->rss_info.rss_hf;
if (!((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) ||
!(rss_hf & HNS3_ETH_RSS_SUPPORT))
rss_hf = 0;
- return hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
+ ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
+ if (ret != 0) {
+ hns3_err(hw, "set RSS tuples failed, ret = %d.", ret);
+ return ret;
+ }
+ hw->rss_info.rss_hf = rss_hf;
+
+ return 0;
}
/*
@@ -1093,5 +1099,5 @@ hns3_rss_uninit(struct hns3_adapter *hns)
return;
/* Disable RSS */
- hw->rss_info.conf.types = 0;
+ hw->rss_info.rss_hf = 0;
}
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 6e679b709b..21b90789d0 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -41,6 +41,7 @@
struct hns3_rss_conf {
/* RSS parameters :algorithm, flow_types, key, queue */
struct rte_flow_action_rss conf;
+ uint64_t rss_hf;
uint8_t hash_algo; /* hash function type defined by hardware */
uint8_t rte_flow_hash_algo;
uint8_t key[HNS3_RSS_KEY_SIZE_MAX]; /* Hash key */
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-04-09 21:45:40.826818000 +0800
+++ 0080-net-hns3-separate-setting-RSS-types.patch 2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From 791e56935e488b8154a83daaf3952e1901ed7552 Mon Sep 17 00:00:00 2001
+From 679028a2ee4dc7c491d0129986d5e2bafc0277ca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ]
@@ -12,2 +14,0 @@
-Cc: stable at dpdk.org
-
@@ -23 +24 @@
-index d5db09a263..21e00e515e 100644
+index 875c0eec11..9e51891bd9 100644
More information about the stable
mailing list