sync some patchs from upstreaming
Sync some patchs from upstreaming and modifies are as follow: - net/hns3: fix mailbox sync - net/hns3: report maximum buffer size - ethdev: add maximum Rx buffer size - app/procinfo: show RSS hash algorithm - ethdev: get RSS algorithm names - app/procinfo: adjust format of RSS info - app/procinfo: fix RSS info - net/hns3: support setting and querying RSS hash function - net/hns3: report RSS hash algorithms capability - ethdev: set and query RSS hash algorithm - ethdev: clarify RSS related fields usage - net/hns3: fix uninitialized hash algo value - net/hns3: keep set/get algo key functions local - net/hns3: fix some error logs - net/hns3: fix some return values - net/hns3: fix LRO offload to report - net/hns3: fix setting DCB capability - app/testpmd: ease configuring all offloads - net/hns3: refactor interrupt state query - net/hns3: fix IMP or global reset - net/hns3: fix multiple reset detected log - net/hns3: remove reset log in secondary - net/hns3: fix double stats for IMP and global reset - net/hns3: fix crash for NEON and SVE - net/hns3: fix unchecked Rx free threshold - net/hns3: fix typo in function name - net/hns3: fix build warning - telemetry: fix repeat display when callback don't init dict Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
This commit is contained in:
parent
b0dbcead43
commit
bc76778e92
@ -0,0 +1,38 @@
|
||||
From 0ba973a96681d5c5f85423176d63c14f8cbc1c25 Mon Sep 17 00:00:00 2001
|
||||
From: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Date: Thu, 9 Feb 2023 01:25:33 +0000
|
||||
Subject: [PATCH 367/394] telemetry: fix repeat display when callback don't
|
||||
init dict
|
||||
|
||||
[ upstream commit ff50c4f9136781bae9089c596e0a12d113e1d474 ]
|
||||
|
||||
When a telemetry callback doesn't initialize the telemetry data
|
||||
structure and returns a non-negative number, the telemetry will repeat
|
||||
to display the last result. This patch zero the data structure to avoid
|
||||
the problem.
|
||||
|
||||
Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
|
||||
---
|
||||
lib/telemetry/telemetry.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
|
||||
index 52048de55c..2c12db20cb 100644
|
||||
--- a/lib/telemetry/telemetry.c
|
||||
+++ b/lib/telemetry/telemetry.c
|
||||
@@ -332,7 +332,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
|
||||
static void
|
||||
perform_command(telemetry_cb fn, const char *cmd, const char *param, int s)
|
||||
{
|
||||
- struct rte_tel_data data;
|
||||
+ struct rte_tel_data data = {0};
|
||||
|
||||
int ret = fn(cmd, param, &data);
|
||||
if (ret < 0) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
50
0368-net-hns3-fix-build-warning.patch
Normal file
50
0368-net-hns3-fix-build-warning.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From 86aadc9fdf971e0f261572d01fe5fa7cbcfda385 Mon Sep 17 00:00:00 2001
|
||||
From: Jerin Jacob <jerinj@marvell.com>
|
||||
Date: Tue, 4 Apr 2023 12:25:25 +0530
|
||||
Subject: [PATCH 368/394] net/hns3: fix build warning
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ upstream commit 60fe5c3cfc3c28952448d2163c4eb1d22d86ccac ]
|
||||
|
||||
aarch64 gcc 12.2.0 build complain with below warning[1].
|
||||
Move the new_link initialization upwards to fix the warning.
|
||||
|
||||
[1]
|
||||
drivers/net/hns3/hns3_ethdev.c: In function ‘hns3_dev_link_update’:
|
||||
drivers/net/hns3/hns3_ethdev.c:2249:1:
|
||||
warning: ‘new_link’ may be used uninitialized [-Wmaybe-uninitialized]
|
||||
|
||||
Fixes: 64308555d5bf ("net/hns3: fix link status when port is stopped")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
|
||||
Acked-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 6c3ae75c4d..ad595478a7 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -2275,6 +2275,7 @@ hns3_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete)
|
||||
struct rte_eth_link new_link;
|
||||
int ret;
|
||||
|
||||
+ memset(&new_link, 0, sizeof(new_link));
|
||||
/* When port is stopped, report link down. */
|
||||
if (eth_dev->data->dev_started == 0) {
|
||||
new_link.link_autoneg = mac->link_autoneg;
|
||||
@@ -2298,7 +2299,6 @@ hns3_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete)
|
||||
rte_delay_ms(HNS3_LINK_CHECK_INTERVAL);
|
||||
} while (retry_cnt--);
|
||||
|
||||
- memset(&new_link, 0, sizeof(new_link));
|
||||
hns3_setup_linkstatus(eth_dev, &new_link);
|
||||
|
||||
out:
|
||||
--
|
||||
2.23.0
|
||||
|
||||
44
0369-net-hns3-fix-typo-in-function-name.patch
Normal file
44
0369-net-hns3-fix-typo-in-function-name.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From e1aae46f2f2185c5d3b0d33a4db8452d9c5129b3 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:39 +0800
|
||||
Subject: [PATCH 369/394] net/hns3: fix typo in function name
|
||||
|
||||
[ upstream commit 28ad38dd7403d64b3c0aa6dfd33e314bdce276c6 ]
|
||||
|
||||
This patch fixes a typo.
|
||||
|
||||
Fixes: c09c7847d892 ("net/hns3: support traffic management")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_tm.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_tm.c b/drivers/net/hns3/hns3_tm.c
|
||||
index 67402a700f..d969164014 100644
|
||||
--- a/drivers/net/hns3/hns3_tm.c
|
||||
+++ b/drivers/net/hns3/hns3_tm.c
|
||||
@@ -739,7 +739,7 @@ hns3_tm_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,
|
||||
}
|
||||
|
||||
static void
|
||||
-hns3_tm_nonleaf_level_capsbilities_get(struct rte_eth_dev *dev,
|
||||
+hns3_tm_nonleaf_level_capabilities_get(struct rte_eth_dev *dev,
|
||||
uint32_t level_id,
|
||||
struct rte_tm_level_capabilities *cap)
|
||||
{
|
||||
@@ -818,7 +818,7 @@ hns3_tm_level_capabilities_get(struct rte_eth_dev *dev,
|
||||
memset(cap, 0, sizeof(struct rte_tm_level_capabilities));
|
||||
|
||||
if (level_id != HNS3_TM_NODE_LEVEL_QUEUE)
|
||||
- hns3_tm_nonleaf_level_capsbilities_get(dev, level_id, cap);
|
||||
+ hns3_tm_nonleaf_level_capabilities_get(dev, level_id, cap);
|
||||
else
|
||||
hns3_tm_leaf_level_capabilities_get(dev, cap);
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
44
0370-net-hns3-fix-unchecked-Rx-free-threshold.patch
Normal file
44
0370-net-hns3-fix-unchecked-Rx-free-threshold.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From e21bdbf93b0ec692c86d9457a23acb3e3209243b Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:40 +0800
|
||||
Subject: [PATCH 370/394] net/hns3: fix unchecked Rx free threshold
|
||||
|
||||
[ upstream commit c1f0cd3a4c834c2e550370b6d31b6bcd456a15f9 ]
|
||||
|
||||
To reduce the frequency of updating the head pointer of Rx queue,
|
||||
driver just updates this pointer when the number of processed
|
||||
descriptors is greater than the Rx free threshold. If the Rx free
|
||||
threshold is set to a value greater than or equal to the number of
|
||||
descriptors in Rx queue, the driver does not update this pointer.
|
||||
As a result, the hardware cannot receive more packets.
|
||||
|
||||
This patch fix it by adding Rx free threshold check.
|
||||
|
||||
Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 4c79163e3f..208c725cd5 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -1785,6 +1785,12 @@ hns3_rx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_rxconf *conf,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ if (conf->rx_free_thresh >= nb_desc) {
|
||||
+ hns3_err(hw, "rx_free_thresh (%u) must be less than %u",
|
||||
+ conf->rx_free_thresh, nb_desc);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
if (conf->rx_drop_en == 0)
|
||||
hns3_warn(hw, "if no descriptors available, packets are always "
|
||||
"dropped and rx_drop_en (1) is fixed on");
|
||||
--
|
||||
2.23.0
|
||||
|
||||
64
0371-net-hns3-fix-crash-for-NEON-and-SVE.patch
Normal file
64
0371-net-hns3-fix-crash-for-NEON-and-SVE.patch
Normal file
@ -0,0 +1,64 @@
|
||||
From 090826e4646db4a438336c5e9e879f2fa5a6e07a Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:41 +0800
|
||||
Subject: [PATCH 371/394] net/hns3: fix crash for NEON and SVE
|
||||
|
||||
[ upstream commit 01843ab2f2fc8c3137258ec39b2cb6f62ba7b8a2 ]
|
||||
|
||||
Driver may fail to allocate bulk mbufs for Neon and SVE when rearm
|
||||
mbuf. Currently, driver keeps going to handle packets even if there
|
||||
isn't available descriptors to receive packets at this moment.
|
||||
As a result, driver probably fills the mbufs with invalid data to
|
||||
application and accesses to illegal address because of the VLD bit
|
||||
of the descriptor at the "rx_rearm_start" position still being set.
|
||||
So driver has to clear VLD bit for this descriptor in this scenario
|
||||
in case of receiving packets later.
|
||||
|
||||
In addition, it is possible that the sum of the "rx_rearm_nb" and
|
||||
"rx_rearm_start" is greater than total descriptor number of Rx queue
|
||||
in the above scenario. So the index of rxq->sw_ring[] to set mbuf
|
||||
pointer to NULL should also be fixed to avoid out-of-bounds memory
|
||||
access.
|
||||
|
||||
Fixes: a3d4f4d291d7 ("net/hns3: support NEON Rx")
|
||||
Fixes: f81a18f49152 ("net/hns3: fix mbuf leakage when RxQ started after reset")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 2 +-
|
||||
drivers/net/hns3/hns3_rxtx_vec.h | 5 +++++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 208c725cd5..3054d24080 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -51,7 +51,7 @@ hns3_rx_queue_release_mbufs(struct hns3_rx_queue *rxq)
|
||||
}
|
||||
}
|
||||
for (i = 0; i < rxq->rx_rearm_nb; i++)
|
||||
- rxq->sw_ring[rxq->rx_rearm_start + i].mbuf = NULL;
|
||||
+ rxq->sw_ring[(rxq->rx_rearm_start + i) % rxq->nb_rx_desc].mbuf = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < rxq->bulk_mbuf_num; i++)
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx_vec.h b/drivers/net/hns3/hns3_rxtx_vec.h
|
||||
index a9a6774294..9018e79c2f 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx_vec.h
|
||||
+++ b/drivers/net/hns3/hns3_rxtx_vec.h
|
||||
@@ -106,6 +106,11 @@ hns3_rxq_rearm_mbuf(struct hns3_rx_queue *rxq)
|
||||
|
||||
if (unlikely(rte_mempool_get_bulk(rxq->mb_pool, (void *)rxep,
|
||||
HNS3_DEFAULT_RXQ_REARM_THRESH) < 0)) {
|
||||
+ /*
|
||||
+ * Clear VLD bit for the first descriptor rearmed in case
|
||||
+ * of going to receive packets later.
|
||||
+ */
|
||||
+ rxdp[0].rx.bd_base_info = 0;
|
||||
rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed++;
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 9406299efd12990e91299d6abbe1b191d0360101 Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:42 +0800
|
||||
Subject: [PATCH 372/394] net/hns3: fix double stats for IMP and global reset
|
||||
|
||||
[ upstream commit c48e74370c5eafbe8db5c826a797344e4fdf8f49 ]
|
||||
|
||||
There is a stats counter for IMP and global reset in PF driver.
|
||||
hns3 driver has two following task to detect reset event:
|
||||
(1) interrupt handled task(A): triggered by interrupt and detect
|
||||
which reset level. And the reset service will be executed
|
||||
after 10us.
|
||||
(2) polling task(B): scan reset source register to detect if
|
||||
driver has to do reset. And the reset service will be executed
|
||||
after deferred 3s.
|
||||
|
||||
They'll both count the number of one reset plus 1.
|
||||
Task(A) adds it before doing the reset service. And in the reset service,
|
||||
task(B) adds it if hw->reset.schedule is 'SCHEDULE_REQUESTED'.
|
||||
Normally, this reset counter is just added by 1 once. Unfortunately,
|
||||
this counter is added by 2 in the following case:
|
||||
1. Task(B) detect the reset event, like IMP. hw->reset.schedule is
|
||||
set to 'SCHEDULE_REQUESTED'.
|
||||
2. Task(A) is just triggered before running the reset service of task(B).
|
||||
Note: the reset counter is added by 1 at this moment before running
|
||||
the reset service of task(A). Additionally, the reset service of
|
||||
task(B) is canceled in task(A) because of schedule status being
|
||||
'SCHEDULE_REQUESTED'.
|
||||
3. Then the reset service of task(A) is executed at last.
|
||||
Note: The reset counter is added by 1 again in this step because of
|
||||
schedule status still being 'SCHEDULE_REQUESTED'.
|
||||
|
||||
So this patch fix it by setting the scheduling status to
|
||||
'SCHEDULE_REQUESTED' in step 2.
|
||||
|
||||
Fixes: 2790c6464725 ("net/hns3: support device reset")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_intr.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
|
||||
index 57679254ee..51711244b5 100644
|
||||
--- a/drivers/net/hns3/hns3_intr.c
|
||||
+++ b/drivers/net/hns3/hns3_intr.c
|
||||
@@ -2413,8 +2413,8 @@ hns3_schedule_reset(struct hns3_adapter *hns)
|
||||
if (__atomic_load_n(&hw->reset.schedule, __ATOMIC_RELAXED) ==
|
||||
SCHEDULE_DEFERRED)
|
||||
rte_eal_alarm_cancel(hw->reset.ops->reset_service, hns);
|
||||
- else
|
||||
- __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
|
||||
+
|
||||
+ __atomic_store_n(&hw->reset.schedule, SCHEDULE_REQUESTED,
|
||||
__ATOMIC_RELAXED);
|
||||
|
||||
rte_eal_alarm_set(SWITCH_CONTEXT_US, hw->reset.ops->reset_service, hns);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
74
0373-net-hns3-remove-reset-log-in-secondary.patch
Normal file
74
0373-net-hns3-remove-reset-log-in-secondary.patch
Normal file
@ -0,0 +1,74 @@
|
||||
From 0593fced9d1946d55c95c8dea448217f0867faff Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:43 +0800
|
||||
Subject: [PATCH 373/394] net/hns3: remove reset log in secondary
|
||||
|
||||
[ upstream commit 5394df455749f60614a19d791d1d73c26b74dea1 ]
|
||||
|
||||
The reset event is checked and done in primary. And the secondary
|
||||
doesn't check and display reset log. There is a patch to remove the
|
||||
check code for secondary. please see commit a8f1f7cf1b42 ("net/hns3:
|
||||
fix crash when secondary process access FW")
|
||||
|
||||
This patch removes the redundant log print of reset.
|
||||
|
||||
Fixes: a8f1f7cf1b42 ("net/hns3: fix crash when secondary process access FW")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 11 +++++------
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 11 +++++------
|
||||
2 files changed, 10 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index ad595478a7..185f211591 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -5512,14 +5512,13 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
|
||||
enum hns3_reset_level reset;
|
||||
|
||||
/*
|
||||
- * Check the registers to confirm whether there is reset pending.
|
||||
- * Note: This check may lead to schedule reset task, but only primary
|
||||
- * process can process the reset event. Therefore, limit the
|
||||
- * checking under only primary process.
|
||||
+ * Only primary can process can process the reset event,
|
||||
+ * so don't check reset event in secondary.
|
||||
*/
|
||||
- if (rte_eal_process_type() == RTE_PROC_PRIMARY)
|
||||
- hns3_check_event_cause(hns, NULL);
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ return false;
|
||||
|
||||
+ hns3_check_event_cause(hns, NULL);
|
||||
reset = hns3_get_reset_level(hns, &hw->reset.pending);
|
||||
if (reset != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET &&
|
||||
hw->reset.level < reset) {
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 02fb4a84cf..003071c6ff 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -1796,14 +1796,13 @@ hns3vf_is_reset_pending(struct hns3_adapter *hns)
|
||||
return false;
|
||||
|
||||
/*
|
||||
- * Check the registers to confirm whether there is reset pending.
|
||||
- * Note: This check may lead to schedule reset task, but only primary
|
||||
- * process can process the reset event. Therefore, limit the
|
||||
- * checking under only primary process.
|
||||
+ * Only primary can process can process the reset event,
|
||||
+ * so don't check reset event in secondary.
|
||||
*/
|
||||
- if (rte_eal_process_type() == RTE_PROC_PRIMARY)
|
||||
- hns3vf_check_event_cause(hns, NULL);
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ return false;
|
||||
|
||||
+ hns3vf_check_event_cause(hns, NULL);
|
||||
reset = hns3vf_get_reset_level(hw, &hw->reset.pending);
|
||||
if (hw->reset.level != HNS3_NONE_RESET && reset != HNS3_NONE_RESET &&
|
||||
hw->reset.level < reset) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
165
0374-net-hns3-fix-multiple-reset-detected-log.patch
Normal file
165
0374-net-hns3-fix-multiple-reset-detected-log.patch
Normal file
@ -0,0 +1,165 @@
|
||||
From c5628ce4a2c2203e172cd70e6d876bd215f650ed Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:44 +0800
|
||||
Subject: [PATCH 374/394] net/hns3: fix multiple reset detected log
|
||||
|
||||
[ upstream commit 5be38fc6c0fc7e54d0121bab2fe93a27b8e8f7ab ]
|
||||
|
||||
Currently, the driver proactively checks whether interrupt exist
|
||||
(by checking reset registers), related reset delay task is scheduled.
|
||||
|
||||
When a reset whose level is equal to or lower than the current level
|
||||
is detected, there is unnecessary to add delay task and print logs.
|
||||
|
||||
This patch fix it.
|
||||
|
||||
Fixes: 2790c6464725 ("net/hns3: support device reset")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 64 ++++++++++++++++++++--------------
|
||||
1 file changed, 37 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 185f211591..8c96c8a964 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -124,42 +124,29 @@ hns3_pf_enable_irq0(struct hns3_hw *hw)
|
||||
}
|
||||
|
||||
static enum hns3_evt_cause
|
||||
-hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,
|
||||
- uint32_t *vec_val)
|
||||
+hns3_proc_imp_reset_event(struct hns3_adapter *hns, uint32_t *vec_val)
|
||||
{
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
|
||||
__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
|
||||
hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
|
||||
*vec_val = BIT(HNS3_VECTOR0_IMPRESET_INT_B);
|
||||
- if (!is_delay) {
|
||||
- hw->reset.stats.imp_cnt++;
|
||||
- hns3_warn(hw, "IMP reset detected, clear reset status");
|
||||
- } else {
|
||||
- hns3_schedule_delayed_reset(hns);
|
||||
- hns3_warn(hw, "IMP reset detected, don't clear reset status");
|
||||
- }
|
||||
+ hw->reset.stats.imp_cnt++;
|
||||
+ hns3_warn(hw, "IMP reset detected, clear reset status");
|
||||
|
||||
return HNS3_VECTOR0_EVENT_RST;
|
||||
}
|
||||
|
||||
static enum hns3_evt_cause
|
||||
-hns3_proc_global_reset_event(struct hns3_adapter *hns, bool is_delay,
|
||||
- uint32_t *vec_val)
|
||||
+hns3_proc_global_reset_event(struct hns3_adapter *hns, uint32_t *vec_val)
|
||||
{
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
|
||||
__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
|
||||
hns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);
|
||||
*vec_val = BIT(HNS3_VECTOR0_GLOBALRESET_INT_B);
|
||||
- if (!is_delay) {
|
||||
- hw->reset.stats.global_cnt++;
|
||||
- hns3_warn(hw, "Global reset detected, clear reset status");
|
||||
- } else {
|
||||
- hns3_schedule_delayed_reset(hns);
|
||||
- hns3_warn(hw,
|
||||
- "Global reset detected, don't clear reset status");
|
||||
- }
|
||||
+ hw->reset.stats.global_cnt++;
|
||||
+ hns3_warn(hw, "Global reset detected, clear reset status");
|
||||
|
||||
return HNS3_VECTOR0_EVENT_RST;
|
||||
}
|
||||
@@ -173,14 +160,12 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
|
||||
uint32_t hw_err_src_reg;
|
||||
uint32_t val;
|
||||
enum hns3_evt_cause ret;
|
||||
- bool is_delay;
|
||||
|
||||
/* fetch the events from their corresponding regs */
|
||||
vector0_int_stats = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
cmdq_src_val = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG);
|
||||
hw_err_src_reg = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG);
|
||||
|
||||
- is_delay = clearval == NULL ? true : false;
|
||||
/*
|
||||
* Assumption: If by any chance reset and mailbox events are reported
|
||||
* together then we will only process reset event and defer the
|
||||
@@ -189,13 +174,13 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
|
||||
* from H/W just for the mailbox.
|
||||
*/
|
||||
if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_int_stats) { /* IMP */
|
||||
- ret = hns3_proc_imp_reset_event(hns, is_delay, &val);
|
||||
+ ret = hns3_proc_imp_reset_event(hns, &val);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Global reset */
|
||||
if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_int_stats) {
|
||||
- ret = hns3_proc_global_reset_event(hns, is_delay, &val);
|
||||
+ ret = hns3_proc_global_reset_event(hns, &val);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -224,10 +209,9 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
|
||||
|
||||
val = vector0_int_stats;
|
||||
ret = HNS3_VECTOR0_EVENT_OTHER;
|
||||
-out:
|
||||
|
||||
- if (clearval)
|
||||
- *clearval = val;
|
||||
+out:
|
||||
+ *clearval = val;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5505,6 +5489,32 @@ is_pf_reset_done(struct hns3_hw *hw)
|
||||
return true;
|
||||
}
|
||||
|
||||
+static void
|
||||
+hns3_detect_reset_event(struct hns3_hw *hw)
|
||||
+{
|
||||
+ struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
+ enum hns3_reset_level new_req = HNS3_NONE_RESET;
|
||||
+ enum hns3_reset_level last_req;
|
||||
+ uint32_t vector0_intr_state;
|
||||
+
|
||||
+ last_req = hns3_get_reset_level(hns, &hw->reset.pending);
|
||||
+ vector0_intr_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
+ if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state) {
|
||||
+ __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
|
||||
+ hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
|
||||
+ new_req = HNS3_IMP_RESET;
|
||||
+ } else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) {
|
||||
+ __atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
|
||||
+ hns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);
|
||||
+ new_req = HNS3_GLOBAL_RESET;
|
||||
+ }
|
||||
+
|
||||
+ if (new_req != HNS3_NONE_RESET && last_req < new_req) {
|
||||
+ hns3_schedule_delayed_reset(hns);
|
||||
+ hns3_warn(hw, "High level reset detected, delay do reset");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
bool
|
||||
hns3_is_reset_pending(struct hns3_adapter *hns)
|
||||
{
|
||||
@@ -5518,7 +5528,7 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
return false;
|
||||
|
||||
- hns3_check_event_cause(hns, NULL);
|
||||
+ hns3_detect_reset_event(hw);
|
||||
reset = hns3_get_reset_level(hns, &hw->reset.pending);
|
||||
if (reset != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET &&
|
||||
hw->reset.level < reset) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
229
0375-net-hns3-fix-IMP-or-global-reset.patch
Normal file
229
0375-net-hns3-fix-IMP-or-global-reset.patch
Normal file
@ -0,0 +1,229 @@
|
||||
From 2bf782a351fe9e5bd7155e5be9548fa2569aa6dc Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:45 +0800
|
||||
Subject: [PATCH 375/394] net/hns3: fix IMP or global reset
|
||||
|
||||
[ upstream commit 1eee1ea75c0eadaea6dde368b289cf0acf6a1190 ]
|
||||
|
||||
Currently, when the IMP or Global reset detected, the vector0
|
||||
interrupt is enabled before the reset process is completed.
|
||||
At this moment, if the initialization of IMP is not completed,
|
||||
and the vector0 interrupt may continue to be reported. In this
|
||||
scenario, the IMP/global reset being performed by the driver
|
||||
does not need to be interrupted. Therefore, for IMP and global
|
||||
resets, the driver has to enable the interrupt after the end
|
||||
of reset.
|
||||
|
||||
The RAS interrupt is also shared with the vector0 interrupt.
|
||||
When the interrupt is disabled, the RAS interrupt can still be
|
||||
reported to the driver and the driver interrupt processing
|
||||
function is also called. In this case, the interrupt status of
|
||||
the IMP/global may still exist. Therefore, this patch also has
|
||||
to the check of the new reset level based on the priority of
|
||||
reset level in the interrupt handler.
|
||||
|
||||
Fixes: 2790c6464725 ("net/hns3: support device reset")
|
||||
Fixes: 3988ab0eee52 ("net/hns3: add abnormal interrupt process")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 88 ++++++++++++++++++++++++++++------
|
||||
drivers/net/hns3/hns3_ethdev.h | 1 +
|
||||
drivers/net/hns3/hns3_intr.c | 2 +
|
||||
3 files changed, 77 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 8c96c8a964..0f201b8b99 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -215,6 +215,30 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+void
|
||||
+hns3_clear_reset_event(struct hns3_hw *hw)
|
||||
+{
|
||||
+ uint32_t clearval = 0;
|
||||
+
|
||||
+ switch (hw->reset.level) {
|
||||
+ case HNS3_IMP_RESET:
|
||||
+ clearval = BIT(HNS3_VECTOR0_IMPRESET_INT_B);
|
||||
+ break;
|
||||
+ case HNS3_GLOBAL_RESET:
|
||||
+ clearval = BIT(HNS3_VECTOR0_GLOBALRESET_INT_B);
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (clearval == 0)
|
||||
+ return;
|
||||
+
|
||||
+ hns3_write_dev(hw, HNS3_MISC_RESET_STS_REG, clearval);
|
||||
+
|
||||
+ hns3_pf_enable_irq0(hw);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
hns3_clear_event_cause(struct hns3_hw *hw, uint32_t event_type, uint32_t regclr)
|
||||
{
|
||||
@@ -287,6 +311,34 @@ hns3_delay_before_clear_event_cause(struct hns3_hw *hw, uint32_t event_type, uin
|
||||
}
|
||||
}
|
||||
|
||||
+static bool
|
||||
+hns3_reset_event_valid(struct hns3_hw *hw)
|
||||
+{
|
||||
+ struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
+ enum hns3_reset_level new_req = HNS3_NONE_RESET;
|
||||
+ enum hns3_reset_level last_req;
|
||||
+ uint32_t vector0_int;
|
||||
+
|
||||
+ vector0_int = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
+ if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_int)
|
||||
+ new_req = HNS3_IMP_RESET;
|
||||
+ else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_int)
|
||||
+ new_req = HNS3_GLOBAL_RESET;
|
||||
+ if (new_req == HNS3_NONE_RESET)
|
||||
+ return true;
|
||||
+
|
||||
+ last_req = hns3_get_reset_level(hns, &hw->reset.pending);
|
||||
+ if (last_req == HNS3_NONE_RESET)
|
||||
+ return true;
|
||||
+
|
||||
+ if (new_req > last_req)
|
||||
+ return true;
|
||||
+
|
||||
+ hns3_warn(hw, "last_req (%u) less than or equal to new_req (%u) ignore",
|
||||
+ last_req, new_req);
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
hns3_interrupt_handler(void *param)
|
||||
{
|
||||
@@ -299,6 +351,9 @@ hns3_interrupt_handler(void *param)
|
||||
uint32_t ras_int;
|
||||
uint32_t cmdq_int;
|
||||
|
||||
+ if (!hns3_reset_event_valid(hw))
|
||||
+ return;
|
||||
+
|
||||
/* Disable interrupt */
|
||||
hns3_pf_disable_irq0(hw);
|
||||
|
||||
@@ -327,7 +382,11 @@ hns3_interrupt_handler(void *param)
|
||||
}
|
||||
|
||||
/* Enable interrupt if it is not cause by reset */
|
||||
- hns3_pf_enable_irq0(hw);
|
||||
+ if (event_cause == HNS3_VECTOR0_EVENT_ERR ||
|
||||
+ event_cause == HNS3_VECTOR0_EVENT_MBX ||
|
||||
+ event_cause == HNS3_VECTOR0_EVENT_PTP ||
|
||||
+ event_cause == HNS3_VECTOR0_EVENT_OTHER)
|
||||
+ hns3_pf_enable_irq0(hw);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -5489,7 +5548,7 @@ is_pf_reset_done(struct hns3_hw *hw)
|
||||
return true;
|
||||
}
|
||||
|
||||
-static void
|
||||
+static enum hns3_reset_level
|
||||
hns3_detect_reset_event(struct hns3_hw *hw)
|
||||
{
|
||||
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
@@ -5501,11 +5560,9 @@ hns3_detect_reset_event(struct hns3_hw *hw)
|
||||
vector0_intr_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state) {
|
||||
__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
|
||||
- hns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);
|
||||
new_req = HNS3_IMP_RESET;
|
||||
} else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) {
|
||||
__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
|
||||
- hns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);
|
||||
new_req = HNS3_GLOBAL_RESET;
|
||||
}
|
||||
|
||||
@@ -5513,13 +5570,16 @@ hns3_detect_reset_event(struct hns3_hw *hw)
|
||||
hns3_schedule_delayed_reset(hns);
|
||||
hns3_warn(hw, "High level reset detected, delay do reset");
|
||||
}
|
||||
+
|
||||
+ return new_req;
|
||||
}
|
||||
|
||||
bool
|
||||
hns3_is_reset_pending(struct hns3_adapter *hns)
|
||||
{
|
||||
+ enum hns3_reset_level new_req;
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
- enum hns3_reset_level reset;
|
||||
+ enum hns3_reset_level last_req;
|
||||
|
||||
/*
|
||||
* Only primary can process can process the reset event,
|
||||
@@ -5528,17 +5588,17 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
return false;
|
||||
|
||||
- hns3_detect_reset_event(hw);
|
||||
- reset = hns3_get_reset_level(hns, &hw->reset.pending);
|
||||
- if (reset != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET &&
|
||||
- hw->reset.level < reset) {
|
||||
- hns3_warn(hw, "High level reset %d is pending", reset);
|
||||
+ new_req = hns3_detect_reset_event(hw);
|
||||
+ last_req = hns3_get_reset_level(hns, &hw->reset.pending);
|
||||
+ if (last_req != HNS3_NONE_RESET && new_req != HNS3_NONE_RESET &&
|
||||
+ new_req < last_req) {
|
||||
+ hns3_warn(hw, "High level reset %d is pending", last_req);
|
||||
return true;
|
||||
}
|
||||
- reset = hns3_get_reset_level(hns, &hw->reset.request);
|
||||
- if (reset != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET &&
|
||||
- hw->reset.level < reset) {
|
||||
- hns3_warn(hw, "High level reset %d is request", reset);
|
||||
+ last_req = hns3_get_reset_level(hns, &hw->reset.request);
|
||||
+ if (last_req != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET &&
|
||||
+ hw->reset.level < last_req) {
|
||||
+ hns3_warn(hw, "High level reset %d is request", last_req);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index c85a6912ad..0e8d043704 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -1033,6 +1033,7 @@ void hns3_update_linkstatus_and_event(struct hns3_hw *hw, bool query);
|
||||
void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
|
||||
uint32_t link_speed, uint8_t link_duplex);
|
||||
void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported);
|
||||
+void hns3_clear_reset_event(struct hns3_hw *hw);
|
||||
|
||||
const char *hns3_get_media_type_name(uint8_t media_type);
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
|
||||
index 51711244b5..ce8a28e2f9 100644
|
||||
--- a/drivers/net/hns3/hns3_intr.c
|
||||
+++ b/drivers/net/hns3/hns3_intr.c
|
||||
@@ -2727,6 +2727,7 @@ hns3_reset_post(struct hns3_adapter *hns)
|
||||
/* IMP will wait ready flag before reset */
|
||||
hns3_notify_reset_ready(hw, false);
|
||||
hns3_clear_reset_level(hw, &hw->reset.pending);
|
||||
+ hns3_clear_reset_event(hw);
|
||||
__atomic_store_n(&hns->hw.reset.resetting, 0, __ATOMIC_RELAXED);
|
||||
hw->reset.attempts = 0;
|
||||
hw->reset.stats.success_cnt++;
|
||||
@@ -2775,6 +2776,7 @@ hns3_reset_fail_handle(struct hns3_adapter *hns)
|
||||
struct timeval tv;
|
||||
|
||||
hns3_clear_reset_level(hw, &hw->reset.pending);
|
||||
+ hns3_clear_reset_event(hw);
|
||||
if (hns3_reset_err_handle(hns)) {
|
||||
hw->reset.stage = RESET_STAGE_PREWAIT;
|
||||
hns3_schedule_reset(hns);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
165
0376-net-hns3-refactor-interrupt-state-query.patch
Normal file
165
0376-net-hns3-refactor-interrupt-state-query.patch
Normal file
@ -0,0 +1,165 @@
|
||||
From 4828fd884f3d2abb70976414cc7a9e859001bb6d Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Fri, 27 Oct 2023 14:09:46 +0800
|
||||
Subject: [PATCH 376/394] net/hns3: refactor interrupt state query
|
||||
|
||||
[ upstream commit c01ffb24a241a360361ed5c94a819824a8542f3f ]
|
||||
|
||||
PF driver get all interrupt states by reading three registers. This logic
|
||||
code block is distributed in many places. So this patch extracts a common
|
||||
function to do this to improve the maintenance.
|
||||
|
||||
Fixes: f53a793bb7c2 ("net/hns3: add more hardware error types")
|
||||
Fixes: 3988ab0eee52 ("net/hns3: add abnormal interrupt process")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 57 +++++++++++++++++++---------------
|
||||
1 file changed, 32 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 0f201b8b99..9966748835 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -57,6 +57,12 @@ enum hns3_evt_cause {
|
||||
HNS3_VECTOR0_EVENT_OTHER,
|
||||
};
|
||||
|
||||
+struct hns3_intr_state {
|
||||
+ uint32_t vector0_state;
|
||||
+ uint32_t cmdq_state;
|
||||
+ uint32_t hw_err_state;
|
||||
+};
|
||||
+
|
||||
#define HNS3_SPEEDS_SUPP_FEC (RTE_ETH_LINK_SPEED_10G | \
|
||||
RTE_ETH_LINK_SPEED_25G | \
|
||||
RTE_ETH_LINK_SPEED_40G | \
|
||||
@@ -151,20 +157,23 @@ hns3_proc_global_reset_event(struct hns3_adapter *hns, uint32_t *vec_val)
|
||||
return HNS3_VECTOR0_EVENT_RST;
|
||||
}
|
||||
|
||||
+static void
|
||||
+hns3_query_intr_state(struct hns3_hw *hw, struct hns3_intr_state *state)
|
||||
+{
|
||||
+ state->vector0_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
+ state->cmdq_state = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG);
|
||||
+ state->hw_err_state = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG);
|
||||
+}
|
||||
+
|
||||
static enum hns3_evt_cause
|
||||
hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
|
||||
{
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
- uint32_t vector0_int_stats;
|
||||
- uint32_t cmdq_src_val;
|
||||
- uint32_t hw_err_src_reg;
|
||||
+ struct hns3_intr_state state;
|
||||
uint32_t val;
|
||||
enum hns3_evt_cause ret;
|
||||
|
||||
- /* fetch the events from their corresponding regs */
|
||||
- vector0_int_stats = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
- cmdq_src_val = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG);
|
||||
- hw_err_src_reg = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG);
|
||||
+ hns3_query_intr_state(hw, &state);
|
||||
|
||||
/*
|
||||
* Assumption: If by any chance reset and mailbox events are reported
|
||||
@@ -173,41 +182,41 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
|
||||
* RX CMDQ event this time we would receive again another interrupt
|
||||
* from H/W just for the mailbox.
|
||||
*/
|
||||
- if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_int_stats) { /* IMP */
|
||||
+ if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & state.vector0_state) { /* IMP */
|
||||
ret = hns3_proc_imp_reset_event(hns, &val);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Global reset */
|
||||
- if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_int_stats) {
|
||||
+ if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & state.vector0_state) {
|
||||
ret = hns3_proc_global_reset_event(hns, &val);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Check for vector0 1588 event source */
|
||||
- if (BIT(HNS3_VECTOR0_1588_INT_B) & vector0_int_stats) {
|
||||
+ if (BIT(HNS3_VECTOR0_1588_INT_B) & state.vector0_state) {
|
||||
val = BIT(HNS3_VECTOR0_1588_INT_B);
|
||||
ret = HNS3_VECTOR0_EVENT_PTP;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* check for vector0 msix event source */
|
||||
- if (vector0_int_stats & HNS3_VECTOR0_REG_MSIX_MASK ||
|
||||
- hw_err_src_reg & HNS3_RAS_REG_NFE_MASK) {
|
||||
- val = vector0_int_stats | hw_err_src_reg;
|
||||
+ if (state.vector0_state & HNS3_VECTOR0_REG_MSIX_MASK ||
|
||||
+ state.hw_err_state & HNS3_RAS_REG_NFE_MASK) {
|
||||
+ val = state.vector0_state | state.hw_err_state;
|
||||
ret = HNS3_VECTOR0_EVENT_ERR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* check for vector0 mailbox(=CMDQ RX) event source */
|
||||
- if (BIT(HNS3_VECTOR0_RX_CMDQ_INT_B) & cmdq_src_val) {
|
||||
- cmdq_src_val &= ~BIT(HNS3_VECTOR0_RX_CMDQ_INT_B);
|
||||
- val = cmdq_src_val;
|
||||
+ if (BIT(HNS3_VECTOR0_RX_CMDQ_INT_B) & state.cmdq_state) {
|
||||
+ state.cmdq_state &= ~BIT(HNS3_VECTOR0_RX_CMDQ_INT_B);
|
||||
+ val = state.cmdq_state;
|
||||
ret = HNS3_VECTOR0_EVENT_MBX;
|
||||
goto out;
|
||||
}
|
||||
|
||||
- val = vector0_int_stats;
|
||||
+ val = state.vector0_state;
|
||||
ret = HNS3_VECTOR0_EVENT_OTHER;
|
||||
|
||||
out:
|
||||
@@ -346,10 +355,8 @@ hns3_interrupt_handler(void *param)
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
enum hns3_evt_cause event_cause;
|
||||
+ struct hns3_intr_state state;
|
||||
uint32_t clearval = 0;
|
||||
- uint32_t vector0_int;
|
||||
- uint32_t ras_int;
|
||||
- uint32_t cmdq_int;
|
||||
|
||||
if (!hns3_reset_event_valid(hw))
|
||||
return;
|
||||
@@ -358,16 +365,15 @@ hns3_interrupt_handler(void *param)
|
||||
hns3_pf_disable_irq0(hw);
|
||||
|
||||
event_cause = hns3_check_event_cause(hns, &clearval);
|
||||
- vector0_int = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
|
||||
- ras_int = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG);
|
||||
- cmdq_int = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG);
|
||||
+ hns3_query_intr_state(hw, &state);
|
||||
hns3_delay_before_clear_event_cause(hw, event_cause, clearval);
|
||||
hns3_clear_event_cause(hw, event_cause, clearval);
|
||||
/* vector 0 interrupt is shared with reset and mailbox source events. */
|
||||
if (event_cause == HNS3_VECTOR0_EVENT_ERR) {
|
||||
hns3_warn(hw, "received interrupt: vector0_int_stat:0x%x "
|
||||
"ras_int_stat:0x%x cmdq_int_stat:0x%x",
|
||||
- vector0_int, ras_int, cmdq_int);
|
||||
+ state.vector0_state, state.hw_err_state,
|
||||
+ state.cmdq_state);
|
||||
hns3_handle_mac_tnl(hw);
|
||||
hns3_handle_error(hns);
|
||||
} else if (event_cause == HNS3_VECTOR0_EVENT_RST) {
|
||||
@@ -378,7 +384,8 @@ hns3_interrupt_handler(void *param)
|
||||
} else if (event_cause != HNS3_VECTOR0_EVENT_PTP) {
|
||||
hns3_warn(hw, "received unknown event: vector0_int_stat:0x%x "
|
||||
"ras_int_stat:0x%x cmdq_int_stat:0x%x",
|
||||
- vector0_int, ras_int, cmdq_int);
|
||||
+ state.vector0_state, state.hw_err_state,
|
||||
+ state.cmdq_state);
|
||||
}
|
||||
|
||||
/* Enable interrupt if it is not cause by reset */
|
||||
--
|
||||
2.23.0
|
||||
|
||||
348
0377-app-testpmd-ease-configuring-all-offloads.patch
Normal file
348
0377-app-testpmd-ease-configuring-all-offloads.patch
Normal file
@ -0,0 +1,348 @@
|
||||
From fecdbdc4f7b3b0abace40e5070ab9803c8de850d Mon Sep 17 00:00:00 2001
|
||||
From: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Date: Mon, 23 Oct 2023 02:29:39 +0000
|
||||
Subject: [PATCH 377/394] app/testpmd: ease configuring all offloads
|
||||
|
||||
[ upstream commit 8f6c2a1209c31b401d0a8fc74e4b98b1f2d599dc ]
|
||||
|
||||
Extend supports all offload configuration in following commands:
|
||||
1. port config 0 rx_offload all on/off
|
||||
2. port config 0 tx_offload all on/off
|
||||
3. port 0 rxq 0 rx_offload all on/off
|
||||
4. port 0 txq 0 tx_offload all on/off
|
||||
|
||||
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
---
|
||||
app/test-pmd/cmdline.c | 112 +++++++++++---------
|
||||
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +-
|
||||
2 files changed, 68 insertions(+), 52 deletions(-)
|
||||
|
||||
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
|
||||
index 8facca3c51..49152ec348 100644
|
||||
--- a/app/test-pmd/cmdline.c
|
||||
+++ b/app/test-pmd/cmdline.c
|
||||
@@ -867,7 +867,7 @@ static void cmd_help_long_parsed(void *parsed_result,
|
||||
"port config (port_id) udp_tunnel_port add|rm vxlan|geneve|ecpri (udp_port)\n\n"
|
||||
" Add/remove UDP tunnel port for tunneling offload\n\n"
|
||||
|
||||
- "port config <port_id> rx_offload vlan_strip|"
|
||||
+ "port config <port_id> rx_offload all|vlan_strip|"
|
||||
"ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|"
|
||||
"outer_ipv4_cksum|macsec_strip|header_split|"
|
||||
"vlan_filter|vlan_extend|scatter|"
|
||||
@@ -875,7 +875,7 @@ static void cmd_help_long_parsed(void *parsed_result,
|
||||
" Enable or disable a per port Rx offloading"
|
||||
" on all Rx queues of a port\n\n"
|
||||
|
||||
- "port (port_id) rxq (queue_id) rx_offload vlan_strip|"
|
||||
+ "port (port_id) rxq (queue_id) rx_offload all|vlan_strip|"
|
||||
"ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|"
|
||||
"outer_ipv4_cksum|macsec_strip|header_split|"
|
||||
"vlan_filter|vlan_extend|scatter|"
|
||||
@@ -883,7 +883,7 @@ static void cmd_help_long_parsed(void *parsed_result,
|
||||
" Enable or disable a per queue Rx offloading"
|
||||
" only on a specific Rx queue\n\n"
|
||||
|
||||
- "port config (port_id) tx_offload vlan_insert|"
|
||||
+ "port config (port_id) tx_offload all|vlan_insert|"
|
||||
"ipv4_cksum|udp_cksum|tcp_cksum|sctp_cksum|tcp_tso|"
|
||||
"udp_tso|outer_ipv4_cksum|qinq_insert|vxlan_tnl_tso|"
|
||||
"gre_tnl_tso|ipip_tnl_tso|geneve_tnl_tso|"
|
||||
@@ -892,7 +892,7 @@ static void cmd_help_long_parsed(void *parsed_result,
|
||||
" Enable or disable a per port Tx offloading"
|
||||
" on all Tx queues of a port\n\n"
|
||||
|
||||
- "port (port_id) txq (queue_id) tx_offload vlan_insert|"
|
||||
+ "port (port_id) txq (queue_id) tx_offload all|vlan_insert|"
|
||||
"ipv4_cksum|udp_cksum|tcp_cksum|sctp_cksum|tcp_tso|"
|
||||
"udp_tso|outer_ipv4_cksum|qinq_insert|vxlan_tnl_tso|"
|
||||
"gre_tnl_tso|ipip_tnl_tso|geneve_tnl_tso|macsec_insert"
|
||||
@@ -16175,7 +16175,7 @@ cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_rx_offload =
|
||||
cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_offload =
|
||||
TOKEN_STRING_INITIALIZER
|
||||
(struct cmd_config_per_port_rx_offload_result,
|
||||
- offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
|
||||
+ offload, "all#vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
|
||||
"qinq_strip#outer_ipv4_cksum#macsec_strip#"
|
||||
"header_split#vlan_filter#vlan_extend#"
|
||||
"scatter#buffer_split#timestamp#security#"
|
||||
@@ -16218,8 +16218,8 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result,
|
||||
portid_t port_id = res->port_id;
|
||||
struct rte_eth_dev_info dev_info;
|
||||
struct rte_port *port = &ports[port_id];
|
||||
- uint64_t single_offload;
|
||||
uint16_t nb_rx_queues;
|
||||
+ uint64_t offload;
|
||||
int q;
|
||||
int ret;
|
||||
|
||||
@@ -16230,25 +16230,29 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result,
|
||||
return;
|
||||
}
|
||||
|
||||
- single_offload = search_rx_offload(res->offload);
|
||||
- if (single_offload == 0) {
|
||||
- fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
ret = eth_dev_info_get_print_err(port_id, &dev_info);
|
||||
if (ret != 0)
|
||||
return;
|
||||
|
||||
+ if (!strcmp(res->offload, "all")) {
|
||||
+ offload = dev_info.rx_offload_capa;
|
||||
+ } else {
|
||||
+ offload = search_rx_offload(res->offload);
|
||||
+ if (offload == 0) {
|
||||
+ fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
nb_rx_queues = dev_info.nb_rx_queues;
|
||||
if (!strcmp(res->on_off, "on")) {
|
||||
- port->dev_conf.rxmode.offloads |= single_offload;
|
||||
+ port->dev_conf.rxmode.offloads |= offload;
|
||||
for (q = 0; q < nb_rx_queues; q++)
|
||||
- port->rx_conf[q].offloads |= single_offload;
|
||||
+ port->rx_conf[q].offloads |= offload;
|
||||
} else {
|
||||
- port->dev_conf.rxmode.offloads &= ~single_offload;
|
||||
+ port->dev_conf.rxmode.offloads &= ~offload;
|
||||
for (q = 0; q < nb_rx_queues; q++)
|
||||
- port->rx_conf[q].offloads &= ~single_offload;
|
||||
+ port->rx_conf[q].offloads &= ~offload;
|
||||
}
|
||||
|
||||
cmd_reconfig_device_queue(port_id, 1, 1);
|
||||
@@ -16257,7 +16261,7 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result,
|
||||
cmdline_parse_inst_t cmd_config_per_port_rx_offload = {
|
||||
.f = cmd_config_per_port_rx_offload_parsed,
|
||||
.data = NULL,
|
||||
- .help_str = "port config <port_id> rx_offload vlan_strip|ipv4_cksum|"
|
||||
+ .help_str = "port config <port_id> rx_offload all|vlan_strip|ipv4_cksum|"
|
||||
"udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|"
|
||||
"macsec_strip|header_split|vlan_filter|vlan_extend|"
|
||||
"scatter|buffer_split|timestamp|security|"
|
||||
@@ -16307,7 +16311,7 @@ cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_rxoffload =
|
||||
cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_offload =
|
||||
TOKEN_STRING_INITIALIZER
|
||||
(struct cmd_config_per_queue_rx_offload_result,
|
||||
- offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
|
||||
+ offload, "all#vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
|
||||
"qinq_strip#outer_ipv4_cksum#macsec_strip#"
|
||||
"header_split#vlan_filter#vlan_extend#"
|
||||
"scatter#buffer_split#timestamp#security#keep_crc");
|
||||
@@ -16326,7 +16330,7 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
|
||||
portid_t port_id = res->port_id;
|
||||
uint16_t queue_id = res->queue_id;
|
||||
struct rte_port *port = &ports[port_id];
|
||||
- uint64_t single_offload;
|
||||
+ uint64_t offload;
|
||||
int ret;
|
||||
|
||||
if (port->port_status != RTE_PORT_STOPPED) {
|
||||
@@ -16347,16 +16351,20 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
|
||||
return;
|
||||
}
|
||||
|
||||
- single_offload = search_rx_offload(res->offload);
|
||||
- if (single_offload == 0) {
|
||||
- fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
- return;
|
||||
+ if (!strcmp(res->offload, "all")) {
|
||||
+ offload = dev_info.rx_queue_offload_capa;
|
||||
+ } else {
|
||||
+ offload = search_rx_offload(res->offload);
|
||||
+ if (offload == 0) {
|
||||
+ fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!strcmp(res->on_off, "on"))
|
||||
- port->rx_conf[queue_id].offloads |= single_offload;
|
||||
+ port->rx_conf[queue_id].offloads |= offload;
|
||||
else
|
||||
- port->rx_conf[queue_id].offloads &= ~single_offload;
|
||||
+ port->rx_conf[queue_id].offloads &= ~offload;
|
||||
|
||||
cmd_reconfig_device_queue(port_id, 1, 1);
|
||||
}
|
||||
@@ -16365,7 +16373,7 @@ cmdline_parse_inst_t cmd_config_per_queue_rx_offload = {
|
||||
.f = cmd_config_per_queue_rx_offload_parsed,
|
||||
.data = NULL,
|
||||
.help_str = "port <port_id> rxq <queue_id> rx_offload "
|
||||
- "vlan_strip|ipv4_cksum|"
|
||||
+ "all|vlan_strip|ipv4_cksum|"
|
||||
"udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|"
|
||||
"macsec_strip|header_split|vlan_filter|vlan_extend|"
|
||||
"scatter|buffer_split|timestamp|security|"
|
||||
@@ -16594,7 +16602,7 @@ cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_tx_offload =
|
||||
cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_offload =
|
||||
TOKEN_STRING_INITIALIZER
|
||||
(struct cmd_config_per_port_tx_offload_result,
|
||||
- offload, "vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#"
|
||||
+ offload, "all#vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#"
|
||||
"sctp_cksum#tcp_tso#udp_tso#outer_ipv4_cksum#"
|
||||
"qinq_insert#vxlan_tnl_tso#gre_tnl_tso#"
|
||||
"ipip_tnl_tso#geneve_tnl_tso#macsec_insert#"
|
||||
@@ -16641,8 +16649,8 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result,
|
||||
portid_t port_id = res->port_id;
|
||||
struct rte_eth_dev_info dev_info;
|
||||
struct rte_port *port = &ports[port_id];
|
||||
- uint64_t single_offload;
|
||||
uint16_t nb_tx_queues;
|
||||
+ uint64_t offload;
|
||||
int q;
|
||||
int ret;
|
||||
|
||||
@@ -16653,25 +16661,29 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result,
|
||||
return;
|
||||
}
|
||||
|
||||
- single_offload = search_tx_offload(res->offload);
|
||||
- if (single_offload == 0) {
|
||||
- fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
ret = eth_dev_info_get_print_err(port_id, &dev_info);
|
||||
if (ret != 0)
|
||||
return;
|
||||
|
||||
+ if (!strcmp(res->offload, "all")) {
|
||||
+ offload = dev_info.tx_offload_capa;
|
||||
+ } else {
|
||||
+ offload = search_tx_offload(res->offload);
|
||||
+ if (offload == 0) {
|
||||
+ fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
nb_tx_queues = dev_info.nb_tx_queues;
|
||||
if (!strcmp(res->on_off, "on")) {
|
||||
- port->dev_conf.txmode.offloads |= single_offload;
|
||||
+ port->dev_conf.txmode.offloads |= offload;
|
||||
for (q = 0; q < nb_tx_queues; q++)
|
||||
- port->tx_conf[q].offloads |= single_offload;
|
||||
+ port->tx_conf[q].offloads |= offload;
|
||||
} else {
|
||||
- port->dev_conf.txmode.offloads &= ~single_offload;
|
||||
+ port->dev_conf.txmode.offloads &= ~offload;
|
||||
for (q = 0; q < nb_tx_queues; q++)
|
||||
- port->tx_conf[q].offloads &= ~single_offload;
|
||||
+ port->tx_conf[q].offloads &= ~offload;
|
||||
}
|
||||
|
||||
cmd_reconfig_device_queue(port_id, 1, 1);
|
||||
@@ -16681,7 +16693,7 @@ cmdline_parse_inst_t cmd_config_per_port_tx_offload = {
|
||||
.f = cmd_config_per_port_tx_offload_parsed,
|
||||
.data = NULL,
|
||||
.help_str = "port config <port_id> tx_offload "
|
||||
- "vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|"
|
||||
+ "all|vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|"
|
||||
"sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|"
|
||||
"qinq_insert|vxlan_tnl_tso|gre_tnl_tso|"
|
||||
"ipip_tnl_tso|geneve_tnl_tso|macsec_insert|"
|
||||
@@ -16732,7 +16744,7 @@ cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_txoffload =
|
||||
cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_offload =
|
||||
TOKEN_STRING_INITIALIZER
|
||||
(struct cmd_config_per_queue_tx_offload_result,
|
||||
- offload, "vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#"
|
||||
+ offload, "all#vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#"
|
||||
"sctp_cksum#tcp_tso#udp_tso#outer_ipv4_cksum#"
|
||||
"qinq_insert#vxlan_tnl_tso#gre_tnl_tso#"
|
||||
"ipip_tnl_tso#geneve_tnl_tso#macsec_insert#"
|
||||
@@ -16752,7 +16764,7 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
|
||||
portid_t port_id = res->port_id;
|
||||
uint16_t queue_id = res->queue_id;
|
||||
struct rte_port *port = &ports[port_id];
|
||||
- uint64_t single_offload;
|
||||
+ uint64_t offload;
|
||||
int ret;
|
||||
|
||||
if (port->port_status != RTE_PORT_STOPPED) {
|
||||
@@ -16773,16 +16785,20 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
|
||||
return;
|
||||
}
|
||||
|
||||
- single_offload = search_tx_offload(res->offload);
|
||||
- if (single_offload == 0) {
|
||||
- fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
- return;
|
||||
+ if (!strcmp(res->offload, "all")) {
|
||||
+ offload = dev_info.tx_queue_offload_capa;
|
||||
+ } else {
|
||||
+ offload = search_tx_offload(res->offload);
|
||||
+ if (offload == 0) {
|
||||
+ fprintf(stderr, "Unknown offload name: %s\n", res->offload);
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!strcmp(res->on_off, "on"))
|
||||
- port->tx_conf[queue_id].offloads |= single_offload;
|
||||
+ port->tx_conf[queue_id].offloads |= offload;
|
||||
else
|
||||
- port->tx_conf[queue_id].offloads &= ~single_offload;
|
||||
+ port->tx_conf[queue_id].offloads &= ~offload;
|
||||
|
||||
cmd_reconfig_device_queue(port_id, 1, 1);
|
||||
}
|
||||
@@ -16791,7 +16807,7 @@ cmdline_parse_inst_t cmd_config_per_queue_tx_offload = {
|
||||
.f = cmd_config_per_queue_tx_offload_parsed,
|
||||
.data = NULL,
|
||||
.help_str = "port <port_id> txq <queue_id> tx_offload "
|
||||
- "vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|"
|
||||
+ "all|vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|"
|
||||
"sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|"
|
||||
"qinq_insert|vxlan_tnl_tso|gre_tnl_tso|"
|
||||
"ipip_tnl_tso|geneve_tnl_tso|macsec_insert|"
|
||||
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
|
||||
index c33c8456bf..50c45db6f7 100644
|
||||
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
|
||||
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
|
||||
@@ -1772,7 +1772,7 @@ Enable or disable a per port Rx offloading on all Rx queues of a port::
|
||||
testpmd> port config (port_id) rx_offload (offloading) on|off
|
||||
|
||||
* ``offloading``: can be any of these offloading capability:
|
||||
- vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
|
||||
+ all, vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
|
||||
qinq_strip, outer_ipv4_cksum, macsec_strip,
|
||||
header_split, vlan_filter, vlan_extend, scatter, timestamp, security,
|
||||
keep_crc, rss_hash
|
||||
@@ -1787,7 +1787,7 @@ Enable or disable a per queue Rx offloading only on a specific Rx queue::
|
||||
testpmd> port (port_id) rxq (queue_id) rx_offload (offloading) on|off
|
||||
|
||||
* ``offloading``: can be any of these offloading capability:
|
||||
- vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
|
||||
+ all, vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
|
||||
qinq_strip, outer_ipv4_cksum, macsec_strip,
|
||||
header_split, vlan_filter, vlan_extend, scatter, timestamp, security,
|
||||
keep_crc
|
||||
@@ -1802,7 +1802,7 @@ Enable or disable a per port Tx offloading on all Tx queues of a port::
|
||||
testpmd> port config (port_id) tx_offload (offloading) on|off
|
||||
|
||||
* ``offloading``: can be any of these offloading capability:
|
||||
- vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum,
|
||||
+ all, vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum,
|
||||
sctp_cksum, tcp_tso, udp_tso, outer_ipv4_cksum,
|
||||
qinq_insert, vxlan_tnl_tso, gre_tnl_tso,
|
||||
ipip_tnl_tso, geneve_tnl_tso, macsec_insert,
|
||||
@@ -1818,7 +1818,7 @@ Enable or disable a per queue Tx offloading only on a specific Tx queue::
|
||||
testpmd> port (port_id) txq (queue_id) tx_offload (offloading) on|off
|
||||
|
||||
* ``offloading``: can be any of these offloading capability:
|
||||
- vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum,
|
||||
+ all, vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum,
|
||||
sctp_cksum, tcp_tso, udp_tso, outer_ipv4_cksum,
|
||||
qinq_insert, vxlan_tnl_tso, gre_tnl_tso,
|
||||
ipip_tnl_tso, geneve_tnl_tso, macsec_insert,
|
||||
--
|
||||
2.23.0
|
||||
|
||||
95
0378-net-hns3-fix-setting-DCB-capability.patch
Normal file
95
0378-net-hns3-fix-setting-DCB-capability.patch
Normal file
@ -0,0 +1,95 @@
|
||||
From 98fc655dcb21ac85c24a5f7f454a361ef37e2b07 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Tue, 31 Oct 2023 20:23:54 +0800
|
||||
Subject: [PATCH 378/394] net/hns3: fix setting DCB capability
|
||||
|
||||
[ upstream commit ac61c444e647298dded80a2ab52966a2dbe22b68 ]
|
||||
|
||||
The "hw->capability" is set after querying firmware and version.
|
||||
But the DCB capability of PF is set in other place.
|
||||
So this patch moves setting DCB capability to the place where
|
||||
all capabilities are set.
|
||||
|
||||
Fixes: ab2e2e344163 ("net/hns3: get device capability in primary process")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_cmd.c | 25 +++++++++++++++++++++++++
|
||||
drivers/net/hns3/hns3_ethdev.c | 13 -------------
|
||||
2 files changed, 25 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
|
||||
index ca1d3f1b8c..62c55f347f 100644
|
||||
--- a/drivers/net/hns3/hns3_cmd.c
|
||||
+++ b/drivers/net/hns3/hns3_cmd.c
|
||||
@@ -525,6 +525,28 @@ hns3_build_api_caps(void)
|
||||
return rte_cpu_to_le_32(api_caps);
|
||||
}
|
||||
|
||||
+static void
|
||||
+hns3_set_dcb_capability(struct hns3_hw *hw)
|
||||
+{
|
||||
+ struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
+ struct rte_pci_device *pci_dev;
|
||||
+ struct rte_eth_dev *eth_dev;
|
||||
+ uint16_t device_id;
|
||||
+
|
||||
+ if (hns->is_vf)
|
||||
+ return;
|
||||
+
|
||||
+ eth_dev = &rte_eth_devices[hw->data->port_id];
|
||||
+ pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
|
||||
+ device_id = pci_dev->id.device_id;
|
||||
+
|
||||
+ if (device_id == HNS3_DEV_ID_25GE_RDMA ||
|
||||
+ device_id == HNS3_DEV_ID_50GE_RDMA ||
|
||||
+ device_id == HNS3_DEV_ID_100G_RDMA_MACSEC ||
|
||||
+ device_id == HNS3_DEV_ID_200G_RDMA)
|
||||
+ hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
|
||||
{
|
||||
@@ -542,6 +564,9 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
|
||||
return ret;
|
||||
|
||||
hw->fw_version = rte_le_to_cpu_32(resp->firmware);
|
||||
+
|
||||
+ hns3_set_dcb_capability(hw);
|
||||
+
|
||||
/*
|
||||
* Make sure mask the capability before parse capability because it
|
||||
* may overwrite resp's data.
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 9966748835..022696d204 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -2719,22 +2719,9 @@ static int
|
||||
hns3_get_capability(struct hns3_hw *hw)
|
||||
{
|
||||
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
- struct rte_pci_device *pci_dev;
|
||||
struct hns3_pf *pf = &hns->pf;
|
||||
- struct rte_eth_dev *eth_dev;
|
||||
- uint16_t device_id;
|
||||
int ret;
|
||||
|
||||
- eth_dev = &rte_eth_devices[hw->data->port_id];
|
||||
- pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
|
||||
- device_id = pci_dev->id.device_id;
|
||||
-
|
||||
- if (device_id == HNS3_DEV_ID_25GE_RDMA ||
|
||||
- device_id == HNS3_DEV_ID_50GE_RDMA ||
|
||||
- device_id == HNS3_DEV_ID_100G_RDMA_MACSEC ||
|
||||
- device_id == HNS3_DEV_ID_200G_RDMA)
|
||||
- hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
|
||||
-
|
||||
ret = hns3_get_pci_revision_id(hw, &hw->revision);
|
||||
if (ret)
|
||||
return ret;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
206
0379-net-hns3-fix-LRO-offload-to-report.patch
Normal file
206
0379-net-hns3-fix-LRO-offload-to-report.patch
Normal file
@ -0,0 +1,206 @@
|
||||
From 607756d19e218e01a780551473e3f7c6f3851d45 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Tue, 31 Oct 2023 20:23:55 +0800
|
||||
Subject: [PATCH 379/394] net/hns3: fix LRO offload to report
|
||||
|
||||
[ upstream commit a4b2c6815abd3e39daca2e2c93334b813e6a0be4 ]
|
||||
|
||||
Some network engines, like part of HIP09, may not support LRO
|
||||
offload, but this offload capability is also reported to user.
|
||||
So this patch determines whether driver reports this capability
|
||||
based on the capabilities from firmware.
|
||||
|
||||
In addition, some network engines, like HIP08, always support LRO
|
||||
offload and their firmware don't report this capability. So this
|
||||
patch has to move getting revision ID codes to earlier stage and set
|
||||
default capabilities for these network engines based on revision ID.
|
||||
|
||||
Fixes: ab2e2e344163 ("net/hns3: get device capability in primary process")
|
||||
Fixes: f5ed7d99cf45 ("net/hns3: extract common function to obtain revision ID")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_cmd.c | 17 ++++++++++++++++-
|
||||
drivers/net/hns3/hns3_cmd.h | 1 +
|
||||
drivers/net/hns3/hns3_common.c | 5 +++--
|
||||
drivers/net/hns3/hns3_dump.c | 3 ++-
|
||||
drivers/net/hns3/hns3_ethdev.c | 8 ++++----
|
||||
drivers/net/hns3/hns3_ethdev.h | 1 +
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 8 ++++----
|
||||
drivers/net/hns3/hns3_rxtx.c | 3 +++
|
||||
8 files changed, 34 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
|
||||
index 62c55f347f..a5c4c11dc8 100644
|
||||
--- a/drivers/net/hns3/hns3_cmd.c
|
||||
+++ b/drivers/net/hns3/hns3_cmd.c
|
||||
@@ -513,6 +513,8 @@ hns3_parse_capability(struct hns3_hw *hw,
|
||||
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_TM_B, 1);
|
||||
if (hns3_get_bit(caps, HNS3_CAPS_FC_AUTO_B))
|
||||
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_FC_AUTO_B, 1);
|
||||
+ if (hns3_get_bit(caps, HNS3_CAPS_GRO_B))
|
||||
+ hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_GRO_B, 1);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
@@ -547,6 +549,19 @@ hns3_set_dcb_capability(struct hns3_hw *hw)
|
||||
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
|
||||
}
|
||||
|
||||
+static void
|
||||
+hns3_set_default_capability(struct hns3_hw *hw)
|
||||
+{
|
||||
+ hns3_set_dcb_capability(hw);
|
||||
+
|
||||
+ /*
|
||||
+ * The firmware of the network engines with HIP08 do not report some
|
||||
+ * capabilities, like GRO. Set default capabilities for it.
|
||||
+ */
|
||||
+ if (hw->revision < PCI_REVISION_ID_HIP09_A)
|
||||
+ hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_GRO_B, 1);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
|
||||
{
|
||||
@@ -565,7 +580,7 @@ hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
|
||||
|
||||
hw->fw_version = rte_le_to_cpu_32(resp->firmware);
|
||||
|
||||
- hns3_set_dcb_capability(hw);
|
||||
+ hns3_set_default_capability(hw);
|
||||
|
||||
/*
|
||||
* Make sure mask the capability before parse capability because it
|
||||
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
|
||||
index 3f2bb4fd29..79a8c1edad 100644
|
||||
--- a/drivers/net/hns3/hns3_cmd.h
|
||||
+++ b/drivers/net/hns3/hns3_cmd.h
|
||||
@@ -323,6 +323,7 @@ enum HNS3_CAPS_BITS {
|
||||
HNS3_CAPS_RAS_IMP_B,
|
||||
HNS3_CAPS_RXD_ADV_LAYOUT_B = 15,
|
||||
HNS3_CAPS_TM_B = 19,
|
||||
+ HNS3_CAPS_GRO_B = 20,
|
||||
HNS3_CAPS_FC_AUTO_B = 30,
|
||||
};
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
|
||||
index 5dec62cbfb..6b1aeaa41b 100644
|
||||
--- a/drivers/net/hns3/hns3_common.c
|
||||
+++ b/drivers/net/hns3/hns3_common.c
|
||||
@@ -70,8 +70,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
|
||||
RTE_ETH_RX_OFFLOAD_SCATTER |
|
||||
RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
|
||||
RTE_ETH_RX_OFFLOAD_VLAN_FILTER |
|
||||
- RTE_ETH_RX_OFFLOAD_RSS_HASH |
|
||||
- RTE_ETH_RX_OFFLOAD_TCP_LRO);
|
||||
+ RTE_ETH_RX_OFFLOAD_RSS_HASH);
|
||||
info->tx_offload_capa = (RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
|
||||
RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
|
||||
RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
|
||||
@@ -99,6 +98,8 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
|
||||
|
||||
if (hns3_dev_get_support(hw, PTP))
|
||||
info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
|
||||
+ if (hns3_dev_get_support(hw, GRO))
|
||||
+ info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TCP_LRO;
|
||||
|
||||
info->rx_desc_lim = (struct rte_eth_desc_lim) {
|
||||
.nb_max = HNS3_MAX_RING_DESC,
|
||||
diff --git a/drivers/net/hns3/hns3_dump.c b/drivers/net/hns3/hns3_dump.c
|
||||
index b6e8b621f5..8d4c4d0a3b 100644
|
||||
--- a/drivers/net/hns3/hns3_dump.c
|
||||
+++ b/drivers/net/hns3/hns3_dump.c
|
||||
@@ -104,7 +104,8 @@ hns3_get_dev_feature_capability(FILE *file, struct hns3_hw *hw)
|
||||
{HNS3_DEV_SUPPORT_RAS_IMP_B, "RAS IMP"},
|
||||
{HNS3_DEV_SUPPORT_TM_B, "TM"},
|
||||
{HNS3_DEV_SUPPORT_VF_VLAN_FLT_MOD_B, "VF VLAN FILTER MOD"},
|
||||
- {HNS3_DEV_SUPPORT_FC_AUTO_B, "FC AUTO"}
|
||||
+ {HNS3_DEV_SUPPORT_FC_AUTO_B, "FC AUTO"},
|
||||
+ {HNS3_DEV_SUPPORT_GRO_B, "GRO"}
|
||||
};
|
||||
uint32_t i;
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 022696d204..2d4af9f3ea 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -2722,10 +2722,6 @@ hns3_get_capability(struct hns3_hw *hw)
|
||||
struct hns3_pf *pf = &hns->pf;
|
||||
int ret;
|
||||
|
||||
- ret = hns3_get_pci_revision_id(hw, &hw->revision);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
ret = hns3_query_mac_stats_reg_num(hw);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -4582,6 +4578,10 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
|
||||
/* Get hardware io base address from pcie BAR2 IO space */
|
||||
hw->io_base = pci_dev->mem_resource[2].addr;
|
||||
|
||||
+ ret = hns3_get_pci_revision_id(hw, &hw->revision);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
/* Firmware command queue initialize */
|
||||
ret = hns3_cmd_init_queue(hw);
|
||||
if (ret) {
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 0e8d043704..668f141e32 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -888,6 +888,7 @@ enum hns3_dev_cap {
|
||||
HNS3_DEV_SUPPORT_TM_B,
|
||||
HNS3_DEV_SUPPORT_VF_VLAN_FLT_MOD_B,
|
||||
HNS3_DEV_SUPPORT_FC_AUTO_B,
|
||||
+ HNS3_DEV_SUPPORT_GRO_B,
|
||||
};
|
||||
|
||||
#define hns3_dev_get_support(hw, _name) \
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 003071c6ff..ba4fe13c01 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -762,10 +762,6 @@ hns3vf_get_capability(struct hns3_hw *hw)
|
||||
{
|
||||
int ret;
|
||||
|
||||
- ret = hns3_get_pci_revision_id(hw, &hw->revision);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
if (hw->revision < PCI_REVISION_ID_HIP09_A) {
|
||||
hns3_set_default_dev_specifications(hw);
|
||||
hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
|
||||
@@ -1418,6 +1414,10 @@ hns3vf_init_vf(struct rte_eth_dev *eth_dev)
|
||||
/* Get hardware io base address from pcie BAR2 IO space */
|
||||
hw->io_base = pci_dev->mem_resource[2].addr;
|
||||
|
||||
+ ret = hns3_get_pci_revision_id(hw, &hw->revision);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
/* Firmware command queue initialize */
|
||||
ret = hns3_cmd_init_queue(hw);
|
||||
if (ret) {
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index 3054d24080..8b7c469685 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -3125,6 +3125,9 @@ hns3_config_gro(struct hns3_hw *hw, bool en)
|
||||
struct hns3_cmd_desc desc;
|
||||
int ret;
|
||||
|
||||
+ if (!hns3_dev_get_support(hw, GRO))
|
||||
+ return 0;
|
||||
+
|
||||
hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_GRO_GENERIC_CONFIG, false);
|
||||
req = (struct hns3_cfg_gro_status_cmd *)desc.data;
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
100
0380-net-hns3-fix-some-return-values.patch
Normal file
100
0380-net-hns3-fix-some-return-values.patch
Normal file
@ -0,0 +1,100 @@
|
||||
From 52f35192771e5a62412a5fcaebd0d694355efdfa Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Tue, 31 Oct 2023 20:23:56 +0800
|
||||
Subject: [PATCH 380/394] net/hns3: fix some return values
|
||||
|
||||
[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ]
|
||||
|
||||
1. Fix the return value of hns3_get_imissed_stats_num as 'uint16_t'.
|
||||
2. Add some error check for return value.
|
||||
|
||||
Fixes: fcba820d9b9e ("net/hns3: support flow director")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 5 ++++-
|
||||
drivers/net/hns3/hns3_fdir.c | 2 +-
|
||||
drivers/net/hns3/hns3_stats.c | 15 ++++++++++-----
|
||||
3 files changed, 15 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index ba4fe13c01..db1a30aff0 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -2162,8 +2162,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
|
||||
*/
|
||||
if (pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO ||
|
||||
pci_dev->kdrv == RTE_PCI_KDRV_UIO_GENERIC) {
|
||||
- if (hns3vf_enable_msix(pci_dev, true))
|
||||
+ ret = hns3vf_enable_msix(pci_dev, true);
|
||||
+ if (ret != 0) {
|
||||
hns3_err(hw, "Failed to enable msix");
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
|
||||
rte_intr_enable(pci_dev->intr_handle);
|
||||
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
|
||||
index c80fa59e63..d100e58d10 100644
|
||||
--- a/drivers/net/hns3/hns3_fdir.c
|
||||
+++ b/drivers/net/hns3/hns3_fdir.c
|
||||
@@ -978,7 +978,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
|
||||
rule->key_conf.spec.src_port,
|
||||
rule->key_conf.spec.dst_port, ret);
|
||||
else
|
||||
- hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
|
||||
+ ret = hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
|
||||
index c2e692a2c5..9a1e8935e5 100644
|
||||
--- a/drivers/net/hns3/hns3_stats.c
|
||||
+++ b/drivers/net/hns3/hns3_stats.c
|
||||
@@ -771,7 +771,7 @@ hns3_mac_stats_reset(struct hns3_hw *hw)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
+static uint16_t
|
||||
hns3_get_imissed_stats_num(struct hns3_adapter *hns)
|
||||
{
|
||||
#define NO_IMISSED_STATS_NUM 0
|
||||
@@ -993,7 +993,7 @@ hns3_imissed_stats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
struct hns3_rx_missed_stats *imissed_stats = &hw->imissed_stats;
|
||||
- int imissed_stats_num;
|
||||
+ uint16_t imissed_stats_num;
|
||||
int cnt = *count;
|
||||
char *addr;
|
||||
uint16_t i;
|
||||
@@ -1170,7 +1170,7 @@ hns3_imissed_stats_name_get(struct rte_eth_dev *dev,
|
||||
{
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
uint32_t cnt = *count;
|
||||
- int imissed_stats_num;
|
||||
+ uint16_t imissed_stats_num;
|
||||
uint16_t i;
|
||||
|
||||
imissed_stats_num = hns3_get_imissed_stats_num(hns);
|
||||
@@ -1539,8 +1539,13 @@ hns3_stats_init(struct hns3_hw *hw)
|
||||
return ret;
|
||||
}
|
||||
|
||||
- if (!hns->is_vf)
|
||||
- hns3_mac_stats_reset(hw);
|
||||
+ if (!hns->is_vf) {
|
||||
+ ret = hns3_mac_stats_reset(hw);
|
||||
+ if (ret) {
|
||||
+ hns3_err(hw, "reset mac stats failed, ret = %d", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
return hns3_tqp_stats_init(hw);
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
47
0381-net-hns3-fix-some-error-logs.patch
Normal file
47
0381-net-hns3-fix-some-error-logs.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From eacae1d1b2f0d8765dfa14839e88005d7e1eeb73 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Tue, 31 Oct 2023 20:23:57 +0800
|
||||
Subject: [PATCH 381/394] net/hns3: fix some error logs
|
||||
|
||||
[ upstream commit fdafdca875eafe36950542cbfbdb21b01b371081 ]
|
||||
|
||||
This patch fixes some error log.
|
||||
|
||||
Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_dcb.c | 2 +-
|
||||
drivers/net/hns3/hns3_flow.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c
|
||||
index 07b8c46a81..2831d3dc62 100644
|
||||
--- a/drivers/net/hns3/hns3_dcb.c
|
||||
+++ b/drivers/net/hns3/hns3_dcb.c
|
||||
@@ -1082,7 +1082,7 @@ hns3_dcb_map_cfg(struct hns3_hw *hw)
|
||||
|
||||
ret = hns3_pg_to_pri_map(hw);
|
||||
if (ret) {
|
||||
- hns3_err(hw, "pri_to_pg mapping fail: %d", ret);
|
||||
+ hns3_err(hw, "pg_to_pri mapping fail: %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
|
||||
index d5c9c22633..da17fa6e69 100644
|
||||
--- a/drivers/net/hns3/hns3_flow.c
|
||||
+++ b/drivers/net/hns3/hns3_flow.c
|
||||
@@ -927,7 +927,7 @@ hns3_parse_sctp(const struct rte_flow_item *item, struct hns3_fdir_rule *rule,
|
||||
return rte_flow_error_set(error, EINVAL,
|
||||
RTE_FLOW_ERROR_TYPE_ITEM_MASK,
|
||||
item,
|
||||
- "Only support src & dst port in SCTP");
|
||||
+ "Only support src & dst port & v-tag in SCTP");
|
||||
if (sctp_mask->hdr.src_port) {
|
||||
hns3_set_bit(rule->input_set, INNER_SRC_PORT, 1);
|
||||
rule->key_conf.mask.src_port =
|
||||
--
|
||||
2.23.0
|
||||
|
||||
61
0382-net-hns3-keep-set-get-algo-key-functions-local.patch
Normal file
61
0382-net-hns3-keep-set-get-algo-key-functions-local.patch
Normal file
@ -0,0 +1,61 @@
|
||||
From fd44bf6577c48ed17419db18ef1a87620fa936ec Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Tue, 31 Oct 2023 20:23:58 +0800
|
||||
Subject: [PATCH 382/394] net/hns3: keep set/get algo key functions local
|
||||
|
||||
[ upstream commit 4d996f3b2a1dcce2fff59a0a9490c04480e4c805 ]
|
||||
|
||||
The functions "hns3_rss_set_algo_key()" and "hns3_rss_get_algo_key()"
|
||||
are the inner interfaces to set hardware. Driver already had an API,
|
||||
"hns3_update_rss_algo_key()", to export and to update RSS algo or key.
|
||||
So above two innter interface don't export.
|
||||
|
||||
Fixes: 7da415d27d88 ("net/hns3: use hardware config to report hash key")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rss.c | 4 ++--
|
||||
drivers/net/hns3/hns3_rss.h | 4 ----
|
||||
2 files changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
|
||||
index 6126512bd7..9bb8426256 100644
|
||||
--- a/drivers/net/hns3/hns3_rss.c
|
||||
+++ b/drivers/net/hns3/hns3_rss.c
|
||||
@@ -283,7 +283,7 @@ static const struct {
|
||||
* rss_generic_config command function, opcode:0x0D01.
|
||||
* Used to set algorithm and hash key of RSS.
|
||||
*/
|
||||
-int
|
||||
+static int
|
||||
hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
|
||||
const uint8_t *key, uint8_t key_len)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-int
|
||||
+static int
|
||||
hns3_rss_get_algo_key(struct hns3_hw *hw, uint8_t *hash_algo,
|
||||
uint8_t *key, uint8_t key_len)
|
||||
{
|
||||
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
|
||||
index 415430a399..9d182a8025 100644
|
||||
--- a/drivers/net/hns3/hns3_rss.h
|
||||
+++ b/drivers/net/hns3/hns3_rss.h
|
||||
@@ -190,10 +190,6 @@ bool hns3_check_rss_types_valid(struct hns3_hw *hw, uint64_t types);
|
||||
int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
|
||||
int hns3_set_rss_tuple_field(struct hns3_hw *hw, uint64_t tuple_fields);
|
||||
int hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields);
|
||||
-int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
|
||||
- const uint8_t *key, uint8_t key_len);
|
||||
-int hns3_rss_get_algo_key(struct hns3_hw *hw, uint8_t *hash_algo,
|
||||
- uint8_t *key, uint8_t key_len);
|
||||
uint64_t hns3_rss_calc_tuple_filed(uint64_t rss_hf);
|
||||
int hns3_update_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
|
||||
uint8_t *key, uint8_t key_len);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
43
0383-net-hns3-fix-uninitialized-hash-algo-value.patch
Normal file
43
0383-net-hns3-fix-uninitialized-hash-algo-value.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From f99da9ff1fd939d98025625bca3986054f00592e Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Tue, 31 Oct 2023 20:23:59 +0800
|
||||
Subject: [PATCH 383/394] net/hns3: fix uninitialized hash algo value
|
||||
|
||||
[ upstream commit 177cf5c93f9ac86d8a2b817115ef1e979023414c ]
|
||||
|
||||
This patch initializes "hash_algo" as zero to avoid using
|
||||
it uninitialized.
|
||||
|
||||
Fixes: e3069658da9f ("net/hns3: reimplement hash flow function")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rss.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
|
||||
index 9bb8426256..eeeca71a5c 100644
|
||||
--- a/drivers/net/hns3/hns3_rss.c
|
||||
+++ b/drivers/net/hns3/hns3_rss.c
|
||||
@@ -771,7 +771,7 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
|
||||
{
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
- uint8_t hash_algo;
|
||||
+ uint8_t hash_algo = 0;
|
||||
int ret;
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
@@ -993,7 +993,7 @@ hns3_update_rss_algo_key(struct hns3_hw *hw, uint8_t hash_func,
|
||||
{
|
||||
uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
|
||||
bool modify_key, modify_algo;
|
||||
- uint8_t hash_algo;
|
||||
+ uint8_t hash_algo = 0;
|
||||
int ret;
|
||||
|
||||
modify_key = (key != NULL && key_len > 0);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
159
0384-ethdev-clarify-RSS-related-fields-usage.patch
Normal file
159
0384-ethdev-clarify-RSS-related-fields-usage.patch
Normal file
@ -0,0 +1,159 @@
|
||||
From e9c4dc9a6488e7dfccba0e24c9e8606beea7e91b Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:12 +0800
|
||||
Subject: [PATCH 384/394] ethdev: clarify RSS related fields usage
|
||||
|
||||
[ upstream commit bae3cfa520a7205d63752c506d51e832d4944180 ]
|
||||
|
||||
In rte_eth_dev_rss_hash_conf_get(), the "rss_key_len" should be
|
||||
greater than or equal to the "hash_key_size" which get from
|
||||
rte_eth_dev_info_get() API. And the "rss_key" should contain at
|
||||
least "hash_key_size" bytes. If these requirements are not met,
|
||||
the query unreliable.
|
||||
|
||||
In rte_eth_dev_rss_hash_update() or rte_eth_dev_configure(), the
|
||||
"rss_key_len" indicates the length of the "rss_key" in bytes of
|
||||
the array pointed by "rss_key", it should be equal to the
|
||||
"hash_key_size" if "rss_key" is not NULL.
|
||||
|
||||
This patch overwrites the comments of fields of "rte_eth_rss_conf"
|
||||
and "RTE_ETH_HASH_FUNCTION_DEFAULT", checks "rss_key_len" in
|
||||
ethdev level, and documents these changes.
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
---
|
||||
lib/ethdev/rte_ethdev.c | 32 ++++++++++++++++++++++++++++++++
|
||||
lib/ethdev/rte_ethdev.h | 33 ++++++++++++++++++---------------
|
||||
lib/ethdev/rte_flow.h | 1 +
|
||||
3 files changed, 51 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
|
||||
index 132e3d8dc7..f8f111ba6d 100644
|
||||
--- a/lib/ethdev/rte_ethdev.c
|
||||
+++ b/lib/ethdev/rte_ethdev.c
|
||||
@@ -1620,6 +1620,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
|
||||
goto rollback;
|
||||
}
|
||||
|
||||
+ if (dev_conf->rx_adv_conf.rss_conf.rss_key != NULL &&
|
||||
+ dev_conf->rx_adv_conf.rss_conf.rss_key_len != dev_info.hash_key_size) {
|
||||
+ RTE_ETHDEV_LOG(ERR,
|
||||
+ "Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n",
|
||||
+ port_id, dev_conf->rx_adv_conf.rss_conf.rss_key_len,
|
||||
+ dev_info.hash_key_size);
|
||||
+ ret = -EINVAL;
|
||||
+ goto rollback;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Setup new number of Rx/Tx queues and reconfigure device.
|
||||
*/
|
||||
@@ -4205,6 +4215,14 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
+ if (rss_conf->rss_key != NULL &&
|
||||
+ rss_conf->rss_key_len != dev_info.hash_key_size) {
|
||||
+ RTE_ETHDEV_LOG(ERR,
|
||||
+ "Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n",
|
||||
+ port_id, rss_conf->rss_key_len, dev_info.hash_key_size);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_update, -ENOTSUP);
|
||||
return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
|
||||
rss_conf));
|
||||
@@ -4214,7 +4232,9 @@ int
|
||||
rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
|
||||
struct rte_eth_rss_conf *rss_conf)
|
||||
{
|
||||
+ struct rte_eth_dev_info dev_info = { 0 };
|
||||
struct rte_eth_dev *dev;
|
||||
+ int ret;
|
||||
|
||||
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
|
||||
dev = &rte_eth_devices[port_id];
|
||||
@@ -4226,6 +4246,18 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ ret = rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ if (ret != 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (rss_conf->rss_key != NULL &&
|
||||
+ rss_conf->rss_key_len < dev_info.hash_key_size) {
|
||||
+ RTE_ETHDEV_LOG(ERR,
|
||||
+ "Ethdev port_id=%u invalid RSS key len: %u, should not be less than: %u\n",
|
||||
+ port_id, rss_conf->rss_key_len, dev_info.hash_key_size);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP);
|
||||
return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
|
||||
rss_conf));
|
||||
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
|
||||
index c555ecb840..03799bafa9 100644
|
||||
--- a/lib/ethdev/rte_ethdev.h
|
||||
+++ b/lib/ethdev/rte_ethdev.h
|
||||
@@ -506,24 +506,27 @@ struct rte_vlan_filter_conf {
|
||||
/**
|
||||
* A structure used to configure the Receive Side Scaling (RSS) feature
|
||||
* of an Ethernet port.
|
||||
- * If not NULL, the *rss_key* pointer of the *rss_conf* structure points
|
||||
- * to an array holding the RSS key to use for hashing specific header
|
||||
- * fields of received packets. The length of this array should be indicated
|
||||
- * by *rss_key_len* below. Otherwise, a default random hash key is used by
|
||||
- * the device driver.
|
||||
- *
|
||||
- * The *rss_key_len* field of the *rss_conf* structure indicates the length
|
||||
- * in bytes of the array pointed by *rss_key*. To be compatible, this length
|
||||
- * will be checked in i40e only. Others assume 40 bytes to be used as before.
|
||||
- *
|
||||
- * The *rss_hf* field of the *rss_conf* structure indicates the different
|
||||
- * types of IPv4/IPv6 packets to which the RSS hashing must be applied.
|
||||
- * Supplying an *rss_hf* equal to zero disables the RSS feature.
|
||||
*/
|
||||
struct rte_eth_rss_conf {
|
||||
- uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */
|
||||
+ /**
|
||||
+ * In rte_eth_dev_rss_hash_conf_get(), the *rss_key_len* should be
|
||||
+ * greater than or equal to the *hash_key_size* which get from
|
||||
+ * rte_eth_dev_info_get() API. And the *rss_key* should contain at least
|
||||
+ * *hash_key_size* bytes. If not meet these requirements, the query
|
||||
+ * result is unreliable even if the operation returns success.
|
||||
+ *
|
||||
+ * In rte_eth_dev_rss_hash_update() or rte_eth_dev_configure(), if
|
||||
+ * *rss_key* is not NULL, the *rss_key_len* indicates the length of the
|
||||
+ * *rss_key* in bytes and it should be equal to *hash_key_size*.
|
||||
+ * If *rss_key* is NULL, drivers are free to use a random or a default key.
|
||||
+ */
|
||||
+ uint8_t *rss_key;
|
||||
uint8_t rss_key_len; /**< hash key length in bytes. */
|
||||
- uint64_t rss_hf; /**< Hash functions to apply - see below. */
|
||||
+ /**
|
||||
+ * Indicates the type of packets or the specific part of packets to
|
||||
+ * which RSS hashing is to be applied.
|
||||
+ */
|
||||
+ uint64_t rss_hf;
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
|
||||
index 1031fb246b..039d09e0a9 100644
|
||||
--- a/lib/ethdev/rte_flow.h
|
||||
+++ b/lib/ethdev/rte_flow.h
|
||||
@@ -2974,6 +2974,7 @@ struct rte_flow_query_count {
|
||||
* Hash function types.
|
||||
*/
|
||||
enum rte_eth_hash_function {
|
||||
+ /** DEFAULT means driver decides which hash algorithm to pick. */
|
||||
RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
|
||||
RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
|
||||
RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
|
||||
--
|
||||
2.23.0
|
||||
|
||||
207
0385-ethdev-set-and-query-RSS-hash-algorithm.patch
Normal file
207
0385-ethdev-set-and-query-RSS-hash-algorithm.patch
Normal file
@ -0,0 +1,207 @@
|
||||
From 597270b32229f1c39f29cd6b0d07203850bd975b Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:13 +0800
|
||||
Subject: [PATCH 385/394] ethdev: set and query RSS hash algorithm
|
||||
|
||||
[ upstream commit 34ff088cc24159c9fa6e61242efb76d0289b4e37 ]
|
||||
|
||||
Currently, rte_eth_rss_conf supports configuring and querying
|
||||
RSS hash functions, rss key and it's length, but not RSS hash
|
||||
algorithm.
|
||||
|
||||
The structure ``rte_eth_dev_info`` is extended by adding a new
|
||||
field "rss_algo_capa". Drivers are responsible for reporting this
|
||||
capa and configurations of RSS hash algorithm can be verified based
|
||||
on the capability. The default value of "rss_algo_capa" is
|
||||
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.
|
||||
|
||||
The structure ``rte_eth_rss_conf`` is extended by adding a new
|
||||
field "algorithm". This represents the RSS algorithms to apply.
|
||||
If the value of "algorithm" used for configuration is a gibberish
|
||||
value, drivers should report the error.
|
||||
|
||||
To check whether the drivers report valid "algorithm", it is set
|
||||
to default value before querying in rte_eth_dev_rss_hash_conf_get().
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
---
|
||||
lib/ethdev/rte_ethdev.c | 25 +++++++++++++++++++++++++
|
||||
lib/ethdev/rte_ethdev.h | 29 +++++++++++++++++++++++++++++
|
||||
lib/ethdev/rte_flow.c | 1 -
|
||||
lib/ethdev/rte_flow.h | 19 ++-----------------
|
||||
4 files changed, 56 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
|
||||
index f8f111ba6d..ec06bd3a9c 100644
|
||||
--- a/lib/ethdev/rte_ethdev.c
|
||||
+++ b/lib/ethdev/rte_ethdev.c
|
||||
@@ -1422,6 +1422,7 @@ int
|
||||
rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
|
||||
const struct rte_eth_conf *dev_conf)
|
||||
{
|
||||
+ enum rte_eth_hash_function algorithm;
|
||||
struct rte_eth_dev *dev;
|
||||
struct rte_eth_dev_info dev_info;
|
||||
struct rte_eth_conf orig_conf;
|
||||
@@ -1630,6 +1631,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
|
||||
goto rollback;
|
||||
}
|
||||
|
||||
+ algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
|
||||
+ if ((size_t)algorithm >= CHAR_BIT * sizeof(dev_info.rss_algo_capa) ||
|
||||
+ (dev_info.rss_algo_capa & RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
|
||||
+ RTE_ETHDEV_LOG(ERR,
|
||||
+ "Ethdev port_id=%u configured RSS hash algorithm (%u)"
|
||||
+ "is not in the algorithm capability (0x%" PRIx32 ")\n",
|
||||
+ port_id, algorithm, dev_info.rss_algo_capa);
|
||||
+ ret = -EINVAL;
|
||||
+ goto rollback;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Setup new number of Rx/Tx queues and reconfigure device.
|
||||
*/
|
||||
@@ -3507,6 +3519,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
|
||||
dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
|
||||
RTE_ETHER_CRC_LEN;
|
||||
dev_info->max_mtu = UINT16_MAX;
|
||||
+ dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
|
||||
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
|
||||
diag = (*dev->dev_ops->dev_infos_get)(dev, dev_info);
|
||||
@@ -4223,6 +4236,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ if ((size_t)rss_conf->algorithm >= CHAR_BIT * sizeof(dev_info.rss_algo_capa) ||
|
||||
+ (dev_info.rss_algo_capa &
|
||||
+ RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
|
||||
+ RTE_ETHDEV_LOG(ERR,
|
||||
+ "Ethdev port_id=%u configured RSS hash algorithm (%u)"
|
||||
+ "is not in the algorithm capability (0x%" PRIx32 ")\n",
|
||||
+ port_id, rss_conf->algorithm, dev_info.rss_algo_capa);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_update, -ENOTSUP);
|
||||
return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
|
||||
rss_conf));
|
||||
@@ -4258,6 +4281,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
|
||||
+
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP);
|
||||
return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
|
||||
rss_conf));
|
||||
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
|
||||
index 03799bafa9..911b9e03ab 100644
|
||||
--- a/lib/ethdev/rte_ethdev.h
|
||||
+++ b/lib/ethdev/rte_ethdev.h
|
||||
@@ -503,6 +503,33 @@ struct rte_vlan_filter_conf {
|
||||
uint64_t ids[64];
|
||||
};
|
||||
|
||||
+/**
|
||||
+ * Hash function types.
|
||||
+ */
|
||||
+enum rte_eth_hash_function {
|
||||
+ /** DEFAULT means driver decides which hash algorithm to pick. */
|
||||
+ RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
|
||||
+ RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
|
||||
+ RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
|
||||
+ /**
|
||||
+ * Symmetric Toeplitz: src, dst will be replaced by
|
||||
+ * xor(src, dst). For the case with src/dst only,
|
||||
+ * src or dst address will xor with zero pair.
|
||||
+ */
|
||||
+ RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
|
||||
+ /**
|
||||
+ * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
|
||||
+ * the hash function.
|
||||
+ * If src_ip > dst_ip, swap src_ip and dst_ip.
|
||||
+ * If src_port > dst_port, swap src_port and dst_port.
|
||||
+ */
|
||||
+ RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
|
||||
+ RTE_ETH_HASH_FUNCTION_MAX,
|
||||
+};
|
||||
+
|
||||
+#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
|
||||
+#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
|
||||
+
|
||||
/**
|
||||
* A structure used to configure the Receive Side Scaling (RSS) feature
|
||||
* of an Ethernet port.
|
||||
@@ -527,6 +554,7 @@ struct rte_eth_rss_conf {
|
||||
* which RSS hashing is to be applied.
|
||||
*/
|
||||
uint64_t rss_hf;
|
||||
+ enum rte_eth_hash_function algorithm; /**< Hash algorithm. */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1820,6 +1848,7 @@ struct rte_eth_dev_info {
|
||||
/** Device redirection table size, the total number of entries. */
|
||||
uint16_t reta_size;
|
||||
uint8_t hash_key_size; /**< Hash key size in bytes */
|
||||
+ uint32_t rss_algo_capa; /** RSS hash algorithms capabilities */
|
||||
/** Bit mask of RSS offloads, the bit offset also means flow type */
|
||||
uint64_t flow_type_rss_offloads;
|
||||
struct rte_eth_rxconf default_rxconf; /**< Default Rx configuration */
|
||||
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
|
||||
index a93f68abbc..e11c08baae 100644
|
||||
--- a/lib/ethdev/rte_flow.c
|
||||
+++ b/lib/ethdev/rte_flow.c
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <rte_string_fns.h>
|
||||
#include <rte_mbuf.h>
|
||||
#include <rte_mbuf_dyn.h>
|
||||
-#include "rte_ethdev.h"
|
||||
#include "rte_flow_driver.h"
|
||||
#include "rte_flow.h"
|
||||
|
||||
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
|
||||
index 039d09e0a9..d560cc7dcd 100644
|
||||
--- a/lib/ethdev/rte_flow.h
|
||||
+++ b/lib/ethdev/rte_flow.h
|
||||
@@ -38,6 +38,8 @@
|
||||
#include <rte_l2tpv2.h>
|
||||
#include <rte_ppp.h>
|
||||
|
||||
+#include "rte_ethdev.h"
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -2970,23 +2972,6 @@ struct rte_flow_query_count {
|
||||
uint64_t bytes; /**< Number of bytes through this rule [out]. */
|
||||
};
|
||||
|
||||
-/**
|
||||
- * Hash function types.
|
||||
- */
|
||||
-enum rte_eth_hash_function {
|
||||
- /** DEFAULT means driver decides which hash algorithm to pick. */
|
||||
- RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
|
||||
- RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
|
||||
- RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
|
||||
- /**
|
||||
- * Symmetric Toeplitz: src, dst will be replaced by
|
||||
- * xor(src, dst). For the case with src/dst only,
|
||||
- * src or dst address will xor with zero pair.
|
||||
- */
|
||||
- RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
|
||||
- RTE_ETH_HASH_FUNCTION_MAX,
|
||||
-};
|
||||
-
|
||||
/**
|
||||
* RTE_FLOW_ACTION_TYPE_RSS
|
||||
*
|
||||
--
|
||||
2.23.0
|
||||
|
||||
36
0386-net-hns3-report-RSS-hash-algorithms-capability.patch
Normal file
36
0386-net-hns3-report-RSS-hash-algorithms-capability.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 5c2aa37412339dac879a2c945262b840cbc627a2 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:14 +0800
|
||||
Subject: [PATCH 386/394] net/hns3: report RSS hash algorithms capability
|
||||
|
||||
[ upstream commit 36b0b4fdeb64e92ffa8df617e8fdd3ed52923510 ]
|
||||
|
||||
The hns3 driver should reports RSS hash algorithm capability
|
||||
to support updating RSS hash algorithm by
|
||||
rte_eth_dev_rss_hash_update() or rte_eth_dev_configure().
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_common.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
|
||||
index 6b1aeaa41b..7a49f0d11d 100644
|
||||
--- a/drivers/net/hns3/hns3_common.c
|
||||
+++ b/drivers/net/hns3/hns3_common.c
|
||||
@@ -133,6 +133,10 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
|
||||
info->reta_size = hw->rss_ind_tbl_size;
|
||||
info->hash_key_size = hw->rss_key_size;
|
||||
info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT;
|
||||
+ info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) |
|
||||
+ RTE_ETH_HASH_ALGO_CAPA_MASK(TOEPLITZ) |
|
||||
+ RTE_ETH_HASH_ALGO_CAPA_MASK(SIMPLE_XOR) |
|
||||
+ RTE_ETH_HASH_ALGO_CAPA_MASK(SYMMETRIC_TOEPLITZ);
|
||||
|
||||
info->default_rxportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
|
||||
info->default_txportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
From 551ff5a491295b17551d81f5c77a5167abc766fc Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:15 +0800
|
||||
Subject: [PATCH 387/394] net/hns3: support setting and querying RSS hash
|
||||
function
|
||||
|
||||
[ upstream commit 9913a55d37f7a80c143de3c5eb4ba39f266291cb ]
|
||||
|
||||
Support setting and querying RSS hash function by ethdev ops.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rss.c | 47 +++++++++++++++++++++----------------
|
||||
1 file changed, 27 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
|
||||
index eeeca71a5c..15feb26043 100644
|
||||
--- a/drivers/net/hns3/hns3_rss.c
|
||||
+++ b/drivers/net/hns3/hns3_rss.c
|
||||
@@ -646,14 +646,14 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
|
||||
if (ret)
|
||||
goto set_tuple_fail;
|
||||
|
||||
- if (key) {
|
||||
- ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
|
||||
- key, hw->rss_key_size);
|
||||
- if (ret)
|
||||
- goto set_algo_key_fail;
|
||||
- /* Update the shadow RSS key with user specified */
|
||||
+ ret = hns3_update_rss_algo_key(hw, rss_conf->algorithm, key, key_len);
|
||||
+ if (ret != 0)
|
||||
+ goto set_algo_key_fail;
|
||||
+
|
||||
+ if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
|
||||
+ hw->rss_info.hash_algo = hns3_hash_func_map[rss_conf->algorithm];
|
||||
+ if (key != NULL)
|
||||
memcpy(hw->rss_info.key, key, hw->rss_key_size);
|
||||
- }
|
||||
hw->rss_info.rss_hf = rss_hf;
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
|
||||
@@ -769,7 +769,13 @@ int
|
||||
hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
|
||||
struct rte_eth_rss_conf *rss_conf)
|
||||
{
|
||||
+ const uint8_t hash_func_map[] = {
|
||||
+ [HNS3_RSS_HASH_ALGO_TOEPLITZ] = RTE_ETH_HASH_FUNCTION_TOEPLITZ,
|
||||
+ [HNS3_RSS_HASH_ALGO_SIMPLE] = RTE_ETH_HASH_FUNCTION_SIMPLE_XOR,
|
||||
+ [HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP] = RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
|
||||
+ };
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
+ uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
uint8_t hash_algo = 0;
|
||||
int ret;
|
||||
@@ -777,26 +783,27 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
ret = hns3_rss_hash_get_rss_hf(hw, &rss_conf->rss_hf);
|
||||
if (ret != 0) {
|
||||
+ rte_spinlock_unlock(&hw->lock);
|
||||
hns3_err(hw, "obtain hash tuples failed, ret = %d", ret);
|
||||
- goto out;
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_key, hw->rss_key_size);
|
||||
+ if (ret != 0) {
|
||||
+ rte_spinlock_unlock(&hw->lock);
|
||||
+ hns3_err(hw, "obtain hash algo and key failed, ret = %d", ret);
|
||||
+ return ret;
|
||||
}
|
||||
+ rte_spinlock_unlock(&hw->lock);
|
||||
|
||||
- /* Get the RSS Key required by the user */
|
||||
+ /* Get the RSS Key if user required. */
|
||||
if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
|
||||
- ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
|
||||
- hw->rss_key_size);
|
||||
- if (ret != 0) {
|
||||
- hns3_err(hw, "obtain hash algo and key failed, ret = %d",
|
||||
- ret);
|
||||
- goto out;
|
||||
- }
|
||||
+ memcpy(rss_conf->rss_key, rss_key, hw->rss_key_size);
|
||||
rss_conf->rss_key_len = hw->rss_key_size;
|
||||
}
|
||||
+ rss_conf->algorithm = hash_func_map[hash_algo];
|
||||
|
||||
-out:
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
-
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.23.0
|
||||
|
||||
76
0388-app-procinfo-fix-RSS-info.patch
Normal file
76
0388-app-procinfo-fix-RSS-info.patch
Normal file
@ -0,0 +1,76 @@
|
||||
From 0984219ef3fb85833458c14cdd99d9918febb22b Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:16 +0800
|
||||
Subject: [PATCH 388/394] app/procinfo: fix RSS info
|
||||
|
||||
[ upstream commit 33079eccf5c1a99af722fe168d8465f602bc98b2 ]
|
||||
|
||||
Command show-port should show RSS info (rss_key, len and rss_hf),
|
||||
However, the information is shown only when rss_conf.rss_key is not
|
||||
NULL. Since no memory is allocated for rss_conf.rss_key, rss_key
|
||||
will always be NULL and the rss_info will never show. This patch
|
||||
fixes it.
|
||||
|
||||
Fixes: 8a37f37fc243 ("app/procinfo: add --show-port")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
---
|
||||
app/proc-info/main.c | 21 ++++++++++++---------
|
||||
1 file changed, 12 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
|
||||
index 0cc01e3dad..de7c3b4b27 100644
|
||||
--- a/app/proc-info/main.c
|
||||
+++ b/app/proc-info/main.c
|
||||
@@ -132,6 +132,8 @@ struct desc_param {
|
||||
static struct desc_param rx_desc_param;
|
||||
static struct desc_param tx_desc_param;
|
||||
|
||||
+#define RSS_HASH_KEY_SIZE 64
|
||||
+
|
||||
/* display usage */
|
||||
static void
|
||||
proc_info_usage(const char *prgname)
|
||||
@@ -823,6 +825,7 @@ show_port(void)
|
||||
struct rte_eth_fc_conf fc_conf;
|
||||
struct rte_ether_addr mac;
|
||||
struct rte_eth_dev_owner owner;
|
||||
+ uint8_t rss_key[RSS_HASH_KEY_SIZE];
|
||||
|
||||
/* Skip if port is not in mask */
|
||||
if ((enabled_port_mask & (1ul << i)) == 0)
|
||||
@@ -981,17 +984,17 @@ show_port(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
+ rss_conf.rss_key = rss_key;
|
||||
+ rss_conf.rss_key_len = dev_info.hash_key_size;
|
||||
ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
|
||||
if (ret == 0) {
|
||||
- if (rss_conf.rss_key) {
|
||||
- printf(" - RSS\n");
|
||||
- printf("\t -- RSS len %u key (hex):",
|
||||
- rss_conf.rss_key_len);
|
||||
- for (k = 0; k < rss_conf.rss_key_len; k++)
|
||||
- printf(" %x", rss_conf.rss_key[k]);
|
||||
- printf("\t -- hf 0x%"PRIx64"\n",
|
||||
- rss_conf.rss_hf);
|
||||
- }
|
||||
+ printf(" - RSS\n");
|
||||
+ printf("\t -- RSS len %u key (hex):",
|
||||
+ rss_conf.rss_key_len);
|
||||
+ for (k = 0; k < rss_conf.rss_key_len; k++)
|
||||
+ printf(" %x", rss_conf.rss_key[k]);
|
||||
+ printf("\t -- hf 0x%"PRIx64"\n",
|
||||
+ rss_conf.rss_hf);
|
||||
}
|
||||
|
||||
#ifdef RTE_LIB_SECURITY
|
||||
--
|
||||
2.23.0
|
||||
|
||||
59
0389-app-procinfo-adjust-format-of-RSS-info.patch
Normal file
59
0389-app-procinfo-adjust-format-of-RSS-info.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From a70e268e9425c17da66e1063dc6d11a30b0a81bc Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:17 +0800
|
||||
Subject: [PATCH 389/394] app/procinfo: adjust format of RSS info
|
||||
|
||||
[ upstream commit 66d4bacc39fb765051594669c33aab4f5d0f9d6c ]
|
||||
|
||||
This patch splits the length and value of RSS key into two parts,
|
||||
removes spaces between RSS keys, and adds line breaks between RSS
|
||||
key and RSS hf.
|
||||
|
||||
Before the adjustment, RSS info is shown as:
|
||||
- RSS
|
||||
-- RSS len 40 key (hex): 6d 5a 56 da 25 5b e c2 41 67 \
|
||||
25 3d 43 a3 8f b0 d0 ca 2b cb ae 7b 30 b4 77 cb 2d \
|
||||
a3 80 30 f2 c 6a 42 b7 3b be ac 1 fa -- hf 0x0
|
||||
and after:
|
||||
- RSS info
|
||||
-- key len : 40
|
||||
-- key (hex) : 6d5a56da255b0ec24167253d43a38fb0d0c \
|
||||
a2bcbae7b30b477cb2da38030f20c6a42b73bbeac01fa
|
||||
-- hash function : 0x0
|
||||
|
||||
Fixes: 8a37f37fc243 ("app/procinfo: add --show-port")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
app/proc-info/main.c | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
|
||||
index de7c3b4b27..55bfbcaa9c 100644
|
||||
--- a/app/proc-info/main.c
|
||||
+++ b/app/proc-info/main.c
|
||||
@@ -988,12 +988,13 @@ show_port(void)
|
||||
rss_conf.rss_key_len = dev_info.hash_key_size;
|
||||
ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
|
||||
if (ret == 0) {
|
||||
- printf(" - RSS\n");
|
||||
- printf("\t -- RSS len %u key (hex):",
|
||||
+ printf(" - RSS info\n");
|
||||
+ printf("\t -- key len : %u\n",
|
||||
rss_conf.rss_key_len);
|
||||
+ printf("\t -- key (hex) : ");
|
||||
for (k = 0; k < rss_conf.rss_key_len; k++)
|
||||
- printf(" %x", rss_conf.rss_key[k]);
|
||||
- printf("\t -- hf 0x%"PRIx64"\n",
|
||||
+ printf("%02x", rss_conf.rss_key[k]);
|
||||
+ printf("\n\t -- hash function : 0x%"PRIx64"\n",
|
||||
rss_conf.rss_hf);
|
||||
}
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
284
0390-ethdev-get-RSS-algorithm-names.patch
Normal file
284
0390-ethdev-get-RSS-algorithm-names.patch
Normal file
@ -0,0 +1,284 @@
|
||||
From 811392906150ad09a2502b1d40f87cf48faec751 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:18 +0800
|
||||
Subject: [PATCH 390/394] ethdev: get RSS algorithm names
|
||||
|
||||
[ upstream commit 92628e2b04923c098128acdb173ab25953162ef8 ]
|
||||
|
||||
This patch adds new API rte_eth_dev_rss_algo_name() to get
|
||||
name of a RSS algorithm and document it.
|
||||
|
||||
Example:
|
||||
|
||||
testpmd> show port 0 rss-hash algorithm
|
||||
RSS algorithm:
|
||||
toeplitz
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
---
|
||||
app/test-pmd/cmdline.c | 29 +++++++++++++++++----
|
||||
app/test-pmd/config.c | 29 +++++++--------------
|
||||
app/test-pmd/testpmd.h | 2 +-
|
||||
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +--
|
||||
lib/ethdev/rte_ethdev.c | 25 ++++++++++++++++++
|
||||
lib/ethdev/rte_ethdev.h | 16 ++++++++++++
|
||||
lib/ethdev/version.map | 3 +++
|
||||
7 files changed, 81 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
|
||||
index 49152ec348..cdf943162b 100644
|
||||
--- a/app/test-pmd/cmdline.c
|
||||
+++ b/app/test-pmd/cmdline.c
|
||||
@@ -174,8 +174,8 @@ static void cmd_help_long_parsed(void *parsed_result,
|
||||
" by masks on port X. size is used to indicate the"
|
||||
" hardware supported reta size\n\n"
|
||||
|
||||
- "show port (port_id) rss-hash [key]\n"
|
||||
- " Display the RSS hash functions and RSS hash key of port\n\n"
|
||||
+ "show port (port_id) rss-hash [key | algorithm]\n"
|
||||
+ " Display the RSS hash functions, RSS hash key and RSS hash algorithms of port\n\n"
|
||||
|
||||
"clear port (info|stats|xstats|fdir) (port_id|all)\n"
|
||||
" Clear information for port_id, or all.\n\n"
|
||||
@@ -3150,15 +3150,17 @@ struct cmd_showport_rss_hash {
|
||||
cmdline_fixed_string_t rss_hash;
|
||||
cmdline_fixed_string_t rss_type;
|
||||
cmdline_fixed_string_t key; /* optional argument */
|
||||
+ cmdline_fixed_string_t algorithm; /* optional argument */
|
||||
};
|
||||
|
||||
static void cmd_showport_rss_hash_parsed(void *parsed_result,
|
||||
__rte_unused struct cmdline *cl,
|
||||
- void *show_rss_key)
|
||||
+ __rte_unused void *data)
|
||||
{
|
||||
struct cmd_showport_rss_hash *res = parsed_result;
|
||||
|
||||
- port_rss_hash_conf_show(res->port_id, show_rss_key != NULL);
|
||||
+ port_rss_hash_conf_show(res->port_id,
|
||||
+ !strcmp(res->key, "key"), !strcmp(res->algorithm, "algorithm"));
|
||||
}
|
||||
|
||||
cmdline_parse_token_string_t cmd_showport_rss_hash_show =
|
||||
@@ -3173,6 +3175,8 @@ cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash =
|
||||
"rss-hash");
|
||||
cmdline_parse_token_string_t cmd_showport_rss_hash_rss_key =
|
||||
TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, key, "key");
|
||||
+static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_algo =
|
||||
+ TOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, algorithm, "algorithm");
|
||||
|
||||
cmdline_parse_inst_t cmd_showport_rss_hash = {
|
||||
.f = cmd_showport_rss_hash_parsed,
|
||||
@@ -3189,7 +3193,7 @@ cmdline_parse_inst_t cmd_showport_rss_hash = {
|
||||
|
||||
cmdline_parse_inst_t cmd_showport_rss_hash_key = {
|
||||
.f = cmd_showport_rss_hash_parsed,
|
||||
- .data = (void *)1,
|
||||
+ .data = NULL,
|
||||
.help_str = "show port <port_id> rss-hash key",
|
||||
.tokens = {
|
||||
(void *)&cmd_showport_rss_hash_show,
|
||||
@@ -3201,6 +3205,20 @@ cmdline_parse_inst_t cmd_showport_rss_hash_key = {
|
||||
},
|
||||
};
|
||||
|
||||
+static cmdline_parse_inst_t cmd_showport_rss_hash_algo = {
|
||||
+ .f = cmd_showport_rss_hash_parsed,
|
||||
+ .data = NULL,
|
||||
+ .help_str = "show port <port_id> rss-hash algorithm",
|
||||
+ .tokens = {
|
||||
+ (void *)&cmd_showport_rss_hash_show,
|
||||
+ (void *)&cmd_showport_rss_hash_port,
|
||||
+ (void *)&cmd_showport_rss_hash_port_id,
|
||||
+ (void *)&cmd_showport_rss_hash_rss_hash,
|
||||
+ (void *)&cmd_showport_rss_hash_rss_algo,
|
||||
+ NULL,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
/* *** Configure DCB *** */
|
||||
struct cmd_config_dcb {
|
||||
cmdline_fixed_string_t port;
|
||||
@@ -17899,6 +17917,7 @@ cmdline_parse_ctx_t main_ctx[] = {
|
||||
(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
|
||||
(cmdline_parse_inst_t *)&cmd_showport_rss_hash,
|
||||
(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,
|
||||
+ (cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo,
|
||||
(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
|
||||
(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,
|
||||
(cmdline_parse_inst_t *)&cmd_dump,
|
||||
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
|
||||
index af00078108..9d7b10548e 100644
|
||||
--- a/app/test-pmd/config.c
|
||||
+++ b/app/test-pmd/config.c
|
||||
@@ -1636,24 +1636,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf)
|
||||
printf(" %d", rss_conf->queue[i]);
|
||||
printf("\n");
|
||||
|
||||
- printf(" function: ");
|
||||
- switch (rss_conf->func) {
|
||||
- case RTE_ETH_HASH_FUNCTION_DEFAULT:
|
||||
- printf("default\n");
|
||||
- break;
|
||||
- case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
|
||||
- printf("toeplitz\n");
|
||||
- break;
|
||||
- case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
|
||||
- printf("simple_xor\n");
|
||||
- break;
|
||||
- case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
|
||||
- printf("symmetric_toeplitz\n");
|
||||
- break;
|
||||
- default:
|
||||
- printf("Unknown function\n");
|
||||
- return;
|
||||
- }
|
||||
+ printf(" function: %s\n", rte_eth_dev_rss_algo_name(rss_conf->func));
|
||||
|
||||
printf(" RSS key:\n");
|
||||
if (rss_conf->key_len == 0) {
|
||||
@@ -3077,7 +3060,7 @@ port_rss_reta_info(portid_t port_id,
|
||||
* key of the port.
|
||||
*/
|
||||
void
|
||||
-port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
|
||||
+port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_algo)
|
||||
{
|
||||
struct rte_eth_rss_conf rss_conf = {0};
|
||||
uint8_t rss_key[RSS_HASH_KEY_LENGTH];
|
||||
@@ -3127,8 +3110,16 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
|
||||
printf("RSS disabled\n");
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ if (show_rss_algo) {
|
||||
+ printf("RSS algorithm:\n %s\n",
|
||||
+ rte_eth_dev_rss_algo_name(rss_conf.algorithm));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
printf("RSS functions:\n");
|
||||
rss_types_display(rss_hf, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
|
||||
+
|
||||
if (!show_rss_key)
|
||||
return;
|
||||
printf("RSS key:\n");
|
||||
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
|
||||
index 30c7177630..d19deeff4a 100644
|
||||
--- a/app/test-pmd/testpmd.h
|
||||
+++ b/app/test-pmd/testpmd.h
|
||||
@@ -1021,7 +1021,7 @@ int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
|
||||
int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
|
||||
uint64_t q_msk);
|
||||
|
||||
-void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
|
||||
+void port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_algo);
|
||||
void port_rss_hash_key_update(portid_t port_id, char rss_type[],
|
||||
uint8_t *hash_key, uint8_t hash_key_len);
|
||||
int rx_queue_id_is_invalid(queueid_t rxq_id);
|
||||
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
|
||||
index 50c45db6f7..a81296d2ba 100644
|
||||
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
|
||||
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
|
||||
@@ -233,9 +233,9 @@ size is used to indicate the hardware supported reta size
|
||||
show port rss-hash
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
-Display the RSS hash functions and RSS hash key of a port::
|
||||
+Display the RSS hash functions and RSS hash key or RSS hash algorithm of a port::
|
||||
|
||||
- testpmd> show port (port_id) rss-hash [key]
|
||||
+ testpmd> show port (port_id) rss-hash [key | algorithm]
|
||||
|
||||
clear port
|
||||
~~~~~~~~~~
|
||||
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
|
||||
index ec06bd3a9c..289fe45e6c 100644
|
||||
--- a/lib/ethdev/rte_ethdev.c
|
||||
+++ b/lib/ethdev/rte_ethdev.c
|
||||
@@ -196,6 +196,17 @@ enum {
|
||||
STAT_QMAP_RX
|
||||
};
|
||||
|
||||
+static const struct {
|
||||
+ enum rte_eth_hash_function algo;
|
||||
+ const char *name;
|
||||
+} rte_eth_dev_rss_algo_names[] = {
|
||||
+ {RTE_ETH_HASH_FUNCTION_DEFAULT, "default"},
|
||||
+ {RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, "simple_xor"},
|
||||
+ {RTE_ETH_HASH_FUNCTION_TOEPLITZ, "toeplitz"},
|
||||
+ {RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ, "symmetric_toeplitz"},
|
||||
+ {RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT, "symmetric_toeplitz_sort"},
|
||||
+};
|
||||
+
|
||||
int
|
||||
rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)
|
||||
{
|
||||
@@ -4288,6 +4299,20 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
|
||||
rss_conf));
|
||||
}
|
||||
|
||||
+const char *
|
||||
+rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo)
|
||||
+{
|
||||
+ const char *name = "Unknown function";
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < RTE_DIM(rte_eth_dev_rss_algo_names); i++) {
|
||||
+ if (rss_algo == rte_eth_dev_rss_algo_names[i].algo)
|
||||
+ return rte_eth_dev_rss_algo_names[i].name;
|
||||
+ }
|
||||
+
|
||||
+ return name;
|
||||
+}
|
||||
+
|
||||
int
|
||||
rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
|
||||
struct rte_eth_udp_tunnel *udp_tunnel)
|
||||
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
|
||||
index 911b9e03ab..09a546a48b 100644
|
||||
--- a/lib/ethdev/rte_ethdev.h
|
||||
+++ b/lib/ethdev/rte_ethdev.h
|
||||
@@ -4396,6 +4396,22 @@ int
|
||||
rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
|
||||
struct rte_eth_rss_conf *rss_conf);
|
||||
|
||||
+/**
|
||||
+ * @warning
|
||||
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
|
||||
+ *
|
||||
+ * Get the name of RSS hash algorithm.
|
||||
+ *
|
||||
+ * @param rss_algo
|
||||
+ * Hash algorithm.
|
||||
+ *
|
||||
+ * @return
|
||||
+ * Hash algorithm name or 'UNKNOWN' if the rss_algo cannot be recognized.
|
||||
+ */
|
||||
+__rte_experimental
|
||||
+const char *
|
||||
+rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo);
|
||||
+
|
||||
/**
|
||||
* Add UDP tunneling port for a type of tunnel.
|
||||
*
|
||||
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
|
||||
index f593f64ea9..1867016054 100644
|
||||
--- a/lib/ethdev/version.map
|
||||
+++ b/lib/ethdev/version.map
|
||||
@@ -265,6 +265,9 @@ EXPERIMENTAL {
|
||||
rte_eth_tx_descriptor_dump;
|
||||
rte_eth_dev_is_valid_rxq;
|
||||
rte_eth_dev_is_valid_txq;
|
||||
+
|
||||
+ # added in 23.11
|
||||
+ rte_eth_dev_rss_algo_name;
|
||||
};
|
||||
|
||||
INTERNAL {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
36
0391-app-procinfo-show-RSS-hash-algorithm.patch
Normal file
36
0391-app-procinfo-show-RSS-hash-algorithm.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From fdf0043acae2d1df5aff874133c92ff224ad3de1 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Hai <haijie1@huawei.com>
|
||||
Date: Thu, 2 Nov 2023 16:20:19 +0800
|
||||
Subject: [PATCH 391/394] app/procinfo: show RSS hash algorithm
|
||||
|
||||
[ upstream commit 130c5a4ba0ca06c921f8a5b52b43e469250a3ea8 ]
|
||||
|
||||
Display RSS hash algorithm with command show-port as below.
|
||||
- RSS info
|
||||
-- hash algorithm : toeplitz
|
||||
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
|
||||
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
app/proc-info/main.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
|
||||
index 55bfbcaa9c..d2f78278d5 100644
|
||||
--- a/app/proc-info/main.c
|
||||
+++ b/app/proc-info/main.c
|
||||
@@ -996,6 +996,8 @@ show_port(void)
|
||||
printf("%02x", rss_conf.rss_key[k]);
|
||||
printf("\n\t -- hash function : 0x%"PRIx64"\n",
|
||||
rss_conf.rss_hf);
|
||||
+ printf("\t -- hash algorithm : %s\n",
|
||||
+ rte_eth_dev_rss_algo_name(rss_conf.algorithm));
|
||||
}
|
||||
|
||||
#ifdef RTE_LIB_SECURITY
|
||||
--
|
||||
2.23.0
|
||||
|
||||
102
0392-ethdev-add-maximum-Rx-buffer-size.patch
Normal file
102
0392-ethdev-add-maximum-Rx-buffer-size.patch
Normal file
@ -0,0 +1,102 @@
|
||||
From 5e315791df0bcdaa3383e14e7b93a5297fe0b49e Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 3 Nov 2023 18:27:57 +0800
|
||||
Subject: [PATCH 392/394] ethdev: add maximum Rx buffer size
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ upstream commit 75c7849a9dcca356985fdb87f2d11cae135dfb1a ]
|
||||
|
||||
The "min_rx_bufsize" in struct rte_eth_dev_info stands for the minimum
|
||||
Rx buffer size supported by hardware. Actually, some engines also have
|
||||
the maximum Rx buffer specification, like, hns3, i40e and so on. If mbuf
|
||||
data room size in mempool is greater then the maximum Rx buffer size
|
||||
per descriptor supported by HW, the data size application used in each
|
||||
mbuf is just as much as the maximum Rx buffer size instead of the whole
|
||||
data room size.
|
||||
|
||||
So introduce maximum Rx buffer size which is not enforced just to
|
||||
report user to avoid memory waste. In addition, fix the comment for
|
||||
the "min_rx_bufsize" to make it be more specific.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Acked-by: Morten Brørup <mb@smartsharesystems.com>
|
||||
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
---
|
||||
app/test-pmd/config.c | 2 ++
|
||||
lib/ethdev/rte_ethdev.c | 8 ++++++++
|
||||
lib/ethdev/rte_ethdev.h | 10 +++++++++-
|
||||
3 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
|
||||
index 9d7b10548e..fbb0cabf3d 100644
|
||||
--- a/app/test-pmd/config.c
|
||||
+++ b/app/test-pmd/config.c
|
||||
@@ -848,6 +848,8 @@ port_infos_display(portid_t port_id)
|
||||
}
|
||||
|
||||
printf("Minimum size of RX buffer: %u\n", dev_info.min_rx_bufsize);
|
||||
+ if (dev_info.max_rx_bufsize != UINT32_MAX)
|
||||
+ printf("Maximum size of RX buffer: %u\n", dev_info.max_rx_bufsize);
|
||||
printf("Maximum configurable length of RX packet: %u\n",
|
||||
dev_info.max_rx_pktlen);
|
||||
printf("Maximum configurable size of LRO aggregated packet: %u\n",
|
||||
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
|
||||
index 289fe45e6c..4702515240 100644
|
||||
--- a/lib/ethdev/rte_ethdev.c
|
||||
+++ b/lib/ethdev/rte_ethdev.c
|
||||
@@ -2126,6 +2126,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
|
||||
struct rte_eth_dev *dev;
|
||||
struct rte_eth_dev_info dev_info;
|
||||
struct rte_eth_rxconf local_conf;
|
||||
+ uint32_t buf_data_size;
|
||||
|
||||
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
|
||||
dev = &rte_eth_devices[port_id];
|
||||
@@ -2162,6 +2163,12 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
|
||||
return -ENOSPC;
|
||||
}
|
||||
mbp_buf_size = rte_pktmbuf_data_room_size(mp);
|
||||
+ buf_data_size = mbp_buf_size - RTE_PKTMBUF_HEADROOM;
|
||||
+ if (buf_data_size > dev_info.max_rx_bufsize)
|
||||
+ RTE_ETHDEV_LOG(DEBUG,
|
||||
+ "For port_id=%u, the mbuf data buffer size (%u) is bigger than "
|
||||
+ "max buffer size (%u) device can utilize, so mbuf size can be reduced.\n",
|
||||
+ port_id, buf_data_size, dev_info.max_rx_bufsize);
|
||||
if (mbp_buf_size < dev_info.min_rx_bufsize +
|
||||
RTE_PKTMBUF_HEADROOM) {
|
||||
RTE_ETHDEV_LOG(ERR,
|
||||
@@ -3531,6 +3538,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
|
||||
RTE_ETHER_CRC_LEN;
|
||||
dev_info->max_mtu = UINT16_MAX;
|
||||
dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
|
||||
+ dev_info->max_rx_bufsize = UINT32_MAX;
|
||||
|
||||
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
|
||||
diag = (*dev->dev_ops->dev_infos_get)(dev, dev_info);
|
||||
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
|
||||
index 09a546a48b..2880a55890 100644
|
||||
--- a/lib/ethdev/rte_ethdev.h
|
||||
+++ b/lib/ethdev/rte_ethdev.h
|
||||
@@ -1825,7 +1825,15 @@ struct rte_eth_dev_info {
|
||||
uint16_t min_mtu; /**< Minimum MTU allowed */
|
||||
uint16_t max_mtu; /**< Maximum MTU allowed */
|
||||
const uint32_t *dev_flags; /**< Device flags */
|
||||
- uint32_t min_rx_bufsize; /**< Minimum size of Rx buffer. */
|
||||
+ /** Minimum Rx buffer size per descriptor supported by HW. */
|
||||
+ uint32_t min_rx_bufsize;
|
||||
+ /**
|
||||
+ * Maximum Rx buffer size per descriptor supported by HW.
|
||||
+ * The value is not enforced, information only to application to
|
||||
+ * optimize mbuf size.
|
||||
+ * Its value is UINT32_MAX when not specified by the driver.
|
||||
+ */
|
||||
+ uint32_t max_rx_bufsize;
|
||||
uint32_t max_rx_pktlen; /**< Maximum configurable length of Rx pkt. */
|
||||
/** Maximum configurable size of LRO aggregated packet. */
|
||||
uint32_t max_lro_pkt_size;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
30
0393-net-hns3-report-maximum-buffer-size.patch
Normal file
30
0393-net-hns3-report-maximum-buffer-size.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 51ce4165992b99416a89951c403b9ed1907ff67c Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 3 Nov 2023 18:27:59 +0800
|
||||
Subject: [PATCH 393/394] net/hns3: report maximum buffer size
|
||||
|
||||
[ upstream commit a276af95fa52ea4e97d173f6f0afe6cdec6949ba ]
|
||||
|
||||
This patch reports the maximum buffer size hardware supported.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_common.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
|
||||
index 7a49f0d11d..0d6b2c65af 100644
|
||||
--- a/drivers/net/hns3/hns3_common.c
|
||||
+++ b/drivers/net/hns3/hns3_common.c
|
||||
@@ -59,6 +59,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
|
||||
info->max_tx_queues = hw->tqps_num;
|
||||
info->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */
|
||||
info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
|
||||
+ info->max_rx_bufsize = HNS3_MAX_BD_BUF_SIZE;
|
||||
info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
|
||||
info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
|
||||
info->rx_offload_capa = (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
|
||||
--
|
||||
2.23.0
|
||||
|
||||
250
0394-net-hns3-fix-mailbox-sync.patch
Normal file
250
0394-net-hns3-fix-mailbox-sync.patch
Normal file
@ -0,0 +1,250 @@
|
||||
From fc4a8dfe7b91702f2930957840a51796ffb12c2d Mon Sep 17 00:00:00 2001
|
||||
From: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Date: Sat, 11 Nov 2023 09:59:14 +0800
|
||||
Subject: [PATCH 394/394] net/hns3: fix mailbox sync
|
||||
|
||||
[ upstream commit be3590f54d0e415c23d4ed6ea55d967139c3ad10 ]
|
||||
|
||||
Currently, hns3 VF driver uses the following points to match
|
||||
the response and request message for the mailbox synchronous
|
||||
message between VF and PF.
|
||||
1. req_msg_data which is consist of message code and subcode,
|
||||
is used to match request and response.
|
||||
2. head means the number of send success for VF.
|
||||
3. tail means the number of receive success for VF.
|
||||
4. lost means the number of send timeout for VF.
|
||||
And 'head', 'tail' and 'lost' are dynamically updated during
|
||||
the communication.
|
||||
|
||||
Now there is a issue that all sync mailbox message will
|
||||
send failure forever at the flollowing case:
|
||||
1. VF sends the message A
|
||||
then head=UINT32_MAX-1, tail=UINT32_MAX-3, lost=2.
|
||||
2. VF sends the message B
|
||||
then head=UINT32_MAX, tail=UINT32_MAX-2, lost=2.
|
||||
3. VF sends the message C, the message will be timeout because
|
||||
it can't get the response within 500ms.
|
||||
then head=0, tail=0, lost=2
|
||||
note: tail is assigned to head if tail > head according to
|
||||
current code logic. From now on, all subsequent sync milbox
|
||||
messages fail to be sent.
|
||||
|
||||
It's very complicated to use the fields 'lost','tail','head'.
|
||||
The code and subcode of the request sync mailbox are used as the
|
||||
matching code of the message, which is used to match the response
|
||||
message for receiving the synchronization response.
|
||||
|
||||
This patch drops these fields and uses the following solution
|
||||
to solve this issue:
|
||||
In the handling response message process, using the req_msg_data
|
||||
of the request and response message to judge whether the sync
|
||||
mailbox message has been received.
|
||||
|
||||
Fixes: 463e748964f5 ("net/hns3: support mailbox")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
|
||||
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
||||
Acked-by: Huisong Li <lihuisong@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_cmd.c | 3 --
|
||||
drivers/net/hns3/hns3_mbx.c | 81 ++++++-------------------------------
|
||||
drivers/net/hns3/hns3_mbx.h | 10 -----
|
||||
3 files changed, 13 insertions(+), 81 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
|
||||
index a5c4c11dc8..2c1664485b 100644
|
||||
--- a/drivers/net/hns3/hns3_cmd.c
|
||||
+++ b/drivers/net/hns3/hns3_cmd.c
|
||||
@@ -731,9 +731,6 @@ hns3_cmd_init(struct hns3_hw *hw)
|
||||
hw->cmq.csq.next_to_use = 0;
|
||||
hw->cmq.crq.next_to_clean = 0;
|
||||
hw->cmq.crq.next_to_use = 0;
|
||||
- hw->mbx_resp.head = 0;
|
||||
- hw->mbx_resp.tail = 0;
|
||||
- hw->mbx_resp.lost = 0;
|
||||
hns3_cmd_init_regs(hw);
|
||||
|
||||
rte_spinlock_unlock(&hw->cmq.crq.lock);
|
||||
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
|
||||
index 8e0a58aa02..f1743c195e 100644
|
||||
--- a/drivers/net/hns3/hns3_mbx.c
|
||||
+++ b/drivers/net/hns3/hns3_mbx.c
|
||||
@@ -40,23 +40,6 @@ hns3_resp_to_errno(uint16_t resp_code)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
-static void
|
||||
-hns3_mbx_proc_timeout(struct hns3_hw *hw, uint16_t code, uint16_t subcode)
|
||||
-{
|
||||
- if (hw->mbx_resp.matching_scheme ==
|
||||
- HNS3_MBX_RESP_MATCHING_SCHEME_OF_ORIGINAL) {
|
||||
- hw->mbx_resp.lost++;
|
||||
- hns3_err(hw,
|
||||
- "VF could not get mbx(%u,%u) head(%u) tail(%u) "
|
||||
- "lost(%u) from PF",
|
||||
- code, subcode, hw->mbx_resp.head, hw->mbx_resp.tail,
|
||||
- hw->mbx_resp.lost);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- hns3_err(hw, "VF could not get mbx(%u,%u) from PF", code, subcode);
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3_get_mbx_resp(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
|
||||
uint8_t *resp_data, uint16_t resp_len)
|
||||
@@ -67,7 +50,6 @@ hns3_get_mbx_resp(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
|
||||
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
struct hns3_mbx_resp_status *mbx_resp;
|
||||
uint32_t wait_time = 0;
|
||||
- bool received;
|
||||
|
||||
if (resp_len > HNS3_MBX_MAX_RESP_DATA_SIZE) {
|
||||
hns3_err(hw, "VF mbx response len(=%u) exceeds maximum(=%d)",
|
||||
@@ -93,20 +75,14 @@ hns3_get_mbx_resp(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
|
||||
hns3_dev_handle_mbx_msg(hw);
|
||||
rte_delay_us(HNS3_WAIT_RESP_US);
|
||||
|
||||
- if (hw->mbx_resp.matching_scheme ==
|
||||
- HNS3_MBX_RESP_MATCHING_SCHEME_OF_ORIGINAL)
|
||||
- received = (hw->mbx_resp.head ==
|
||||
- hw->mbx_resp.tail + hw->mbx_resp.lost);
|
||||
- else
|
||||
- received = hw->mbx_resp.received_match_resp;
|
||||
- if (received)
|
||||
+ if (hw->mbx_resp.received_match_resp)
|
||||
break;
|
||||
|
||||
wait_time += HNS3_WAIT_RESP_US;
|
||||
}
|
||||
hw->mbx_resp.req_msg_data = 0;
|
||||
if (wait_time >= mbx_time_limit) {
|
||||
- hns3_mbx_proc_timeout(hw, code, subcode);
|
||||
+ hns3_err(hw, "VF could not get mbx(%u,%u) from PF", code, subcode);
|
||||
return -ETIME;
|
||||
}
|
||||
rte_io_rmb();
|
||||
@@ -132,7 +108,6 @@ hns3_mbx_prepare_resp(struct hns3_hw *hw, uint16_t code, uint16_t subcode)
|
||||
* we get the exact scheme which is used.
|
||||
*/
|
||||
hw->mbx_resp.req_msg_data = (uint32_t)code << 16 | subcode;
|
||||
- hw->mbx_resp.head++;
|
||||
|
||||
/* Update match_id and ensure the value of match_id is not zero */
|
||||
hw->mbx_resp.match_id++;
|
||||
@@ -185,7 +160,6 @@ hns3_send_mbx_msg(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
|
||||
req->match_id = hw->mbx_resp.match_id;
|
||||
ret = hns3_cmd_send(hw, &desc, 1);
|
||||
if (ret) {
|
||||
- hw->mbx_resp.head--;
|
||||
rte_spinlock_unlock(&hw->mbx_resp.lock);
|
||||
hns3_err(hw, "VF failed(=%d) to send mbx message to PF",
|
||||
ret);
|
||||
@@ -254,41 +228,10 @@ hns3_handle_asserting_reset(struct hns3_hw *hw,
|
||||
hns3_schedule_reset(HNS3_DEV_HW_TO_ADAPTER(hw));
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Case1: receive response after timeout, req_msg_data
|
||||
- * is 0, not equal resp_msg, do lost--
|
||||
- * Case2: receive last response during new send_mbx_msg,
|
||||
- * req_msg_data is different with resp_msg, let
|
||||
- * lost--, continue to wait for response.
|
||||
- */
|
||||
-static void
|
||||
-hns3_update_resp_position(struct hns3_hw *hw, uint32_t resp_msg)
|
||||
-{
|
||||
- struct hns3_mbx_resp_status *resp = &hw->mbx_resp;
|
||||
- uint32_t tail = resp->tail + 1;
|
||||
-
|
||||
- if (tail > resp->head)
|
||||
- tail = resp->head;
|
||||
- if (resp->req_msg_data != resp_msg) {
|
||||
- if (resp->lost)
|
||||
- resp->lost--;
|
||||
- hns3_warn(hw, "Received a mismatched response req_msg(%x) "
|
||||
- "resp_msg(%x) head(%u) tail(%u) lost(%u)",
|
||||
- resp->req_msg_data, resp_msg, resp->head, tail,
|
||||
- resp->lost);
|
||||
- } else if (tail + resp->lost > resp->head) {
|
||||
- resp->lost--;
|
||||
- hns3_warn(hw, "Received a new response again resp_msg(%x) "
|
||||
- "head(%u) tail(%u) lost(%u)", resp_msg,
|
||||
- resp->head, tail, resp->lost);
|
||||
- }
|
||||
- rte_io_wmb();
|
||||
- resp->tail = tail;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
hns3_handle_mbx_response(struct hns3_hw *hw, struct hns3_mbx_pf_to_vf_cmd *req)
|
||||
{
|
||||
+#define HNS3_MBX_RESP_CODE_OFFSET 16
|
||||
struct hns3_mbx_resp_status *resp = &hw->mbx_resp;
|
||||
uint32_t msg_data;
|
||||
|
||||
@@ -298,12 +241,6 @@ hns3_handle_mbx_response(struct hns3_hw *hw, struct hns3_mbx_pf_to_vf_cmd *req)
|
||||
* match_id to its response. So VF could use the match_id
|
||||
* to match the request.
|
||||
*/
|
||||
- if (resp->matching_scheme !=
|
||||
- HNS3_MBX_RESP_MATCHING_SCHEME_OF_MATCH_ID) {
|
||||
- resp->matching_scheme =
|
||||
- HNS3_MBX_RESP_MATCHING_SCHEME_OF_MATCH_ID;
|
||||
- hns3_info(hw, "detect mailbox support match id!");
|
||||
- }
|
||||
if (req->match_id == resp->match_id) {
|
||||
resp->resp_status = hns3_resp_to_errno(req->msg[3]);
|
||||
memcpy(resp->additional_info, &req->msg[4],
|
||||
@@ -319,11 +256,19 @@ hns3_handle_mbx_response(struct hns3_hw *hw, struct hns3_mbx_pf_to_vf_cmd *req)
|
||||
* support copy request's match_id to its response. So VF follows the
|
||||
* original scheme to process.
|
||||
*/
|
||||
+ msg_data = (uint32_t)req->msg[1] << HNS3_MBX_RESP_CODE_OFFSET | req->msg[2];
|
||||
+ if (resp->req_msg_data != msg_data) {
|
||||
+ hns3_warn(hw,
|
||||
+ "received response tag (%u) is mismatched with requested tag (%u)",
|
||||
+ msg_data, resp->req_msg_data);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
resp->resp_status = hns3_resp_to_errno(req->msg[3]);
|
||||
memcpy(resp->additional_info, &req->msg[4],
|
||||
HNS3_MBX_MAX_RESP_DATA_SIZE);
|
||||
- msg_data = (uint32_t)req->msg[1] << 16 | req->msg[2];
|
||||
- hns3_update_resp_position(hw, msg_data);
|
||||
+ rte_io_wmb();
|
||||
+ resp->received_match_resp = true;
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
|
||||
index c378783c6c..4a328802b9 100644
|
||||
--- a/drivers/net/hns3/hns3_mbx.h
|
||||
+++ b/drivers/net/hns3/hns3_mbx.h
|
||||
@@ -93,21 +93,11 @@ enum hns3_mbx_link_fail_subcode {
|
||||
#define HNS3_MBX_MAX_RESP_DATA_SIZE 8
|
||||
#define HNS3_MBX_DEF_TIME_LIMIT_MS 500
|
||||
|
||||
-enum {
|
||||
- HNS3_MBX_RESP_MATCHING_SCHEME_OF_ORIGINAL = 0,
|
||||
- HNS3_MBX_RESP_MATCHING_SCHEME_OF_MATCH_ID
|
||||
-};
|
||||
-
|
||||
struct hns3_mbx_resp_status {
|
||||
rte_spinlock_t lock; /* protects against contending sync cmd resp */
|
||||
|
||||
- uint8_t matching_scheme;
|
||||
-
|
||||
/* The following fields used in the matching scheme for original */
|
||||
uint32_t req_msg_data;
|
||||
- uint32_t head;
|
||||
- uint32_t tail;
|
||||
- uint32_t lost;
|
||||
|
||||
/* The following fields used in the matching scheme for match_id */
|
||||
uint16_t match_id;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
61
dpdk.spec
61
dpdk.spec
@ -1,6 +1,6 @@
|
||||
Name: dpdk
|
||||
Version: 21.11
|
||||
Release: 58
|
||||
Release: 59
|
||||
Packager: packaging@6wind.com
|
||||
URL: http://dpdk.org
|
||||
%global source_version 21.11
|
||||
@ -393,6 +393,34 @@ Patch6363: 0363-app-testpmd-fix-multicast-address-pool-leak.patch
|
||||
Patch6364: 0364-app-testpmd-fix-help-string.patch
|
||||
Patch6365: 0365-app-testpmd-add-command-to-flush-multicast-MAC-addre.patch
|
||||
Patch6366: 0366-maintainers-update-for-hns3-driver.patch
|
||||
Patch6367: 0367-telemetry-fix-repeat-display-when-callback-don-t-init-dict.patch
|
||||
Patch6368: 0368-net-hns3-fix-build-warning.patch
|
||||
Patch6369: 0369-net-hns3-fix-typo-in-function-name.patch
|
||||
Patch6370: 0370-net-hns3-fix-unchecked-Rx-free-threshold.patch
|
||||
Patch6371: 0371-net-hns3-fix-crash-for-NEON-and-SVE.patch
|
||||
Patch6372: 0372-net-hns3-fix-double-stats-for-IMP-and-global-reset.patch
|
||||
Patch6373: 0373-net-hns3-remove-reset-log-in-secondary.patch
|
||||
Patch6374: 0374-net-hns3-fix-multiple-reset-detected-log.patch
|
||||
Patch6375: 0375-net-hns3-fix-IMP-or-global-reset.patch
|
||||
Patch6376: 0376-net-hns3-refactor-interrupt-state-query.patch
|
||||
Patch6377: 0377-app-testpmd-ease-configuring-all-offloads.patch
|
||||
Patch6378: 0378-net-hns3-fix-setting-DCB-capability.patch
|
||||
Patch6379: 0379-net-hns3-fix-LRO-offload-to-report.patch
|
||||
Patch6380: 0380-net-hns3-fix-some-return-values.patch
|
||||
Patch6381: 0381-net-hns3-fix-some-error-logs.patch
|
||||
Patch6382: 0382-net-hns3-keep-set-get-algo-key-functions-local.patch
|
||||
Patch6383: 0383-net-hns3-fix-uninitialized-hash-algo-value.patch
|
||||
Patch6384: 0384-ethdev-clarify-RSS-related-fields-usage.patch
|
||||
Patch6385: 0385-ethdev-set-and-query-RSS-hash-algorithm.patch
|
||||
Patch6386: 0386-net-hns3-report-RSS-hash-algorithms-capability.patch
|
||||
Patch6387: 0387-net-hns3-support-setting-and-querying-RSS-hash-function.patch
|
||||
Patch6388: 0388-app-procinfo-fix-RSS-info.patch
|
||||
Patch6389: 0389-app-procinfo-adjust-format-of-RSS-info.patch
|
||||
Patch6390: 0390-ethdev-get-RSS-algorithm-names.patch
|
||||
Patch6391: 0391-app-procinfo-show-RSS-hash-algorithm.patch
|
||||
Patch6392: 0392-ethdev-add-maximum-Rx-buffer-size.patch
|
||||
Patch6393: 0393-net-hns3-report-maximum-buffer-size.patch
|
||||
Patch6394: 0394-net-hns3-fix-mailbox-sync.patch
|
||||
|
||||
Patch1000: 1000-add-sw_64-support-not-upstream-modified.patch
|
||||
Patch1001: 1001-add-sw_64-support-not-upstream-new.patch
|
||||
@ -551,6 +579,37 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko
|
||||
/usr/sbin/depmod
|
||||
|
||||
%changelog
|
||||
* Mon Nov 20 2023 huangdengdui <huangdengui@huawei.com> - 21.11-59
|
||||
Sync some patchs from upstreaming and modifies are as follow:
|
||||
- net/hns3: fix mailbox sync
|
||||
- net/hns3: report maximum buffer size
|
||||
- ethdev: add maximum Rx buffer size
|
||||
- app/procinfo: show RSS hash algorithm
|
||||
- ethdev: get RSS algorithm names
|
||||
- app/procinfo: adjust format of RSS info
|
||||
- app/procinfo: fix RSS info
|
||||
- net/hns3: support setting and querying RSS hash function
|
||||
- net/hns3: report RSS hash algorithms capability
|
||||
- ethdev: set and query RSS hash algorithm
|
||||
- ethdev: clarify RSS related fields usage
|
||||
- net/hns3: fix uninitialized hash algo value
|
||||
- net/hns3: keep set/get algo key functions local
|
||||
- net/hns3: fix some error logs
|
||||
- net/hns3: fix some return values
|
||||
- net/hns3: fix LRO offload to report
|
||||
- net/hns3: fix setting DCB capability
|
||||
- app/testpmd: ease configuring all offloads
|
||||
- net/hns3: refactor interrupt state query
|
||||
- net/hns3: fix IMP or global reset
|
||||
- net/hns3: fix multiple reset detected log
|
||||
- net/hns3: remove reset log in secondary
|
||||
- net/hns3: fix double stats for IMP and global reset
|
||||
- net/hns3: fix crash for NEON and SVE
|
||||
- net/hns3: fix unchecked Rx free threshold
|
||||
- net/hns3: fix typo in function name
|
||||
- net/hns3: fix build warning
|
||||
- telemetry: fix repeat display when callback don't init dict
|
||||
|
||||
* Fri Oct 27 2023 huangdengdui <huangdengui@huawei.com> - 21.11-58
|
||||
Sync some patchs from upstreaming and modifies are as follow:
|
||||
- maintainers: update for hns3 driver
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user