dpdk/0226-app-testpmd-retain-all-original-dev-conf-when-config.patch
speech_white 1c77287214 sync to master branch
sync patches ranges from versoin 9 t0 17 from master branch

Signed-off-by: speech_white <humin29@huawei.com>
2021-12-17 10:45:19 +08:00

41 lines
1.4 KiB
Diff

From 65de76da4d8fc270af6bce73334399d0d3c20fa3 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 11 Oct 2021 17:12:46 +0800
Subject: [PATCH 13/17] app/testpmd: retain all original dev conf when config
DCB
When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
rte_port->dev_conf. But some configurations, such as the link_speed, were
not saved if they were set before configuring DCB.
Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
app/test-pmd/testpmd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3098df6c5..0eaa4852d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3484,10 +3484,8 @@ init_port_dcb_config(portid_t pid,
rte_port = &ports[pid];
- memset(&port_conf, 0, sizeof(struct rte_eth_conf));
-
- port_conf.rxmode = rte_port->dev_conf.rxmode;
- port_conf.txmode = rte_port->dev_conf.txmode;
+ /* retain the original device configuration. */
+ memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf));
/*set configuration of DCB in vt mode and DCB in non-vt mode*/
retval = get_eth_dcb_conf(pid, &port_conf, dcb_mode, num_tcs, pfc_en);
--
2.23.0