Skip to contentSkip to conversation

Add i40e Promiscuous disable in i40evf_dev_stop

PATCH New Rosen Xu 3 participants 7 messages Mar 15, 2018 – May 8, 2018 Network drivers

lore
Share & tools
lore

Rosen Xu

author
#0 lore raw

PATCH 1/1 Add i40e Promiscuous disable in i40evf_dev_stop

---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
index fd003fe..f395b02 100644
@@ -2051,6 +2051,8 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 
 	if (hw->adapter_stopped == 1)
 		return;
+	i40evf_dev_promiscuous_disable(dev);
+	i40evf_dev_allmulticast_disable(dev);
 	i40evf_stop_queues(dev);
 	i40evf_disable_queues_intr(dev);
 	i40e_dev_clear_queues(dev);
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH v3 1/1 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

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.

---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
index 031c706..40012b0 100644
@@ -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 */
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [PATCH v3] drivers/net/i40e: fix missing promiscuous disable at device disable

Hi Rosen:

Quoted 16 lines

-----Original Message-----
From: Xu, Rosen
Sent: Tuesday, April 17, 2018 11:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Helin <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
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.

Quoted 3 lines

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

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

Quoted 18 lines

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.

---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +0 -0
index 031c706..40012b0 100644

drivers/net/i40e/i40e_ethdev_vf.c static int eth_i40evf_pci_remove(struct · line 2291

Quoted 4 lines
drivers/net/i40e/i40e_ethdev_vf.c +0 -0
@@ -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

Quoted 7 lines
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
+	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

author
#3 lore raw

PATCH v4 1/1 drivers/net/i40e: fix missing promiscuous disable at device disable

In reply to Rosen Xu

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.

---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +8 -0
index 031c706..91fbf6c 100644
@@ -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 is a workaround solution when work with kernel driver
+	 * and it is not the normal way
+	 */
+	i40evf_dev_promiscuous_disable(dev);
+	i40evf_dev_allmulticast_disable(dev);
+
 	i40evf_reset_vf(hw);
 	i40e_shutdown_adminq(hw);
 	/* disable uio intr before callback unregister */
Signature · 1 line
1.8.3.1
Acked-by on v4 1/1
#4 lore raw

Re: [PATCH v4] drivers/net/i40e: fix missing promiscuous disable at device disable

Quoted 26 lines

-----Original Message-----
From: Xu, Rosen
Sent: Wednesday, April 18, 2018 4:12 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Helin <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Subject: [PATCH v4] drivers/net/i40e: fix missing promiscuous disable at device disable

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

Quoted 7 lines

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.

Change log need be removed when apply

author
#5 lore raw

PATCH v5 1/1 net/i40e: fix disabling promiscuous mode

In reply to Rosen Xu

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")
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +8 -0
index 48e7ac2..b8977a6 100644
@@ -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 */
Signature · 1 line
1.8.3.1
Applied
#6 lore raw

Re: [PATCH v5] net/i40e: fix disabling promiscuous mode

Quoted 31 lines

-----Original Message-----
From: Xu, Rosen
Sent: Saturday, April 28, 2018 7:39 PM
To: [email protected]
Cc: Zhang, Helin; Zhang, Qi Z; Wu, Jingjing; [email protected]
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.

Quoted 7 lines

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

Fixes 4861cde46116 ("i40e: new poll mode driver")

Applied to dpdk-next-net-intel, thanks!

Helin