DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 4/6] net/hns3: fix VLAN pvid when configuring device
Date: Wed, 29 Apr 2020 19:13:26 +0800	[thread overview]
Message-ID: <20200429111328.64952-5-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200429111328.64952-1-huwei013@chinasoftinc.com>

From: "Min Hu (Connor)" <humin29@huawei.com>

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) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
---
 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


  parent reply	other threads:[~2020-04-29 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 11:13 [dpdk-dev] [PATCH 0/6] misc updates and bugfixes for hns3 PMD driver Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 1/6] net/hns3: get Tx abnormal errors in extend device statistics Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 2/6] net/hns3: print the detail ret value Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 3/6] net/hns3: get PCI revision id Wei Hu (Xavier)
2020-04-29 11:13 ` Wei Hu (Xavier) [this message]
2020-04-29 11:13 ` [dpdk-dev] [PATCH 5/6] net/hns3: fix MSI-x interrupt number during initialization Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 6/6] net/hns3: fix return value when clearing statistics fails Wei Hu (Xavier)
2020-05-05  9:12 ` [dpdk-dev] [PATCH 0/6] misc updates and bugfixes for hns3 PMD driver Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200429111328.64952-5-huwei013@chinasoftinc.com \
    --to=huwei013@chinasoftinc.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).