patch 'net/hns3: fix Rx/Tx functions update' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Mon Feb 21 16:34:50 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

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

Thanks.

Kevin

---
>From e073f410fb2679c059487fb6fd9dfb4a9256ef05 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29 at huawei.com>
Date: Mon, 17 Jan 2022 10:43:00 +0800
Subject: [PATCH] net/hns3: fix Rx/Tx functions update

[ upstream commit 96c33cfb06cf59b785439058190060bde120f030 ]

When fast path operation is introduced, the Rx/Tx function is done by
object 'rte_eth_fp_ops'. So 'rte_eth_fp_ops' should be updated if
'fast-path functions' need to be changed, such as PMD receive function,
prepare function and so on.

This patch fixed receiving packets bug when fast path operation is
introduced.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Fixes: 168b7d79dada ("net/hns3: support set link up/down for PF")

Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/hns3/hns3_mp.c   |  7 ++-----
 drivers/net/hns3/hns3_rxtx.c | 28 +++++++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index 999b407f7d..e74ddea195 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -75,5 +75,4 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
 	const struct hns3_mp_param *param =
 		(const struct hns3_mp_param *)mp_msg->param;
-	eth_tx_prep_t prep = NULL;
 	struct rte_eth_dev *dev;
 	int ret;
@@ -99,12 +98,10 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
 		PMD_INIT_LOG(INFO, "port %u starting Tx datapath",
 			     dev->data->port_id);
-		dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);
-		dev->tx_pkt_prepare = prep;
+		hns3_start_tx_datapath(dev);
 		break;
 	case HNS3_MP_REQ_STOP_TX:
 		PMD_INIT_LOG(INFO, "port %u stopping Tx datapath",
 			     dev->data->port_id);
-		dev->tx_pkt_burst = hns3_dummy_rxtx_burst;
-		dev->tx_pkt_prepare = NULL;
+		hns3_stop_tx_datapath(dev);
 		break;
 	default:
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index d240e36e6a..c86aeb2366 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4409,5 +4409,19 @@ hns3_trace_rxtx_function(struct rte_eth_dev *dev)
 }
 
-void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
+static void
+hns3_eth_dev_fp_ops_config(const struct rte_eth_dev *dev)
+{
+	struct rte_eth_fp_ops *fpo = rte_eth_fp_ops;
+	uint16_t port_id = dev->data->port_id;
+
+	fpo[port_id].rx_pkt_burst = dev->rx_pkt_burst;
+	fpo[port_id].tx_pkt_burst = dev->tx_pkt_burst;
+	fpo[port_id].tx_pkt_prepare = dev->tx_pkt_prepare;
+	fpo[port_id].rx_descriptor_status = dev->rx_descriptor_status;
+	fpo[port_id].tx_descriptor_status = dev->tx_descriptor_status;
+}
+
+void
+hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
@@ -4430,4 +4444,6 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 		eth_dev->tx_pkt_prepare = NULL;
 	}
+
+	hns3_eth_dev_fp_ops_config(eth_dev);
 }
 
@@ -4730,4 +4746,9 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)
 	dev->tx_pkt_burst = hns3_dummy_rxtx_burst;
 	dev->tx_pkt_prepare = NULL;
+	hns3_eth_dev_fp_ops_config(dev);
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return;
+
 	rte_wmb();
 	/* Disable tx datapath on secondary process. */
@@ -4744,4 +4765,9 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)
 	dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);
 	dev->tx_pkt_prepare = prep;
+	hns3_eth_dev_fp_ops_config(dev);
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return;
+
 	hns3_mp_req_start_tx(dev);
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-21 15:22:46.802188793 +0000
+++ 0101-net-hns3-fix-Rx-Tx-functions-update.patch	2022-02-21 15:22:44.202704376 +0000
@@ -1 +1 @@
-From 96c33cfb06cf59b785439058190060bde120f030 Mon Sep 17 00:00:00 2001
+From e073f410fb2679c059487fb6fd9dfb4a9256ef05 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 96c33cfb06cf59b785439058190060bde120f030 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list