patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Wenjing Qiao <wenjing.qiao@intel.com>
To: jingjing.wu@intel.com, beilei.xing@intel.com
Cc: stable@dpdk.org, zhiminx.huang@intel.com,
	Wenjing Qiao <wenjing.qiao@intel.com>
Subject: [PATCH v3] net/iavf: fix VLAN offload strip flag inconsistency
Date: Mon, 21 Aug 2023 09:20:32 +0000	[thread overview]
Message-ID: <20230821092031.211436-1-wenjing.qiao@intel.com> (raw)
In-Reply-To: <20230712074831.1252086-1-wenjing.qiao@intel.com>

For i40e kernel driver which only supports vlan(v1) VIRTCHNL OP,
it will set strip on when setting filter on but dpdk side will not
change strip flag. To be consistent with dpdk side, disable strip
again.

Fixes: cb25d4323fbf ("net/avf: enable MAC VLAN and promisc ops")
Cc: stable@dpdk.org

Signed-off-by: Wenjing Qiao <wenjing.qiao@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 00b963128b..bdfc0ed098 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1361,6 +1361,7 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 	struct iavf_adapter *adapter =
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
+	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 	int err;
 
 	if (adapter->closed)
@@ -1379,6 +1380,23 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 	err = iavf_add_del_vlan(adapter, vlan_id, on);
 	if (err)
 		return -EIO;
+
+	/* For i40e kernel driver which only supports vlan(v1) VIRTCHNL OP,
+	 * it will set strip on when setting filter on but dpdk side will not
+	 * change strip flag. To be consistent with dpdk side, disable strip
+	 * again.
+	 *
+	 * For i40e kernel driver which supports vlan v2, dpdk will invoke vlan v2
+	 * related function, so it won't go through here.
+	 */
+	if (adapter->hw.mac.type == IAVF_MAC_XL710 ||
+	    adapter->hw.mac.type == IAVF_MAC_X722_VF) {
+		if (on && !(dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)) {
+			err = iavf_disable_vlan_strip(adapter);
+			if (err)
+				return -EIO;
+		}
+	}
 	return 0;
 }
 
-- 
2.34.1


  parent reply	other threads:[~2023-08-21  9:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230707075802.620018-1-wenjing.qiao@intel.com>
2023-07-12  7:48 ` [PATCH v2] net/iavf: fix vlan " Wenjing Qiao
2023-07-12  8:43   ` Huang, ZhiminX
2023-08-21  9:20   ` Wenjing Qiao [this message]
2023-08-21  9:52     ` [PATCH v4] net/iavf: fix VLAN " Wenjing Qiao
2023-08-23  5:30       ` Zhang, Qi Z

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=20230821092031.211436-1-wenjing.qiao@intel.com \
    --to=wenjing.qiao@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=zhiminx.huang@intel.com \
    /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).