dpdk/0185-app-testpmd-check-DCB-info-support-for-configuration.patch
speech_white 3a8995b1ad Update DPDK baseline version
Update DPDK version from 19.11 to 20.11 and also support
hns3 PMD for Kunpeng 920 and Kunpeng 930.

Signed-off-by: speech_white <humin29@huawei.com>
2021-06-28 00:52:34 +00:00

49 lines
1.5 KiB
Diff

From f53ebd40c6c205fc06fab74a0f9456551a8656c1 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Wed, 28 Apr 2021 14:40:43 +0800
Subject: [PATCH 185/189] app/testpmd: check DCB info support for configuration
Currently, '.get_dcb_info' must be supported for the port doing DCB
test, or all information in 'rte_eth_dcb_info' are zero. It should be
prevented when user run cmd "port config 0 dcb vt off 4 pfc off".
This patch adds the check for support of reporting dcb info.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
app/test-pmd/cmdline.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 59c4f7e..40a6871 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -3247,6 +3247,7 @@ cmd_config_dcb_parsed(void *parsed_result,
__rte_unused void *data)
{
struct cmd_config_dcb *res = parsed_result;
+ struct rte_eth_dcb_info dcb_info;
portid_t port_id = res->port_id;
struct rte_port *port;
uint8_t pfc_en;
@@ -3269,6 +3270,14 @@ cmd_config_dcb_parsed(void *parsed_result,
printf("nb_cores shouldn't be less than number of TCs.\n");
return;
}
+
+ /* Check whether the port supports the report of DCB info. */
+ ret = rte_eth_dev_get_dcb_info(port_id, &dcb_info);
+ if (ret == -ENOTSUP) {
+ printf("rte_eth_dev_get_dcb_info not supported.\n");
+ return;
+ }
+
if (!strncmp(res->pfc_en, "on", 2))
pfc_en = 1;
else
--
2.7.4