!312 refactor Rc/Tx function of hns3 PMD
From: @chenjiji09 Reviewed-by: @li-huisong Signed-off-by: @li-huisong
This commit is contained in:
commit
d3382547e7
82
0231-net-hns3-fix-burst-mode-query-with-dummy-function.patch
Normal file
82
0231-net-hns3-fix-burst-mode-query-with-dummy-function.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 6a7c7c31b57bb4dadaf3750a3fc36e3ec0761f3f Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 11 Feb 2023 17:18:25 +0800
|
||||
Subject: net/hns3: fix burst mode query with dummy function
|
||||
|
||||
[ upstream commit 10f91af5a5b370df922f888826a4387abebe1cde ]
|
||||
|
||||
The rte_eth_rx/tx_burst_mode_get API will fail when Rx/Tx
|
||||
function is dummy.
|
||||
|
||||
Fixes: 7ef933908f04 ("net/hns3: add simple Tx path")
|
||||
Fixes: 521ab3e93361 ("net/hns3: add simple Rx path")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 38 ++++++++++++++++++++++--------------
|
||||
1 file changed, 23 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 9a597e032e..c69fb38402 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -2786,6 +2786,7 @@ hns3_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
|
||||
{ hns3_recv_scattered_pkts, "Scalar Scattered" },
|
||||
{ hns3_recv_pkts_vec, "Vector Neon" },
|
||||
{ hns3_recv_pkts_vec_sve, "Vector Sve" },
|
||||
+ { rte_eth_pkt_burst_dummy, "Dummy" },
|
||||
};
|
||||
|
||||
eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
|
||||
@@ -4272,24 +4273,31 @@ int
|
||||
hns3_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
|
||||
struct rte_eth_burst_mode *mode)
|
||||
{
|
||||
+ static const struct {
|
||||
+ eth_tx_burst_t pkt_burst;
|
||||
+ const char *info;
|
||||
+ } burst_infos[] = {
|
||||
+ { hns3_xmit_pkts_simple, "Scalar Simple" },
|
||||
+ { hns3_xmit_pkts, "Scalar" },
|
||||
+ { hns3_xmit_pkts_vec, "Vector Neon" },
|
||||
+ { hns3_xmit_pkts_vec_sve, "Vector Sve" },
|
||||
+ { rte_eth_pkt_burst_dummy, "Dummy" },
|
||||
+ };
|
||||
+
|
||||
eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
|
||||
- const char *info = NULL;
|
||||
-
|
||||
- if (pkt_burst == hns3_xmit_pkts_simple)
|
||||
- info = "Scalar Simple";
|
||||
- else if (pkt_burst == hns3_xmit_pkts)
|
||||
- info = "Scalar";
|
||||
- else if (pkt_burst == hns3_xmit_pkts_vec)
|
||||
- info = "Vector Neon";
|
||||
- else if (pkt_burst == hns3_xmit_pkts_vec_sve)
|
||||
- info = "Vector Sve";
|
||||
-
|
||||
- if (info == NULL)
|
||||
- return -EINVAL;
|
||||
+ int ret = -EINVAL;
|
||||
+ unsigned int i;
|
||||
|
||||
- snprintf(mode->info, sizeof(mode->info), "%s", info);
|
||||
+ for (i = 0; i < RTE_DIM(burst_infos); i++) {
|
||||
+ if (pkt_burst == burst_infos[i].pkt_burst) {
|
||||
+ snprintf(mode->info, sizeof(mode->info), "%s",
|
||||
+ burst_infos[i].info);
|
||||
+ ret = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- return 0;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static bool
|
||||
--
|
||||
2.23.0
|
||||
|
||||
41
0232-net-hns3-add-debug-info-for-Rx-Tx-dummy-function.patch
Normal file
41
0232-net-hns3-add-debug-info-for-Rx-Tx-dummy-function.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From cd3db5d9c5aea3efa6b0bbaefecb7fb8367a7719 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 11 Feb 2023 17:18:26 +0800
|
||||
Subject: net/hns3: add debug info for Rx/Tx dummy function
|
||||
|
||||
[ upstream commit a8f52a5cf13715c61dfe224815c7f4e4858be82f ]
|
||||
|
||||
Now dummy function can be report by rte_eth_rx/tx_burst_mode_get.
|
||||
So this patch adds debug info for Rx/Tx dummy function.
|
||||
|
||||
Fixes: 7feb2aee0e2c ("net/hns3: log selected datapath")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index c69fb38402..52393b1f6f 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -4420,13 +4420,13 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
|
||||
hns3_get_tx_function(eth_dev, &prep);
|
||||
eth_dev->tx_pkt_prepare = prep;
|
||||
eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
|
||||
- hns3_trace_rxtx_function(eth_dev);
|
||||
} else {
|
||||
eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
|
||||
eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
|
||||
eth_dev->tx_pkt_prepare = NULL;
|
||||
}
|
||||
|
||||
+ hns3_trace_rxtx_function(eth_dev);
|
||||
hns3_eth_dev_fp_ops_config(eth_dev);
|
||||
}
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
46
0233-net-hns3-remove-debug-condition-for-Tx-prepare.patch
Normal file
46
0233-net-hns3-remove-debug-condition-for-Tx-prepare.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 25a54df88c36a76f4914287ba393d2251f4492ec Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 11 Feb 2023 17:18:27 +0800
|
||||
Subject: net/hns3: remove debug condition for Tx prepare
|
||||
|
||||
[ upstream commit a8d240786e1af129fdf789391d574bf4a7fe60e6 ]
|
||||
|
||||
The Tx prepare in driver is always needed if RTE_LIBRTE_ETHDEV_DEBUG
|
||||
is defined. But it doesn't matter with this macro. Let's remove it.
|
||||
|
||||
Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 52393b1f6f..9fc54d50f1 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -4311,11 +4311,6 @@ hns3_tx_check_simple_support(struct rte_eth_dev *dev)
|
||||
static bool
|
||||
hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
|
||||
{
|
||||
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
|
||||
- RTE_SET_USED(dev);
|
||||
- /* always perform tx_prepare when debug */
|
||||
- return true;
|
||||
-#else
|
||||
#define HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK (\
|
||||
RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | \
|
||||
RTE_ETH_TX_OFFLOAD_TCP_CKSUM | \
|
||||
@@ -4333,7 +4328,6 @@ hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
-#endif
|
||||
}
|
||||
|
||||
eth_tx_burst_t
|
||||
--
|
||||
2.23.0
|
||||
|
||||
130
0234-net-hns3-separate-Tx-prepare-from-getting-Tx-functio.patch
Normal file
130
0234-net-hns3-separate-Tx-prepare-from-getting-Tx-functio.patch
Normal file
@ -0,0 +1,130 @@
|
||||
From 9e0cd6d469351131e473edc8a9dbbcd70890519f Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 11 Feb 2023 17:18:28 +0800
|
||||
Subject: net/hns3: separate Tx prepare from getting Tx function
|
||||
|
||||
[ upstream commit 6a934ba4c6c48691b119a878981a4e3748766518 ]
|
||||
|
||||
Separate getting tx prepare from hns3_get_tx_function by extracting
|
||||
an independent function.
|
||||
|
||||
Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 32 ++++++++++++++------------------
|
||||
drivers/net/hns3/hns3_rxtx.h | 3 +--
|
||||
2 files changed, 15 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 9fc54d50f1..2dba4d8120 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -4324,26 +4324,30 @@ hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
|
||||
RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)
|
||||
|
||||
uint64_t tx_offload = dev->data->dev_conf.txmode.offloads;
|
||||
+
|
||||
if (tx_offload & HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+static eth_tx_prep_t
|
||||
+hns3_get_tx_prepare(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ return hns3_get_tx_prep_needed(dev) ? hns3_prep_pkts : NULL;
|
||||
+}
|
||||
+
|
||||
eth_tx_burst_t
|
||||
-hns3_get_tx_function(struct rte_eth_dev *dev, eth_tx_prep_t *prep)
|
||||
+hns3_get_tx_function(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
bool vec_allowed, sve_allowed, simple_allowed;
|
||||
- bool vec_support, tx_prepare_needed;
|
||||
+ bool vec_support;
|
||||
|
||||
vec_support = hns3_tx_check_vec_support(dev) == 0;
|
||||
vec_allowed = vec_support && hns3_get_default_vec_support();
|
||||
sve_allowed = vec_support && hns3_get_sve_support();
|
||||
simple_allowed = hns3_tx_check_simple_support(dev);
|
||||
- tx_prepare_needed = hns3_get_tx_prep_needed(dev);
|
||||
-
|
||||
- *prep = NULL;
|
||||
|
||||
if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_VEC && vec_allowed)
|
||||
return hns3_xmit_pkts_vec;
|
||||
@@ -4351,19 +4355,14 @@ hns3_get_tx_function(struct rte_eth_dev *dev, eth_tx_prep_t *prep)
|
||||
return hns3_xmit_pkts_vec_sve;
|
||||
if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_SIMPLE && simple_allowed)
|
||||
return hns3_xmit_pkts_simple;
|
||||
- if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_COMMON) {
|
||||
- if (tx_prepare_needed)
|
||||
- *prep = hns3_prep_pkts;
|
||||
+ if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_COMMON)
|
||||
return hns3_xmit_pkts;
|
||||
- }
|
||||
|
||||
if (vec_allowed)
|
||||
return hns3_xmit_pkts_vec;
|
||||
if (simple_allowed)
|
||||
return hns3_xmit_pkts_simple;
|
||||
|
||||
- if (tx_prepare_needed)
|
||||
- *prep = hns3_prep_pkts;
|
||||
return hns3_xmit_pkts;
|
||||
}
|
||||
|
||||
@@ -4403,7 +4402,6 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
|
||||
{
|
||||
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
|
||||
struct hns3_adapter *hns = eth_dev->data->dev_private;
|
||||
- eth_tx_prep_t prep = NULL;
|
||||
|
||||
if (hns->hw.adapter_state == HNS3_NIC_STARTED &&
|
||||
__atomic_load_n(&hns->hw.reset.resetting, __ATOMIC_RELAXED) == 0) {
|
||||
@@ -4411,8 +4409,8 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
|
||||
eth_dev->rx_descriptor_status = hns3_dev_rx_descriptor_status;
|
||||
eth_dev->tx_pkt_burst = hw->set_link_down ?
|
||||
rte_eth_pkt_burst_dummy :
|
||||
- hns3_get_tx_function(eth_dev, &prep);
|
||||
- eth_dev->tx_pkt_prepare = prep;
|
||||
+ hns3_get_tx_function(eth_dev);
|
||||
+ eth_dev->tx_pkt_prepare = hns3_get_tx_prepare(eth_dev);
|
||||
eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
|
||||
} else {
|
||||
eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
|
||||
@@ -4758,10 +4756,8 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)
|
||||
void
|
||||
hns3_start_tx_datapath(struct rte_eth_dev *dev)
|
||||
{
|
||||
- eth_tx_prep_t prep = NULL;
|
||||
-
|
||||
- dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);
|
||||
- dev->tx_pkt_prepare = prep;
|
||||
+ dev->tx_pkt_burst = hns3_get_tx_function(dev);
|
||||
+ dev->tx_pkt_prepare = hns3_get_tx_prepare(dev);
|
||||
hns3_eth_dev_fp_ops_config(dev);
|
||||
|
||||
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
|
||||
index ea1a805491..38c3581312 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.h
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.h
|
||||
@@ -740,8 +740,7 @@ int hns3_tx_burst_mode_get(struct rte_eth_dev *dev,
|
||||
const uint32_t *hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
|
||||
void hns3_init_rx_ptype_tble(struct rte_eth_dev *dev);
|
||||
void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev);
|
||||
-eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev,
|
||||
- eth_tx_prep_t *prep);
|
||||
+eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev);
|
||||
|
||||
uint32_t hns3_get_tqp_intr_reg_offset(uint16_t tqp_intr_id);
|
||||
void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
|
||||
--
|
||||
2.23.0
|
||||
|
||||
49
0235-net-hns3-make-getting-Tx-function-static.patch
Normal file
49
0235-net-hns3-make-getting-Tx-function-static.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From 4efa4ab6f451ebc5ef8439eedda3b3982e9465ca Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 11 Feb 2023 17:18:29 +0800
|
||||
Subject: net/hns3: make getting Tx function static
|
||||
|
||||
[ upstream commit 2aec7beaba05cd82cd951f0c6bbaecb82d533ce0 ]
|
||||
|
||||
The hns3_get_tx_function() is an intrinsic function now and should
|
||||
not be open to other files.
|
||||
|
||||
Fixes: 96c33cfb06cf ("net/hns3: fix Rx/Tx functions update")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 2 +-
|
||||
drivers/net/hns3/hns3_rxtx.h | 2 --
|
||||
2 files changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 2dba4d8120..b5e7ba7325 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -4337,7 +4337,7 @@ hns3_get_tx_prepare(struct rte_eth_dev *dev)
|
||||
return hns3_get_tx_prep_needed(dev) ? hns3_prep_pkts : NULL;
|
||||
}
|
||||
|
||||
-eth_tx_burst_t
|
||||
+static eth_tx_burst_t
|
||||
hns3_get_tx_function(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
|
||||
index 38c3581312..1bdc124b7b 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.h
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.h
|
||||
@@ -740,8 +740,6 @@ int hns3_tx_burst_mode_get(struct rte_eth_dev *dev,
|
||||
const uint32_t *hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
|
||||
void hns3_init_rx_ptype_tble(struct rte_eth_dev *dev);
|
||||
void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev);
|
||||
-eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev);
|
||||
-
|
||||
uint32_t hns3_get_tqp_intr_reg_offset(uint16_t tqp_intr_id);
|
||||
void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
|
||||
uint8_t gl_idx, uint16_t gl_value);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
196
0236-net-hns3-extract-common-functions-to-set-Rx-Tx.patch
Normal file
196
0236-net-hns3-extract-common-functions-to-set-Rx-Tx.patch
Normal file
@ -0,0 +1,196 @@
|
||||
From a83eecfe38a20bbfa51a108f62d55d6189e943d7 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 11 Feb 2023 17:18:30 +0800
|
||||
Subject: net/hns3: extract common functions to set Rx/Tx
|
||||
|
||||
[ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ]
|
||||
|
||||
Extract two common functions to set Rx/Tx function in order to
|
||||
reduce duplicate codes.
|
||||
|
||||
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 20 ++++----------------
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 19 ++++---------------
|
||||
drivers/net/hns3/hns3_mp.c | 4 ++--
|
||||
drivers/net/hns3/hns3_rxtx.c | 28 ++++++++++++++++++++++++++++
|
||||
drivers/net/hns3/hns3_rxtx.h | 2 ++
|
||||
5 files changed, 40 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 8fa12d91bb..1c67ff2c99 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -5052,8 +5052,7 @@ hns3_dev_start(struct rte_eth_dev *dev)
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
|
||||
hns3_rx_scattered_calc(dev);
|
||||
- hns3_set_rxtx_function(dev);
|
||||
- hns3_mp_req_start_rxtx(dev);
|
||||
+ hns3_start_rxtx_datapath(dev);
|
||||
|
||||
/* Enable interrupt of all rx queues before enabling queues */
|
||||
hns3_dev_all_rx_queue_intr_enable(hw, true);
|
||||
@@ -5131,12 +5130,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
|
||||
dev->data->dev_started = 0;
|
||||
|
||||
hw->adapter_state = HNS3_NIC_STOPPING;
|
||||
- hns3_set_rxtx_function(dev);
|
||||
- rte_wmb();
|
||||
- /* Disable datapath on secondary process. */
|
||||
- hns3_mp_req_stop_rxtx(dev);
|
||||
- /* Prevent crashes when queues are still in use. */
|
||||
- rte_delay_ms(hw->cfg_max_queues);
|
||||
+ hns3_stop_rxtx_datapath(dev);
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
|
||||
@@ -5752,12 +5746,7 @@ hns3_stop_service(struct hns3_adapter *hns)
|
||||
rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
|
||||
hns3_update_linkstatus_and_event(hw, false);
|
||||
}
|
||||
-
|
||||
- hns3_set_rxtx_function(eth_dev);
|
||||
- rte_wmb();
|
||||
- /* Disable datapath on secondary process. */
|
||||
- hns3_mp_req_stop_rxtx(eth_dev);
|
||||
- rte_delay_ms(hw->cfg_max_queues);
|
||||
+ hns3_stop_rxtx_datapath(eth_dev);
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
|
||||
@@ -5790,8 +5779,7 @@ hns3_start_service(struct hns3_adapter *hns)
|
||||
hw->reset.level == HNS3_GLOBAL_RESET)
|
||||
hns3_set_rst_done(hw);
|
||||
eth_dev = &rte_eth_devices[hw->data->port_id];
|
||||
- hns3_set_rxtx_function(eth_dev);
|
||||
- hns3_mp_req_start_rxtx(eth_dev);
|
||||
+ hns3_start_rxtx_datapath(eth_dev);
|
||||
if (hw->adapter_state == HNS3_NIC_STARTED) {
|
||||
/*
|
||||
* This API parent function already hold the hns3_hw.lock, the
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index a3a1b71a63..3a93987409 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -1572,12 +1572,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
|
||||
dev->data->dev_started = 0;
|
||||
|
||||
hw->adapter_state = HNS3_NIC_STOPPING;
|
||||
- hns3_set_rxtx_function(dev);
|
||||
- rte_wmb();
|
||||
- /* Disable datapath on secondary process. */
|
||||
- hns3_mp_req_stop_rxtx(dev);
|
||||
- /* Prevent crashes when queues are still in use. */
|
||||
- rte_delay_ms(hw->cfg_max_queues);
|
||||
+ hns3_stop_rxtx_datapath(dev);
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
|
||||
@@ -1731,8 +1726,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
|
||||
hns3_rx_scattered_calc(dev);
|
||||
- hns3_set_rxtx_function(dev);
|
||||
- hns3_mp_req_start_rxtx(dev);
|
||||
+ hns3_start_rxtx_datapath(dev);
|
||||
|
||||
/* Enable interrupt of all rx queues before enabling queues */
|
||||
hns3_dev_all_rx_queue_intr_enable(hw, true);
|
||||
@@ -1902,11 +1896,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
|
||||
}
|
||||
hw->mac.link_status = RTE_ETH_LINK_DOWN;
|
||||
|
||||
- hns3_set_rxtx_function(eth_dev);
|
||||
- rte_wmb();
|
||||
- /* Disable datapath on secondary process. */
|
||||
- hns3_mp_req_stop_rxtx(eth_dev);
|
||||
- rte_delay_ms(hw->cfg_max_queues);
|
||||
+ hns3_stop_rxtx_datapath(eth_dev);
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
if (hw->adapter_state == HNS3_NIC_STARTED ||
|
||||
@@ -1938,8 +1928,7 @@ hns3vf_start_service(struct hns3_adapter *hns)
|
||||
struct rte_eth_dev *eth_dev;
|
||||
|
||||
eth_dev = &rte_eth_devices[hw->data->port_id];
|
||||
- hns3_set_rxtx_function(eth_dev);
|
||||
- hns3_mp_req_start_rxtx(eth_dev);
|
||||
+ hns3_start_rxtx_datapath(eth_dev);
|
||||
|
||||
rte_eal_alarm_set(HNS3VF_KEEP_ALIVE_INTERVAL, hns3vf_keep_alive_handler,
|
||||
eth_dev);
|
||||
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
|
||||
index e74ddea195..c3005b943f 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.c
|
||||
+++ b/drivers/net/hns3/hns3_mp.c
|
||||
@@ -87,12 +87,12 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
|
||||
case HNS3_MP_REQ_START_RXTX:
|
||||
PMD_INIT_LOG(INFO, "port %u starting datapath",
|
||||
dev->data->port_id);
|
||||
- hns3_set_rxtx_function(dev);
|
||||
+ hns3_start_rxtx_datapath(dev);
|
||||
break;
|
||||
case HNS3_MP_REQ_STOP_RXTX:
|
||||
PMD_INIT_LOG(INFO, "port %u stopping datapath",
|
||||
dev->data->port_id);
|
||||
- hns3_set_rxtx_function(dev);
|
||||
+ hns3_stop_rxtx_datapath(dev);
|
||||
break;
|
||||
case HNS3_MP_REQ_START_TX:
|
||||
PMD_INIT_LOG(INFO, "port %u starting Tx datapath",
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index b5e7ba7325..1f44c0345f 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -4765,3 +4765,31 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)
|
||||
|
||||
hns3_mp_req_start_tx(dev);
|
||||
}
|
||||
+
|
||||
+void
|
||||
+hns3_stop_rxtx_datapath(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
+
|
||||
+ hns3_set_rxtx_function(dev);
|
||||
+
|
||||
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY)
|
||||
+ return;
|
||||
+
|
||||
+ rte_wmb();
|
||||
+ /* Disable datapath on secondary process. */
|
||||
+ hns3_mp_req_stop_rxtx(dev);
|
||||
+ /* Prevent crashes when queues are still in use. */
|
||||
+ rte_delay_ms(hw->cfg_max_queues);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+hns3_start_rxtx_datapath(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ hns3_set_rxtx_function(dev);
|
||||
+
|
||||
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY)
|
||||
+ return;
|
||||
+
|
||||
+ hns3_mp_req_start_rxtx(dev);
|
||||
+}
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
|
||||
index 1bdc124b7b..fa39f6481a 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.h
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.h
|
||||
@@ -773,5 +773,7 @@ int hns3_dev_tx_descriptor_status(void *tx_queue, uint16_t offset);
|
||||
void hns3_tx_push_init(struct rte_eth_dev *dev);
|
||||
void hns3_stop_tx_datapath(struct rte_eth_dev *dev);
|
||||
void hns3_start_tx_datapath(struct rte_eth_dev *dev);
|
||||
+void hns3_stop_rxtx_datapath(struct rte_eth_dev *dev);
|
||||
+void hns3_start_rxtx_datapath(struct rte_eth_dev *dev);
|
||||
|
||||
#endif /* HNS3_RXTX_H */
|
||||
--
|
||||
2.23.0
|
||||
|
||||
18
dpdk.spec
18
dpdk.spec
@ -1,6 +1,6 @@
|
||||
Name: dpdk
|
||||
Version: 21.11
|
||||
Release: 32
|
||||
Release: 33
|
||||
Packager: packaging@6wind.com
|
||||
URL: http://dpdk.org
|
||||
%global source_version 21.11
|
||||
@ -249,6 +249,12 @@ Patch9227: 0227-net-hns3-remove-useless-code-when-destroy-valid-RSS-.patch
|
||||
Patch9228: 0228-net-hns3-fix-warning-on-flush-or-destroy-rule.patch
|
||||
Patch9229: 0229-net-hns3-fix-config-struct-used-for-conversion.patch
|
||||
Patch9230: 0230-net-hns3-fix-duplicate-RSS-rule-check.patch
|
||||
Patch9231: 0231-net-hns3-fix-burst-mode-query-with-dummy-function.patch
|
||||
Patch9232: 0232-net-hns3-add-debug-info-for-Rx-Tx-dummy-function.patch
|
||||
Patch9233: 0233-net-hns3-remove-debug-condition-for-Tx-prepare.patch
|
||||
Patch9234: 0234-net-hns3-separate-Tx-prepare-from-getting-Tx-functio.patch
|
||||
Patch9235: 0235-net-hns3-make-getting-Tx-function-static.patch
|
||||
Patch9236: 0236-net-hns3-extract-common-functions-to-set-Rx-Tx.patch
|
||||
|
||||
Summary: Data Plane Development Kit core
|
||||
Group: System Environment/Libraries
|
||||
@ -391,6 +397,16 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko
|
||||
/usr/sbin/depmod
|
||||
|
||||
%changelog
|
||||
* Tue Feb 21 2023 chenjiji <chenjiji09@163.com> - 21.11-33
|
||||
refactor Rc/Tx function of hns3 PMD
|
||||
And patchs are as follows:
|
||||
- net/hns3: fix burst mode query with dummy function
|
||||
- net/hns3: add debug info for Rx/Tx dummy function
|
||||
- net/hns3: remove debug condition for Tx prepare
|
||||
- net/hns3: separate Tx prepare from getting Tx function
|
||||
- net/hns3: make getting Tx function static
|
||||
- net/hns3: extract common functions to set Rx/Tx
|
||||
|
||||
* Tue Feb 28 2023 jiangheng <jiangheng14@huawei.com> - 21.11-32
|
||||
- linux/igb_uio: fix build with kernel 5.18+
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user