[dpdk-dev,v5] net/i40e: fix disabling promiscuous mode

Message ID 1524915533-96768-1-git-send-email-rosen.xu@intel.com (mailing list archive)
State Accepted, 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 28, 2018, 11:38 a.m. UTC
  v5 updates:
  

Comments

Zhang, Helin May 8, 2018, 1:47 a.m. UTC | #1
> -----Original Message-----
> From: Xu, Rosen
> Sent: Saturday, April 28, 2018 7:39 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin; Zhang, Qi Z; Wu, Jingjing; stable@dpdk.org
> Subject: [PATCH v5] net/i40e: fix disabling promiscuous mode
> 
> v5 updates:
> ===========
>  - Modificate some comments for this patch
> 
> v4 updates:
> ===========
>  - Add some comments for this patch
> 
> 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
> 
> 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.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Rosen Xu <rosen.xu@intel.com>
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel, thanks!

Helin
  

Patch

===========
 - Modificate some comments for this patch

v4 updates:
===========
 - Add some comments for this patch

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

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.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 48e7ac2..b8977a6 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2288,6 +2288,14 @@  static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 
 	i40evf_dev_stop(dev);
 	i40e_dev_free_queues(dev);
+	/*
+	 * disable promiscuous mode before reset vf
+	 * it fixes missing disable promiscuous mode
+	 * when work with kernel dirver bug issue
+	 */
+	i40evf_dev_promiscuous_disable(dev);
+	i40evf_dev_allmulticast_disable(dev);
+
 	i40evf_reset_vf(hw);
 	i40e_shutdown_adminq(hw);
 	/* disable uio intr before callback unregister */