Skip to contentSkip to conversation

net/i40e: always re-program promiscuous mode on VF interface

PATCH Applied Eelco Chaudron 3 participants 6 messages Nov 19, 2019 – Dec 18, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net/i40e: always re-program promiscuous mode on VF interface

During a kernel PF reset, this event is propagated to the VF. The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode.

This patch makes sure the promiscuous mode is configured independently of the current admin state.

---
v1-v2:
In the earlier patch, we would force the vf->promisc_unicast_enabled state to false after a reset. Based on the review comments it was prefered to not take the current state into account when programming.

v1 patch was called: net/i40e: force promiscuous state after VF reset

 drivers/net/i40e/i40e_ethdev_vf.c |   16 ----------------
 1 file changed, 16 deletions(-)
drivers/net/i40e/i40e_ethdev_vf.c +0 -16
index 5dba092..43f7ab5 100644
@@ -2162,10 +2162,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (vf->promisc_unicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
@@ -2181,10 +2177,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If disabled, just return */
-	if (!vf->promisc_unicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
@@ -2200,10 +2192,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (vf->promisc_multicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
@@ -2219,10 +2207,6 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (!vf->promisc_multicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
#1 lore raw

Any update on this patch?

Quoted 78 lines · Eelco Chaudron

During a kernel PF reset, this event is propagated to the VF. The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode.

This patch makes sure the promiscuous mode is configured independently of the current admin state.

---
v1-v2:
In the earlier patch, we would force the vf->promisc_unicast_enabled state to false after a reset. Based on the review comments it was prefered to not take the current state into account when
programming.

v1 patch was called: net/i40e: force promiscuous state after VF
reset

 drivers/net/i40e/i40e_ethdev_vf.c |   16 ----------------
 1 file changed, 16 deletions(-)
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
index 5dba092..43f7ab5 100644
@@ -2162,10 +2162,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (vf->promisc_unicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
@@ -2181,10 +2177,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If disabled, just return */
-	if (!vf->promisc_unicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
@@ -2200,10 +2192,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (vf->promisc_multicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
@@ -2219,10 +2207,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (!vf->promisc_multicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
drivers/net/i40e/i40e_ethdev_vf.c +0 -0
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
#2 lore raw

Trying again?

Quoted 84 lines · Eelco Chaudron

Any update on this patch?

Quoted 79 lines · Eelco Chaudron

During a kernel PF reset, this event is propagated to the VF. The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode.

This patch makes sure the promiscuous mode is configured independently of the current admin state.

---
v1-v2:
In the earlier patch, we would force the
vf->promisc_unicast_enabled
state to false after a reset. Based on the review comments it was prefered to not take the current state into account when
programming.

v1 patch was called: net/i40e: force promiscuous state after VF
reset

 drivers/net/i40e/i40e_ethdev_vf.c |   16 ----------------
 1 file changed, 16 deletions(-)
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
index 5dba092..43f7ab5 100644
@@ -2162,10 +2162,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (vf->promisc_unicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
@@ -2181,10 +2177,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If disabled, just return */
-	if (!vf->promisc_unicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
@@ -2200,10 +2192,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (vf->promisc_multicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
drivers/net/i40e/i40e_ethdev_vf.c +0 -4
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
@@ -2219,10 +2207,6 @@ static int eth_i40evf_pci_remove(struct 
 rte_pci_device *pci_dev)
 	struct i40e_vf *vf = 
 I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;
 
-	/* If enabled, just return */
-	if (!vf->promisc_multicast_enabled)
-		return 0;
-
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
drivers/net/i40e/i40e_ethdev_vf.c +0 -0
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
Reviewed-by on v2 1/1
#3 lore raw
In reply to Eelco Chaudron
Quoted 14 lines

-----Original Message-----
From: Eelco Chaudron [mailto:[email protected]]
Sent: Tuesday, November 19, 2019 9:45 PM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Zhang, Xiao <[email protected]>; [email protected]
Subject: [PATCH v2] net/i40e: always re-program promiscuous mode on VF interface

During a kernel PF reset, this event is propagated to the VF.
The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode.

Quoted 4 lines

This patch makes sure the promiscuous mode is configured independently of the current admin state.

Applied
#4 lore raw
Quoted 14 lines · Xiao
Quoted 14 lines

-----Original Message-----
From: Eelco Chaudron [mailto:[email protected]]
Sent: Tuesday, November 19, 2019 9:45 PM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Zhang, Xiao <[email protected]>; [email protected]
Subject: [PATCH v2] net/i40e: always re-program promiscuous mode on VF interface

During a kernel PF reset, this event is propagated to the VF.
The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode.

Quoted 6 lines
Quoted 4 lines

This patch makes sure the promiscuous mode is configured independently of the current admin state.

Applied to dpdk-next-net-intel, Thanks.

#5 lore raw

Thanks!

Quoted 23 lines · Ye Xiaolong
Quoted 14 lines · Xiao
Quoted 14 lines

-----Original Message-----
From: Eelco Chaudron [mailto:[email protected]]
Sent: Tuesday, November 19, 2019 9:45 PM
To: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Zhang, Xiao <[email protected]>; [email protected]
Subject: [PATCH v2] net/i40e: always re-program promiscuous mode on VF interface

During a kernel PF reset, this event is propagated to the VF.
The DPDK VF PMD will execute the reset task before the PF is done with his. This results in the admin queue message not being responded to leaving the port in "promiscuous" mode.

Quoted 6 lines
Quoted 4 lines

This patch makes sure the promiscuous mode is configured independently of the current admin state.

Applied to dpdk-next-net-intel, Thanks.