dpdk/0404-app-testpmd-check-port-and-queue-Rx-Tx-offloads.patch
Dengdui Huang ab5939fabf sync some bugfix from upstreaming about testpmd and doc
Sync some bugfix from upstreaming about testpmd and doc, modifies
are as follow:
- support set RSS hash algorithm
- ethdev: add new API to get RSS hash algorithm by name
- doc: fix description of RSS features
- doc: fix RSS flow description in hns3 guide
- doc: update features in hns3 guide
- doc: fix hns3 build option about max queue number
- app/testpmd: check port and queue Rx/Tx offloads
- app/testpmd: fix Tx offload command
- app/testpmd: allow offload config for all ports
- app/testpmd: fix tunnel TSO configuration
- app/testpmd: add explicit check for tunnel TSO
- app/testpmd: fix tunnel TSO capability check
- app/testpmd: remove useless check in TSO command

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
(cherry picked from commit 7868d4e3ae469277d4b47241e84c77f53e09423b)
2023-12-09 10:35:25 +08:00

73 lines
2.2 KiB
Diff

From 40bc40d4e92ca9aefaf4e7ea2e859e582ca4559e Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Wed, 15 Nov 2023 18:33:23 +0800
Subject: [PATCH 404/410] app/testpmd: check port and queue Rx/Tx offloads
[ upstream commit f4b0f86a9a0cffc5c5611f4e685bab71c8b47b12 ]
This patch adds the check for port and per queue Rx/Tx offload to avoid
the failure of "port start all" when config a offload driver didn't
support.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
app/test-pmd/cmdline.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b412452948..c641e1f338 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -16238,6 +16238,11 @@ config_port_rx_offload(portid_t port_id, char *name, bool on)
fprintf(stderr, "Unknown offload name: %s\n", name);
return;
}
+ if ((offload & dev_info.rx_offload_capa) == 0) {
+ fprintf(stderr, "Error: port %u doesn't support offload: %s.\n",
+ port_id, name);
+ return;
+ }
}
nb_rx_queues = dev_info.nb_rx_queues;
@@ -16440,6 +16445,11 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
fprintf(stderr, "Unknown offload name: %s\n", res->offload);
return;
}
+ if ((offload & dev_info.rx_queue_offload_capa) == 0) {
+ fprintf(stderr, "Error: port %u doesn't support per queue offload: %s.\n",
+ port_id, res->offload);
+ return;
+ }
}
if (!strcmp(res->on_off, "on"))
@@ -16750,6 +16760,11 @@ config_port_tx_offload(portid_t port_id, char *name, bool on)
fprintf(stderr, "Unknown offload name: %s\n", name);
return;
}
+ if ((offload & dev_info.tx_offload_capa) == 0) {
+ fprintf(stderr, "Error: port %u doesn't support offload: %s.\n",
+ port_id, name);
+ return;
+ }
}
nb_tx_queues = dev_info.nb_tx_queues;
@@ -16956,6 +16971,11 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
fprintf(stderr, "Unknown offload name: %s\n", res->offload);
return;
}
+ if ((offload & dev_info.tx_queue_offload_capa) == 0) {
+ fprintf(stderr, "Error: port %u doesn't support per queue offload: %s.\n",
+ port_id, res->offload);
+ return;
+ }
}
if (!strcmp(res->on_off, "on"))
--
2.33.0