* [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip @ 2021-08-31 3:52 Qiming Chen 2021-09-07 10:38 ` Luca Boccassi 0 siblings, 1 reply; 4+ messages in thread From: Qiming Chen @ 2021-08-31 3:52 UTC (permalink / raw) To: stable; +Cc: Qiming Chen Kernel PF+DPDK VF mode, after vf adds vlan, the test result shows that the vlan received from vf has been stripped. The patch solves the problem that the kernel i40e.ko driver strips the vlan by default after vf adds vlan. Determine whether to strip vlan through the DEV_RX_OFFLOAD_VLAN_STRIP mask bit in rxmode.offload. Environmental information: 1) dpdk 19.11 2) Kernel PF i40e.ko: 2.7.12 3) Firmware: 6.01 0x800034a3 1.1747.0 I did not use testpmd to test vlan filter, but write Demo for testing based on the following deployment: 1) x710 nic, use 2 PFs, each PF virtualizes 1 VF 2) 2 pf connected with fiber optic cable 3) 2 vf are hard to pass through to the VM 4) In vm, dpdk takes over the vf port, 5) One port is used as the sending port, and the other port is used as the receiving port, e.g. xmit portid is 0, rx portid is 1 Use the default configuration for port 0 as the sender, and configure port 1 as the receiving port as follows: 1) rte_eth_dev_set_vlan_offload(1, ETH_VLAN_FILTER_OFFLOAD) 2) rte_eth_dev_vlan_filter(1, 100, 1) Do the following tests: Demo constructs a message with vlan 100 to be sent from port 0, and found that the vlan header of the message received from port 1 was stripped. Signed-off-by: Qiming Chen <chenqiming_huawei@163.com> --- drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 12e69a3233..d60243411c 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1900,11 +1900,15 @@ static int i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { int ret; + struct rte_eth_conf *dev_conf = &dev->data->dev_conf; - if (on) + if (on) { ret = i40evf_add_vlan(dev, vlan_id); - else + if (!(dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)) + i40evf_disable_vlan_strip(dev); + } else { ret = i40evf_del_vlan(dev,vlan_id); + } return ret; } -- 2.30.1.windows.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip 2021-08-31 3:52 [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip Qiming Chen @ 2021-09-07 10:38 ` Luca Boccassi 2021-09-08 3:58 ` Xing, Beilei 0 siblings, 1 reply; 4+ messages in thread From: Luca Boccassi @ 2021-09-07 10:38 UTC (permalink / raw) To: Beilei Xing; +Cc: Qiming Chen, stable On Tue, 2021-08-31 at 11:52 +0800, Qiming Chen wrote: > Kernel PF+DPDK VF mode, after vf adds vlan, the test result shows that the > vlan received from vf has been stripped. > > The patch solves the problem that the kernel i40e.ko driver strips the vlan > by default after vf adds vlan. Determine whether to strip vlan through > the DEV_RX_OFFLOAD_VLAN_STRIP mask bit in rxmode.offload. > > Environmental information: > 1) dpdk 19.11 > 2) Kernel PF i40e.ko: 2.7.12 > 3) Firmware: 6.01 0x800034a3 1.1747.0 > > I did not use testpmd to test vlan filter, but write Demo for testing > based on the following deployment: > 1) x710 nic, use 2 PFs, each PF virtualizes 1 VF > 2) 2 pf connected with fiber optic cable > 3) 2 vf are hard to pass through to the VM > 4) In vm, dpdk takes over the vf port, > 5) One port is used as the sending port, and the other port is used as > the receiving port, e.g. xmit portid is 0, rx portid is 1 > > Use the default configuration for port 0 as the sender, and configure > port 1 as the receiving port as follows: > 1) rte_eth_dev_set_vlan_offload(1, ETH_VLAN_FILTER_OFFLOAD) > 2) rte_eth_dev_vlan_filter(1, 100, 1) > > Do the following tests: > Demo constructs a message with vlan 100 to be sent from port 0, and found > that the vlan header of the message received from port 1 was stripped. > > Signed-off-by: Qiming Chen <chenqiming_huawei@163.com> > --- > drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c > index 12e69a3233..d60243411c 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1900,11 +1900,15 @@ static int > i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) > { > int ret; > + struct rte_eth_conf *dev_conf = &dev->data->dev_conf; > > > - if (on) > + if (on) { > ret = i40evf_add_vlan(dev, vlan_id); > - else > + if (!(dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)) > + i40evf_disable_vlan_strip(dev); > + } else { > ret = i40evf_del_vlan(dev,vlan_id); > + } > > > return ret; > } Hi Beilei, Could you please review this and the other i40e patches that have been sent for 20.11? Thank you -- Kind regards, Luca Boccassi ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip 2021-09-07 10:38 ` Luca Boccassi @ 2021-09-08 3:58 ` Xing, Beilei 2021-11-08 11:54 ` Xueming(Steven) Li 0 siblings, 1 reply; 4+ messages in thread From: Xing, Beilei @ 2021-09-08 3:58 UTC (permalink / raw) To: Luca Boccassi; +Cc: Qiming Chen, stable Sorry I can't find the original patch in mail. And I review it here. > -----Original Message----- > From: Luca Boccassi <bluca@debian.org> > Sent: Tuesday, September 7, 2021 6:39 PM > To: Xing, Beilei <beilei.xing@intel.com> > Cc: Qiming Chen <chenqiming_huawei@163.com>; stable@dpdk.org > Subject: Re: [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip net/i40evf: fix vlan strip issue > > On Tue, 2021-08-31 at 11:52 +0800, Qiming Chen wrote: > > Kernel PF+DPDK VF mode, after vf adds vlan, the test result shows that > > the vlan received from vf has been stripped. > > > > The patch solves the problem that the kernel i40e.ko driver strips the > > vlan by default after vf adds vlan. Determine whether to strip vlan > > through the DEV_RX_OFFLOAD_VLAN_STRIP mask bit in rxmode.offload. > > I think the above commit log is enough, the following detail environment and test can be removed. > > Environmental information: > > 1) dpdk 19.11 > > 2) Kernel PF i40e.ko: 2.7.12 > > 3) Firmware: 6.01 0x800034a3 1.1747.0 > > > > I did not use testpmd to test vlan filter, but write Demo for testing > > based on the following deployment: > > 1) x710 nic, use 2 PFs, each PF virtualizes 1 VF > > 2) 2 pf connected with fiber optic cable > > 3) 2 vf are hard to pass through to the VM > > 4) In vm, dpdk takes over the vf port, > > 5) One port is used as the sending port, and the other port is used as > > the receiving port, e.g. xmit portid is 0, rx portid is 1 > > > > Use the default configuration for port 0 as the sender, and configure > > port 1 as the receiving port as follows: > > 1) rte_eth_dev_set_vlan_offload(1, ETH_VLAN_FILTER_OFFLOAD) > > 2) rte_eth_dev_vlan_filter(1, 100, 1) > > > > Do the following tests: > > Demo constructs a message with vlan 100 to be sent from port 0, and > > found that the vlan header of the message received from port 1 was > stripped. > > > > Signed-off-by: Qiming Chen <chenqiming_huawei@163.com> > > --- > > drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > > b/drivers/net/i40e/i40e_ethdev_vf.c > > index 12e69a3233..d60243411c 100644 > > --- a/drivers/net/i40e/i40e_ethdev_vf.c > > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > > @@ -1900,11 +1900,15 @@ static int > > i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int > > on) > > { > > int ret; > > + struct rte_eth_conf *dev_conf = &dev->data->dev_conf; > > > > > > - if (on) > > + if (on) { > > ret = i40evf_add_vlan(dev, vlan_id); > > - else > > + if (!(dev_conf->rxmode.offloads & > DEV_RX_OFFLOAD_VLAN_STRIP)) > > + i40evf_disable_vlan_strip(dev); > > + } else { > > ret = i40evf_del_vlan(dev,vlan_id); > > + } > > > > > > return ret; > > } > > Hi Beilei, > > Could you please review this and the other i40e patches that have been sent > for 20.11? Thank you > > -- > Kind regards, > Luca Boccassi ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip 2021-09-08 3:58 ` Xing, Beilei @ 2021-11-08 11:54 ` Xueming(Steven) Li 0 siblings, 0 replies; 4+ messages in thread From: Xueming(Steven) Li @ 2021-11-08 11:54 UTC (permalink / raw) To: beilei.xing, bluca; +Cc: chenqiming_huawei, stable On Wed, 2021-09-08 at 03:58 +0000, Xing, Beilei wrote: > Sorry I can't find the original patch in mail. > And I review it here. > > > -----Original Message----- > > From: Luca Boccassi <bluca@debian.org> > > Sent: Tuesday, September 7, 2021 6:39 PM > > To: Xing, Beilei <beilei.xing@intel.com> > > Cc: Qiming Chen <chenqiming_huawei@163.com>; stable@dpdk.org > > Subject: Re: [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip > > net/i40evf: fix vlan strip issue > > > > > On Tue, 2021-08-31 at 11:52 +0800, Qiming Chen wrote: > > > Kernel PF+DPDK VF mode, after vf adds vlan, the test result shows that > > > the vlan received from vf has been stripped. > > > > > > The patch solves the problem that the kernel i40e.ko driver strips the > > > vlan by default after vf adds vlan. Determine whether to strip vlan > > > through the DEV_RX_OFFLOAD_VLAN_STRIP mask bit in rxmode.offload. > > > > > I think the above commit log is enough, the following detail environment and test can be removed. > > > > > Environmental information: > > > 1) dpdk 19.11 > > > 2) Kernel PF i40e.ko: 2.7.12 > > > 3) Firmware: 6.01 0x800034a3 1.1747.0 > > > > > > I did not use testpmd to test vlan filter, but write Demo for testing > > > based on the following deployment: > > > 1) x710 nic, use 2 PFs, each PF virtualizes 1 VF > > > 2) 2 pf connected with fiber optic cable > > > 3) 2 vf are hard to pass through to the VM > > > 4) In vm, dpdk takes over the vf port, > > > 5) One port is used as the sending port, and the other port is used as > > > the receiving port, e.g. xmit portid is 0, rx portid is 1 > > > > > > Use the default configuration for port 0 as the sender, and configure > > > port 1 as the receiving port as follows: > > > 1) rte_eth_dev_set_vlan_offload(1, ETH_VLAN_FILTER_OFFLOAD) > > > 2) rte_eth_dev_vlan_filter(1, 100, 1) > > > > > > Do the following tests: > > > Demo constructs a message with vlan 100 to be sent from port 0, and > > > found that the vlan header of the message received from port 1 was > > stripped. > > > > > > Signed-off-by: Qiming Chen <chenqiming_huawei@163.com> > > > --- > > > drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- > > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > > > b/drivers/net/i40e/i40e_ethdev_vf.c > > > index 12e69a3233..d60243411c 100644 > > > --- a/drivers/net/i40e/i40e_ethdev_vf.c > > > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > > > @@ -1900,11 +1900,15 @@ static int > > > i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int > > > on) > > > { > > > int ret; > > > + struct rte_eth_conf *dev_conf = &dev->data->dev_conf; > > > > > > > > > - if (on) > > > + if (on) { > > > ret = i40evf_add_vlan(dev, vlan_id); > > > - else > > > + if (!(dev_conf->rxmode.offloads & > > DEV_RX_OFFLOAD_VLAN_STRIP)) > > > + i40evf_disable_vlan_strip(dev); > > > + } else { > > > ret = i40evf_del_vlan(dev,vlan_id); > > > + } > > > > > > > > > return ret; > > > } > > > > Hi Beilei, > > > > Could you please review this and the other i40e patches that have been sent > > for 20.11? Thank you > > > > -- > > Kind regards, > > Luca Boccassi Another one, Qiming. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-08 11:54 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-08-31 3:52 [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip Qiming Chen 2021-09-07 10:38 ` Luca Boccassi 2021-09-08 3:58 ` Xing, Beilei 2021-11-08 11:54 ` Xueming(Steven) Li
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).