[dpdk-dev,v3] drivers/net/i40e: fix missing promiscuous disable at device disable

Message ID 1523934168-128914-1-git-send-email-rosen.xu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Helin Zhang
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xu, Rosen April 17, 2018, 3:02 a.m. UTC
  v3 updates:
  

Comments

Qi Zhang April 17, 2018, 1:31 p.m. UTC | #1
Hi Rosen:

> -----Original Message-----
> From: Xu, Rosen
> Sent: Tuesday, April 17, 2018 11:03 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Subject: [PATCH v3] drivers/net/i40e: fix missing promiscuous disable at
> device disable
> 
> v3 updates:
> ===========
>  - Move modification from device close to device disable
>  - i40evf_reset_vf() will cause kernel driver enable all vlan promiscuous,
>    so unicast/multicast promiscuous disable should set before reset.
> 
> v2 updates:
> ===========
>  - Add more comments

Version log can be added after ---, so it will not be included by commit log.

> 
> In scenario of Kernel Driver runs on PF and PMD runs on VF, PMD exit
> doesn't disable promiscuous mode, this will cause vlan filter set by Kernel
> Driver will not take effect.
> 
> This patch will fix it, add promiscuous disable at device disable.
> 
> Signed-off-by: Rosen Xu <rosen.xu@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 031c706..40012b0 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -2288,6 +2288,8 @@ static int eth_i40evf_pci_remove(struct
> rte_pci_device *pci_dev)
> 
>  	i40evf_dev_stop(dev);
>  	i40e_dev_free_queues(dev);

I think it's better to add some comment here, 
since this is a workaround solution and it is not the normal way
we disable promiscuous mode, people need to be noticed here. 

Regards
Qi

> +	i40evf_dev_promiscuous_disable(dev);
> +	i40evf_dev_allmulticast_disable(dev);
>  	i40evf_reset_vf(hw);
>  	i40e_shutdown_adminq(hw);
>  	/* disable uio intr before callback unregister */
> --
> 1.8.3.1
  

Patch

===========
 - Move modification from device close to device disable
 - i40evf_reset_vf() will cause kernel driver enable all vlan promiscuous,
   so unicast/multicast promiscuous disable should set before reset.

v2 updates:
===========
 - Add more comments

In scenario of Kernel Driver runs on PF and PMD runs on VF, PMD exit
doesn't disable promiscuous mode, this will cause vlan filter set by
Kernel Driver will not take effect.

This patch will fix it, add promiscuous disable at device disable.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 031c706..40012b0 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2288,6 +2288,8 @@  static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 
 	i40evf_dev_stop(dev);
 	i40e_dev_free_queues(dev);
+	i40evf_dev_promiscuous_disable(dev);
+	i40evf_dev_allmulticast_disable(dev);
 	i40evf_reset_vf(hw);
 	i40e_shutdown_adminq(hw);
 	/* disable uio intr before callback unregister */