!122 Add bugfixes for hns3 PMD

From: @speech_white
Reviewed-by: @li-yangyang20
Signed-off-by: @li-yangyang20
This commit is contained in:
openeuler-ci-bot 2021-09-14 03:49:50 +00:00 committed by Gitee
commit c9000ab3f9
4 changed files with 154 additions and 1 deletions

View File

@ -0,0 +1,58 @@
From 15c37af398c3a22b5f46aff8abfc9166f949567c Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Mon, 30 Aug 2021 16:26:49 +0800
Subject: [PATCH] net/hns3: fix queue flow action validation
The used_rx_queues only takes effect after device is started, and
its value is incorrect before the device is started. Therefore, it
is not suitable for flow action to use it to verify the queue index
before the device is started.
E.g. Enable dedicated queue in bonding device will configure a queue
flow action before start its slave devices. The above problem will
make this reasonable flow action configuration fail.
This patch use the nb_rx_queues from the configuration phase to
achieve verification.
Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Fixes: f8e7fcbfd0b8 ("net/hns3: support flow action of queue region")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/hns3/hns3_flow.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index fc77979c5f..841e0b9da3 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -275,10 +275,10 @@ hns3_handle_action_queue(struct rte_eth_dev *dev,
struct hns3_hw *hw = &hns->hw;
queue = (const struct rte_flow_action_queue *)action->conf;
- if (queue->index >= hw->used_rx_queues) {
+ if (queue->index >= hw->data->nb_rx_queues) {
hns3_err(hw, "queue ID(%u) is greater than number of "
"available queue (%u) in driver.",
- queue->index, hw->used_rx_queues);
+ queue->index, hw->data->nb_rx_queues);
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF,
action, "Invalid queue ID in PF");
@@ -308,8 +308,8 @@ hns3_handle_action_queue_region(struct rte_eth_dev *dev,
if ((!rte_is_power_of_2(conf->queue_num)) ||
conf->queue_num > hw->rss_size_max ||
- conf->queue[0] >= hw->used_rx_queues ||
- conf->queue[0] + conf->queue_num > hw->used_rx_queues) {
+ conf->queue[0] >= hw->data->nb_rx_queues ||
+ conf->queue[0] + conf->queue_num > hw->data->nb_rx_queues) {
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF, action,
"Invalid start queue ID and queue num! the start queue "
--
2.33.0

View File

@ -0,0 +1,35 @@
From 9c5fac6cc28c70fe549e60b3765ddef5a58d76f3 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang@huawei.com>
Date: Mon, 30 Aug 2021 16:26:50 +0800
Subject: [PATCH] net/hns3: fix taskqueue pair reset command
This new taskqueue pair reset command is used incorrectly, resulting in
the new command not taking effect.
This patch fixes the incorrect use.
Fixes: 6911e7c22c61 ("net/hns3: fix long task queue pairs reset time")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@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 0f222b37f9..481872e395 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -697,7 +697,7 @@ hns3_reset_rcb_cmd(struct hns3_hw *hw, uint8_t *reset_status)
hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CFG_RST_TRIGGER, false);
req = (struct hns3_reset_cmd *)desc.data;
- hns3_set_bit(req->mac_func_reset, HNS3_CFG_RESET_RCB_B, 1);
+ hns3_set_bit(req->fun_reset_rcb, HNS3_CFG_RESET_RCB_B, 1);
/*
* The start qid should be the global qid of the first tqp of the
--
2.33.0

View File

@ -0,0 +1,53 @@
From 85289d2ec86fa522962d6599521af0a2f604ac52 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Mon, 30 Aug 2021 16:26:51 +0800
Subject: [PATCH] net/hns3: fix Tx push capability
This patch fixes Tx push capability to be compatible with Kunpeng 920,
as Tx push is only supported on Kunpeng 930.
Fixes: 23e317dd1fbf ("net/hns3: support Tx push quick doorbell for performance")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/hns3/hns3_cmd.c | 3 +++
drivers/net/hns3/hns3_cmd.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index 928f938536..6a1e634684 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -423,6 +423,7 @@ hns3_get_caps_name(uint32_t caps_id)
} dev_caps[] = {
{ HNS3_CAPS_FD_QUEUE_REGION_B, "fd_queue_region" },
{ HNS3_CAPS_PTP_B, "ptp" },
+ { HNS3_CAPS_TX_PUSH_B, "tx_push" },
{ HNS3_CAPS_PHY_IMP_B, "phy_imp" },
{ HNS3_CAPS_TQP_TXRX_INDEP_B, "tqp_txrx_indep" },
{ HNS3_CAPS_HW_PAD_B, "hw_pad" },
@@ -492,6 +493,8 @@ hns3_parse_capability(struct hns3_hw *hw,
hns3_warn(hw, "ignore PTP capability due to lack of "
"rxd advanced layout capability.");
}
+ if (hns3_get_bit(caps, HNS3_CAPS_TX_PUSH_B))
+ hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_TX_PUSH_B, 1);
if (hns3_get_bit(caps, HNS3_CAPS_PHY_IMP_B))
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1);
if (hns3_get_bit(caps, HNS3_CAPS_TQP_TXRX_INDEP_B))
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 88683dfaaa..a4683de0aa 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -315,6 +315,7 @@ enum HNS3_CAPS_BITS {
*/
HNS3_CAPS_FD_QUEUE_REGION_B = 2,
HNS3_CAPS_PTP_B,
+ HNS3_CAPS_TX_PUSH_B = 6,
HNS3_CAPS_PHY_IMP_B = 7,
HNS3_CAPS_TQP_TXRX_INDEP_B,
HNS3_CAPS_HW_PAD_B,
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: dpdk
Version: 20.11
Release: 9
Release: 10
Packager: packaging@6wind.com
URL: http://dpdk.org
%global source_version 20.11
@ -223,6 +223,10 @@ Patch213: 0213-app-testpmd-change-port-link-speed-without-stopping-.patch
Patch214: 0214-ethdev-add-dev-configured-flag.patch
Patch215: 0215-net-hns3-add-start-stop-Tx-datapath-request-for-MP.patch
Patch216: 0216-net-hns3-support-set-link-up-down-for-PF.patch
Patch217: 0217-net-hns3-fix-queue-flow-action-validation.patch
Patch218: 0218-net-hns3-fix-taskqueue-pair-reset-command.patch
Patch219: 0219-net-hns3-fix-Tx-push-capability.patch
Summary: Data Plane Development Kit core
Group: System Environment/Libraries
@ -348,6 +352,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko
/usr/sbin/depmod
%changelog
* Mon Sep 13 2021 Min Hu <humin29@huawei.com> - 20.11-10
- add bugfixes for hns3 PMD
* Tur Aug 30 2021 Min Hu <humin29@huawei.com> - 20.11-9
- support link up/down for PF in hns3 PMD