patch 'net/hns3: fix RSS flow rule restore' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 3 10:27:37 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

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/05/22. 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/10404a6eca91f66cef2b36f8a549984d916d2b59

Thanks.

Luca Boccassi

---
>From 10404a6eca91f66cef2b36f8a549984d916d2b59 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Fri, 30 Sep 2022 15:22:05 +0800
Subject: [PATCH] net/hns3: fix RSS flow rule restore

[ upstream commit 43d8adf3891c3686d9a09a5e35897d3fb824fea8 ]

After reset process, types of RSS flow rule cannot be restored when
load driver without RTE_ETH_MQ_RX_RSS_FLAG flag. This is because the
restoration for RSS flow rule is done in the 'hns3_config_rss()'. But
this function is also used to configure and restore RSS configuration
from ethdev ops, and doesn't configure RSS types if 'rxmode.mq_mode'
has not the flag. As a result, RSS types configured by rte flow API
can't be restored in this case when encounter reset. Actually, all
RSS rules are saved to a global link list.

Use the linked list to restore RSS flow rule.

Fixes: 920be799dbc3 ("net/hns3: fix RSS indirection table configuration")

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 11 ++---------
 drivers/net/hns3/hns3_ethdev_vf.c | 11 ++---------
 drivers/net/hns3/hns3_flow.c      |  8 +++++++-
 drivers/net/hns3/hns3_rss.h       |  2 +-
 4 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index eb075c8331..7ae9456664 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4890,6 +4890,7 @@ static int
 hns3_do_start(struct hns3_adapter *hns, bool reset_queue)
 {
 	struct hns3_hw *hw = &hns->hw;
+	struct rte_eth_dev *dev = &rte_eth_devices[hw->data->port_id];
 	int ret;
 
 	ret = hns3_update_queue_map_configure(hns);
@@ -4910,7 +4911,7 @@ hns3_do_start(struct hns3_adapter *hns, bool reset_queue)
 		PMD_INIT_LOG(ERR, "failed to enable MAC, ret = %d", ret);
 		goto err_config_mac_mode;
 	}
-	return 0;
+	return hns3_restore_filter(dev);
 
 err_config_mac_mode:
 	hns3_dev_release_mbufs(hns);
@@ -5018,12 +5019,6 @@ hns3_restore_rx_interrupt(struct hns3_hw *hw)
 	return 0;
 }
 
-static void
-hns3_restore_filter(struct rte_eth_dev *dev)
-{
-	hns3_restore_rss_filter(dev);
-}
-
 static int
 hns3_dev_start(struct rte_eth_dev *dev)
 {
@@ -5075,8 +5070,6 @@ hns3_dev_start(struct rte_eth_dev *dev)
 	hns3_mp_req_start_rxtx(dev);
 	rte_eal_alarm_set(HNS3_SERVICE_INTERVAL, hns3_service_handler, dev);
 
-	hns3_restore_filter(dev);
-
 	/* Enable interrupt of all rx queues before enabling queues */
 	hns3_dev_all_rx_queue_intr_enable(hw, true);
 
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index be6e37d4b4..d8739da89a 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -2085,6 +2085,7 @@ static int
 hns3vf_do_start(struct hns3_adapter *hns, bool reset_queue)
 {
 	struct hns3_hw *hw = &hns->hw;
+	struct rte_eth_dev *dev = &rte_eth_devices[hw->data->port_id];
 	uint16_t nb_rx_q = hw->data->nb_rx_queues;
 	uint16_t nb_tx_q = hw->data->nb_tx_queues;
 	int ret;
@@ -2097,7 +2098,7 @@ hns3vf_do_start(struct hns3_adapter *hns, bool reset_queue)
 	if (ret)
 		hns3_err(hw, "failed to init queues, ret = %d.", ret);
 
-	return ret;
+	return hns3_restore_filter(dev);
 }
 
 static int
@@ -2194,12 +2195,6 @@ hns3vf_restore_rx_interrupt(struct hns3_hw *hw)
 	return 0;
 }
 
-static void
-hns3vf_restore_filter(struct rte_eth_dev *dev)
-{
-	hns3_restore_rss_filter(dev);
-}
-
 static int
 hns3vf_dev_start(struct rte_eth_dev *dev)
 {
@@ -2250,8 +2245,6 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
 	hns3_mp_req_start_rxtx(dev);
 	hns3vf_service_handler(dev);
 
-	hns3vf_restore_filter(dev);
-
 	/* Enable interrupt of all rx queues before enabling queues */
 	hns3_dev_all_rx_queue_intr_enable(hw, true);
 
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 6cb935cf0b..c71a22e6a6 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1623,7 +1623,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
 	return ret;
 }
 
-int
+static int
 hns3_restore_rss_filter(struct rte_eth_dev *dev)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
@@ -1649,6 +1649,12 @@ out:
 	return ret;
 }
 
+int
+hns3_restore_filter(struct rte_eth_dev *dev)
+{
+	return hns3_restore_rss_filter(dev);
+}
+
 static int
 hns3_flow_parse_rss(struct rte_eth_dev *dev,
 		    const struct hns3_rss_conf *conf, bool add)
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 47dfda3d09..b8ada8b07c 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -110,6 +110,6 @@ int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
 int hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key);
