[dpdk-stable] [PATCH] net/i40e: fix flow FDIR enable issue

Zhao1, Wei wei.zhao1 at intel.com
Wed May 20 09:43:44 CEST 2020


Hi beilei

> -----Original Message-----
> From: Xing, Beilei <beilei.xing at intel.com>
> Sent: Wednesday, May 20, 2020 3:37 PM
> To: Zhao1, Wei <wei.zhao1 at intel.com>; dev at dpdk.org
> Cc: stable at dpdk.org; Guo, Jia <jia.guo at intel.com>
> Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issue
> 
> 
> 
> > -----Original Message-----
> > From: Zhao1, Wei <wei.zhao1 at intel.com>
> > Sent: Wednesday, May 20, 2020 1:13 PM
> > To: Xing, Beilei <beilei.xing at intel.com>; dev at dpdk.org
> > Cc: stable at dpdk.org; Guo, Jia <jia.guo at intel.com>
> > Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issue
> >
> >
> >
> > > -----Original Message-----
> > > From: Xing, Beilei <beilei.xing at intel.com>
> > > Sent: Wednesday, May 20, 2020 12:14 PM
> > > To: Zhao1, Wei <wei.zhao1 at intel.com>; dev at dpdk.org
> > > Cc: stable at dpdk.org; Guo, Jia <jia.guo at intel.com>
> > > Subject: RE: [PATCH] net/i40e: fix flow FDIR enable issue
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Zhao1, Wei <wei.zhao1 at intel.com>
> > > > Sent: Tuesday, May 19, 2020 3:17 PM
> > > > To: dev at dpdk.org
> > > > Cc: stable at dpdk.org; Xing, Beilei <beilei.xing at intel.com>; Guo,
> > > > Jia <jia.guo at intel.com>; Zhao1, Wei <wei.zhao1 at intel.com>
> > > > Subject: [PATCH] net/i40e: fix flow FDIR enable issue
> > > >
> > > > When we flush flow FDIR, all queues are disabled for FDIR.
> > > > If FDIR rule is created again, then the flow list is empty, as it
> > > > is the first time to create rule after flush fdir filter, so we
> > > > need to enable FDRI for all queues. And also, disable FDIR for
> > > > queues should be done in function i40e_flow_flush_fdir_filter().
> > > >
> > > > Cc: stable at dpdk.org
> > > > Fixes: 1491f63c7559 ("net/i40e: fix flush of flow director
> > > > filter")
> > > > Fixes: 6ae9b2b5e8c2 ("net/i40e: cache flow director enable value
> > > > in Rx
> > > > queue")
> > > >
> > > > Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
> > > > ---
> > > >  drivers/net/i40e/i40e_flow.c | 12 +++++++++---
> > > >  1 file changed, 9 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/net/i40e/i40e_flow.c
> > > > b/drivers/net/i40e/i40e_flow.c index
> > > > 25c77e7aa..94fc73092 100644
> > > > --- a/drivers/net/i40e/i40e_flow.c
> > > > +++ b/drivers/net/i40e/i40e_flow.c
> > > > @@ -3462,6 +3462,12 @@ i40e_flow_parse_fdir_filter(struct
> > > > rte_eth_dev *dev,
> > > >  		}
> > > >  	}
> > > >
> > > > +	/* If the flow list is empty, it is the first time to create
> > > > +	 * rule after flush fdir filter, so enable fdir.
> > > > +	 */
> > > > +	if (TAILQ_EMPTY(&pf->fdir.fdir_list))
> > > > +		i40e_fdir_rx_proc_enable(dev, 1);
> > > > +
> > >
> > > i40e_fdir_rx_proc_enable is called in i40e_fdir_configure, so could
> > > you check if we can optimize this and if statement
> > > (pf->fdir.fdir_vsi == NULL)
> > above?
> >
> > No, when "flow flush 0", the pf->fdir.fdir_vs is not NULL, but list
> > pf-
> > >fdir.fdir_list is empty.
> 
> Then seems i40e_fdir_rx_proc_enable(dev, 1) can be removed from
> i40e_fdir_configure, since i40e_fdir_rx_proc_enable(dev, 1) will always be
> called when the first FDIR rule is created and fdir_list is empty.
> Or we can use 'else if (TAILQ_EMPTY(&pf->fdir.fdir_list))' to avoid duplicate
> execution of i40e_fdir_rx_proc_enable(dev, 1).

i40e_fdir_rx_proc_enable(dev, 1) can not be remove by now, because i40e_fdir_configure() will be used by legacy fdir.
We can remove it only after i40 legacy API disappear. May be some user not using rte-flow FDIR.


> 
> >
> > >
> > > >  	return 0;
> > > >  err:
> > > >  	i40e_fdir_teardown(pf);
> > > > @@ -5330,9 +5336,6 @@ i40e_flow_flush(struct rte_eth_dev *dev,
> > > > struct rte_flow_error *error)
> > > >  		return -rte_errno;
> > > >  	}
> > > >
> > > > -	/* Disable FDIR processing as all FDIR rules are now flushed */
> > > > -	i40e_fdir_rx_proc_enable(dev, 0);
> > > > -
> > > >  	return ret;
> > > >  }
> > > >
> > > > @@ -5368,6 +5371,9 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
> > > >  		for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
> > > >  		     pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
> > > >  			pf->fdir.inset_flag[pctype] = 0;
> > > > +
> > > > +		/* Disable FDIR processing as all FDIR rules are now flushed
> > */
> > > > +		i40e_fdir_rx_proc_enable(dev, 0);
> > > >  	}
> > > >
> > > >  	return ret;
> > > > --
> > > > 2.19.1



More information about the stable mailing list