From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B672BA00BE; Wed, 29 Apr 2020 13:14:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E729A1DA59; Wed, 29 Apr 2020 13:14:03 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id B17121DA4A for ; Wed, 29 Apr 2020 13:13:56 +0200 (CEST) Received: from localhost.localdomain (114.119.4.74) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020 19:13:39 +0800 From: "Wei Hu (Xavier)" To: Date: Wed, 29 Apr 2020 19:13:26 +0800 Message-ID: <20200429111328.64952-5-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200429111328.64952-1-huwei013@chinasoftinc.com> References: <20200429111328.64952-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [114.119.4.74] Subject: [dpdk-dev] [PATCH 4/6] net/hns3: fix VLAN pvid when configuring device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: "Min Hu (Connor)" In current version, when upper level application calls the rte_eth_dev_configure API function, if pvid config is not set of the input parameter which struct type is rte_eth_conf, hns3 pmd driver also sets the VLAN pvid related configuration to hardware, and this is not reasonable. For example, As pvid is set to 100 by rte_eth_dev_set_vlan_pvid, when pvid config is not set in rte_eth_conf, rte_eth_dev_configure will tell driver to delete pvid 0, and that is meaningless. This patch fixes it to ensure that driver does not set VLAN pvid related configuration to hardware when pvid config is not set in rte_eth_conf. Fixes: 411d23b9eafb ("net/hns3: support VLAN") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Signed-off-by: Wei Hu (Xavier) Signed-off-by: Chengchang Tang --- drivers/net/hns3/hns3_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index ae87aa0dd..1fac4f366 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -1059,6 +1059,13 @@ hns3_dev_configure_vlan(struct rte_eth_dev *dev) return ret; } + /* + * If pvid config is not set in rte_eth_conf, driver needn't to set + * VLAN pvid related configuration to hardware. + */ + if (txmode->pvid == 0 && txmode->hw_vlan_insert_pvid == 0) + return 0; + /* Apply pvid setting */ ret = hns3_vlan_pvid_set(dev, txmode->pvid, txmode->hw_vlan_insert_pvid); -- 2.23.0