net/i40e: force promiscuous state after VF reset

Message ID 675a204e3f5630d66cfa79b933da25a6c9227069.1568705792.git.echaudro@redhat.com
State New
Delegated to: xiaolong ye
Headers show
Series
  • net/i40e: force promiscuous state after VF reset
Related show

Checks

Context Check Description
ci/mellanox-Performance success Performance Testing PASS
ci/intel-Performance success Performance Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Eelco Chaudron Sept. 17, 2019, 7:40 a.m.
Even though the device reset is successful, disabling promiscuous mode
might not always succeed, causing enabling it after reset to
fail. This would happen when the kernel driver requires a reset of the
VF.

This patch resets the internal state, so next time promiscuous mode is
configured it will be enabled.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Eelco Chaudron Oct. 15, 2019, 10:31 a.m. | #1
Any update on this patch?

Thanks,

Eelco


On 17 Sep 2019, at 9:40, Eelco Chaudron wrote:

> Even though the device reset is successful, disabling promiscuous mode
> might not always succeed, causing enabling it after reset to
> fail. This would happen when the kernel driver requires a reset of the
> VF.
>
> This patch resets the internal state, so next time promiscuous mode is
> configured it will be enabled.
>
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 551f6fa..e0f99a4 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -2276,11 +2276,21 @@ static int eth_i40evf_pci_remove(struct 
> rte_pci_device *pci_dev)
>  i40evf_dev_reset(struct rte_eth_dev *dev)
>  {
>  	int ret;
> +	struct i40e_vf *vf = 
> I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
>
>  	ret = i40evf_dev_uninit(dev);
>  	if (ret)
>  		return ret;
>
> +	/*
> +	 * Even though the device reset is successful disabling promiscuous
> +	 * mode might not always succeed, causing enabling it after reset to
> +	 * fail. This would happen when the kernel driver requires a reset
> +	 * of the VF.
> +	 */
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> +		vf->promisc_unicast_enabled = FALSE;
> +
>  	ret = i40evf_dev_init(dev);
>
>  	return ret;
> -- 
> 1.8.3.1
Xing, Beilei Oct. 17, 2019, 6:34 a.m. | #2
> -----Original Message-----
> From: Eelco Chaudron [mailto:echaudro@redhat.com]
> Sent: Tuesday, October 15, 2019 6:32 PM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: force promiscuous state after VF
> reset
> 
> Any update on this patch?
> 
> Thanks,
> 
> Eelco
> 
> 
> On 17 Sep 2019, at 9:40, Eelco Chaudron wrote:
> 
> > Even though the device reset is successful, disabling promiscuous mode
> > might not always succeed, causing enabling it after reset to fail.
> > This would happen when the kernel driver requires a reset of the VF.
> >
> > This patch resets the internal state, so next time promiscuous mode is
> > configured it will be enabled.
> >
> > Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev_vf.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> > b/drivers/net/i40e/i40e_ethdev_vf.c
> > index 551f6fa..e0f99a4 100644
> > --- a/drivers/net/i40e/i40e_ethdev_vf.c
> > +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> > @@ -2276,11 +2276,21 @@ static int eth_i40evf_pci_remove(struct
> > rte_pci_device *pci_dev)  i40evf_dev_reset(struct rte_eth_dev *dev)  {
> >  	int ret;
> > +	struct i40e_vf *vf =
> > I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> >
> >  	ret = i40evf_dev_uninit(dev);
> >  	if (ret)
> >  		return ret;
> >
> > +	/*
> > +	 * Even though the device reset is successful disabling promiscuous
> > +	 * mode might not always succeed, causing enabling it after reset to

I think we need to root cause why fail to disable promiscuous mode and try to fix it first.

Thanks.
Beilei

> > +	 * fail. This would happen when the kernel driver requires a reset
> > +	 * of the VF.
> > +	 */
> > +	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> > +		vf->promisc_unicast_enabled = FALSE;
> > +
> >  	ret = i40evf_dev_init(dev);
> >
> >  	return ret;
> > --
> > 1.8.3.1

Patch

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 551f6fa..e0f99a4 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2276,11 +2276,21 @@  static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev)
 i40evf_dev_reset(struct rte_eth_dev *dev)
 {
 	int ret;
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
 	ret = i40evf_dev_uninit(dev);
 	if (ret)
 		return ret;
 
+	/*
+	 * Even though the device reset is successful disabling promiscuous
+	 * mode might not always succeed, causing enabling it after reset to
+	 * fail. This would happen when the kernel driver requires a reset
+	 * of the VF.
+	 */
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+		vf->promisc_unicast_enabled = FALSE;
+
 	ret = i40evf_dev_init(dev);
 
 	return ret;