From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D486A0C45; Sat, 9 Oct 2021 10:43:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D87B340040; Sat, 9 Oct 2021 10:43:26 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id AEE684003C for ; Sat, 9 Oct 2021 10:43:25 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HRJTS2pYWzQj57; Sat, 9 Oct 2021 16:42:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Sat, 9 Oct 2021 16:43:22 +0800 From: "Min Hu (Connor)" To: CC: , , Date: Sat, 9 Oct 2021 16:41:41 +0800 Message-ID: <20211009084141.58054-1-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Huisong Li 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 it 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 Signed-off-by: Min Hu (Connor) --- 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 eec4f1b81d..12a0db8796 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -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); -- 2.33.0