app/testpmd: retain all original dev conf when config DCB
authorHuisong Li <lihuisong@huawei.com>
Mon, 11 Oct 2021 09:12:46 +0000 (17:12 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 Oct 2021 15:26:30 +0000 (17:26 +0200)
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

index eec4f1b..12a0db8 100644 (file)
@@ -3729,10 +3729,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);