DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dey, Souvik" <sodey@rbbn.com>
To: "beilei.xing@intel.com" <beilei.xing@intel.com>,
	"qi.z.zhang@intel.com" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: issue with ADD VLAN from Guest
Date: Mon, 14 Sep 2020 15:54:18 +0000
Message-ID: <DM6PR03MB4777CEF23E85661C367CF4DFCD230@DM6PR03MB4777.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20200414215847.3156-1-sodey@rbbn.com>

Hi Zhang,
I have submitted this patch way back in April and I see the patch has been deferred. Is there any particular reason behind that. As I have not received any communication about that was just wondering if there is something wrong that I might have done in the patch submission process to cause this.
Thanks for your help.

-----Original Message-----
From: Dey, Souvik <sodey@rbbn.com>
Sent: Tuesday, April 14, 2020 5:59 PM
To: beilei.xing@intel.com; qi.z.zhang@intel.com
Cc: dev@dpdk.org; Dey, Souvik <sodey@rbbn.com>
Subject: [PATCH] net/i40e: issue with ADD VLAN from Guest

From: "Dey, Souvik" <sodey@rbbn.com>

In case of i40evf pmd, when ADD_VLAN is sent down the linux i40e driver, along with add the vlan the kernel driver also enables the vlan stripping by default.
This might have issues if the app configured DEV_RX_OFFLOAD_VLAN_STRIP as off at the port configuration. The app after adding the VLAN will expect the VLAN to be coming in the received packets but, due to VLAN_STRIP enabled at the PF, it will get stripped.
This behavior of the Linux driver causes confussion with the DPDK app using i40e_pmd. So it is better to check the state of the DEV_RX_OFFLOAD_VLAN_STRIP flag in the dev_conf and disable the vlan strip after sending add_vlan if app configured the VLAN_STRIP as disabled.

Signed-off-by: Souvik Dey <sodey@rbbn.com>
 drivers/net/i40e/i40e_ethdev_vf.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 244397e..b8b6c57 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1044,6 +1044,7 @@ i40evf_add_vlan(struct rte_eth_dev *dev, uint16_t vlanid)  {
 struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 struct virtchnl_vlan_filter_list *vlan_list;
+struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 uint8_t cmd_buffer[sizeof(struct virtchnl_vlan_filter_list) +
 int err;
@@ -1060,8 +1061,21 @@ i40evf_add_vlan(struct rte_eth_dev *dev, uint16_t vlanid)
 args.out_buffer = vf->aq_resp;
 args.out_size = I40E_AQ_BUF_SZ;
 err = i40evf_execute_vf_cmd(dev, &args);
-if (err)
+if (err) {
 PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_VLAN");
+return ret;
+ * In linux kernel driver on receiving ADD_VLAN it enables
+ * VLAN_STRIP by default. So disable it if app confifured
+ * it that way.
+ */
+if (!(dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)) {
+err = i40evf_disable_vlan_strip(dev);
+if (err)
+PMD_DRV_LOG(ERR, "fail to execute command disable_vlan_strip "
+"as a part of OP_ADD_VLAN");

 return err;

  reply	other threads:[~2020-09-14 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 21:58 Souvik Dey
2020-09-14 15:54 ` Dey, Souvik [this message]
2020-04-14 22:07 Souvik Dey
2020-04-14 23:06 Souvik Dey
2020-12-09 16:23 Souvik Dey
2020-12-09 17:55 Souvik Dey
2020-12-11  3:07 ` Guo, Jia
2020-12-12 12:26   ` Dey, Souvik

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:

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

  git send-email \
    --in-reply-to=DM6PR03MB4777CEF23E85661C367CF4DFCD230@DM6PR03MB4777.namprd03.prod.outlook.com \
    --to=sodey@rbbn.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git