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 BD22CA034F; Mon, 11 Oct 2021 11:14:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A935D410F0; Mon, 11 Oct 2021 11:14:32 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 6BE64410E5 for ; Mon, 11 Oct 2021 11:14:31 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HSY0W2PYjzbksk for ; Mon, 11 Oct 2021 17:10:03 +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; Mon, 11 Oct 2021 17:14:29 +0800 From: "Min Hu (Connor)" To: CC: , Date: Mon, 11 Oct 2021 17:12:46 +0800 Message-ID: <20211011091246.23618-1-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211009084141.58054-1-humin29@huawei.com> References: <20211009084141.58054-1-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] 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 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 Signed-off-by: Min Hu (Connor) Acked-by: Xiaoyun Li --- v2: * fixed commit log. --- 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