-int hns3_restore_rss_filter(struct rte_eth_dev *dev);
+int hns3_restore_filter(struct rte_eth_dev *dev);
 
 #endif /* _HNS3_RSS_H_ */
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-03 09:27:30.135420120 +0000
+++ 0079-net-hns3-fix-RSS-flow-rule-restore.patch	2022-11-03 09:27:25.525425383 +0000
@@ -1 +1 @@
-From 43d8adf3891c3686d9a09a5e35897d3fb824fea8 Mon Sep 17 00:00:00 2001
+From 10404a6eca91f66cef2b36f8a549984d916d2b59 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 43d8adf3891c3686d9a09a5e35897d3fb824fea8 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -26,3 +27,2 @@
- drivers/net/hns3/hns3_flow.h      |  1 +
- drivers/net/hns3/hns3_rss.h       |  1 -
- 5 files changed, 12 insertions(+), 20 deletions(-)
+ drivers/net/hns3/hns3_rss.h       |  2 +-
+ 4 files changed, 12 insertions(+), 20 deletions(-)
@@ -31 +31 @@
-index 3d9f7c6ec7..b0f69589d9 100644
+index eb075c8331..7ae9456664 100644
@@ -34 +34 @@
-@@ -5006,6 +5006,7 @@ static int
+@@ -4890,6 +4890,7 @@ static int
@@ -39 +38,0 @@
- 	bool link_en;
@@ -42,4 +41,5 @@
-@@ -5042,7 +5043,7 @@ hns3_do_start(struct hns3_adapter *hns, bool reset_queue)
- 	if (ret)
- 		goto err_set_link_speed;
- 
+ 	ret = hns3_update_queue_map_configure(hns);
+@@ -4910,7 +4911,7 @@ hns3_do_start(struct hns3_adapter *hns, bool reset_queue)
+ 		PMD_INIT_LOG(ERR, "failed to enable MAC, ret = %d", ret);
+ 		goto err_config_mac_mode;
+ 	}
@@ -49,4 +49,4 @@
- err_set_link_speed:
- 	(void)hns3_cfg_mac_mode(hw, false);
-@@ -5059,12 +5060,6 @@ err_config_mac_mode:
- 	return ret;
+ err_config_mac_mode:
+ 	hns3_dev_release_mbufs(hns);
+@@ -5018,12 +5019,6 @@ hns3_restore_rx_interrupt(struct hns3_hw *hw)
+ 	return 0;
@@ -64,2 +64 @@
-@@ -5121,8 +5116,6 @@ hns3_dev_start(struct rte_eth_dev *dev)
- 	hns3_set_rxtx_function(dev);
+@@ -5075,8 +5070,6 @@ hns3_dev_start(struct rte_eth_dev *dev)
@@ -66,0 +66 @@
+ 	rte_eal_alarm_set(HNS3_SERVICE_INTERVAL, hns3_service_handler, dev);
@@ -74 +74 @@
-index a72535eb7d..bc8f5ecec2 100644
+index be6e37d4b4..d8739da89a 100644
@@ -77 +77 @@
-@@ -1727,6 +1727,7 @@ static int
+@@ -2085,6 +2085,7 @@ static int
@@ -85 +85 @@
-@@ -1741,13 +1742,7 @@ hns3vf_do_start(struct hns3_adapter *hns, bool reset_queue)
+@@ -2097,7 +2098,7 @@ hns3vf_do_start(struct hns3_adapter *hns, bool reset_queue)
@@ -90,2 +90,8 @@
--}
--
++	return hns3_restore_filter(dev);
+ }
+ 
+ static int
+@@ -2194,12 +2195,6 @@ hns3vf_restore_rx_interrupt(struct hns3_hw *hw)
+ 	return 0;
+ }
+ 
@@ -96,3 +102,2 @@
-+	return hns3_restore_filter(dev);
- }
- 
+-}
+-
@@ -100,2 +105,3 @@
-@@ -1799,8 +1794,6 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
- 	hns3_set_rxtx_function(dev);
+ hns3vf_dev_start(struct rte_eth_dev *dev)
+ {
+@@ -2250,8 +2245,6 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
@@ -102,0 +109 @@
+ 	hns3vf_service_handler(dev);
@@ -108 +115 @@
- 	hns3_start_tqps(hw);
+ 
@@ -110 +117 @@
-index 162a48e590..08fa6da7bb 100644
+index 6cb935cf0b..c71a22e6a6 100644
@@ -113 +120 @@
-@@ -1646,7 +1646,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
+@@ -1623,7 +1623,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
@@ -122 +129 @@
-@@ -1672,6 +1672,12 @@ out:
+@@ -1649,6 +1649,12 @@ out:
@@ -135,11 +141,0 @@
-diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
-index 1ab3f9f5c6..0f5de129a3 100644
---- a/drivers/net/hns3/hns3_flow.h
-+++ b/drivers/net/hns3/hns3_flow.h
-@@ -49,5 +49,6 @@ int hns3_dev_flow_ops_get(struct rte_eth_dev *dev,
- 			  const struct rte_flow_ops **ops);
- void hns3_flow_init(struct rte_eth_dev *dev);
- void hns3_flow_uninit(struct rte_eth_dev *dev);
-+int hns3_restore_filter(struct rte_eth_dev *dev);
- 
- #endif /* _HNS3_FLOW_H_ */
@@ -147 +143 @@
-index 39af01ef13..1589c67c59 100644
+index 47dfda3d09..b8ada8b07c 100644
@@ -150 +146 @@
-@@ -110,6 +110,5 @@ int hns3_config_rss(struct hns3_adapter *hns);
+@@ -110,6 +110,6 @@ int hns3_config_rss(struct hns3_adapter *hns);
@@ -153 +149 @@
- int hns3_rss_set_algo_key(struct hns3_hw *hw, const uint8_t *key);
+ int hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key);
@@ -154,0 +151 @@
++int hns3_restore_filter(struct rte_eth_dev *dev);


More information about the stable mailing list