DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict
@ 2017-12-18  5:20 Beilei Xing
  2017-12-19 13:20 ` Zhang, Qi Z
  0 siblings, 1 reply; 4+ messages in thread
From: Beilei Xing @ 2017-12-18  5:20 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev

The first FDIR rule for some PCTYPE will configure input set and
create flow, the following flows must use the same input set,
otherwise will cause input set conflict and fail to create flow.
But if creating the first rule after flow flush, input set should
be re-configured.

Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR")
c: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 7e4936e..a9e7a0d 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4406,6 +4406,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
 	struct rte_eth_dev *dev = pf->adapter->eth_dev;
 	struct i40e_fdir_info *fdir_info = &pf->fdir;
 	struct i40e_fdir_filter *fdir_filter;
+	enum i40e_filter_pctype pctype;
 	struct rte_flow *flow;
 	void *temp;
 	int ret;
@@ -4427,6 +4428,10 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
 				rte_free(flow);
 			}
 		}
+
+		for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
+		     pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
+			pf->fdir.inset_flag[pctype] = 0;
 	}
 
 	return ret;
-- 
2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict
  2017-12-18  5:20 [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict Beilei Xing
@ 2017-12-19 13:20 ` Zhang, Qi Z
  2017-12-20  3:20   ` Xing, Beilei
  2017-12-20  8:24   ` Zhang, Helin
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2017-12-19 13:20 UTC (permalink / raw)
  To: Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: Xing, Beilei
> Sent: Monday, December 18, 2017 1:21 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] net/i40e: fix FDIR input set conflict
> 
> The first FDIR rule for some PCTYPE will configure input set and create flow,
> the following flows must use the same input set, otherwise will cause input
> set conflict and fail to create flow.
> But if creating the first rule after flow flush, input set should be
> re-configured.
> 
> Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR")
> c: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 7e4936e..a9e7a0d 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4406,6 +4406,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
>  	struct rte_eth_dev *dev = pf->adapter->eth_dev;
>  	struct i40e_fdir_info *fdir_info = &pf->fdir;
>  	struct i40e_fdir_filter *fdir_filter;
> +	enum i40e_filter_pctype pctype;
>  	struct rte_flow *flow;
>  	void *temp;
>  	int ret;
> @@ -4427,6 +4428,10 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
>  				rte_free(flow);
>  			}
>  		}
> +
> +		for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
> +		     pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
> +			pf->fdir.inset_flag[pctype] = 0;
>  	}
> 
>  	return ret;
> --
> 2.5.5

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

BTW, do we also need a fix for flow destroy? When the last flow that use input set be destroyed, inset_flag also need to be reset?

Regards
Qi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict
  2017-12-19 13:20 ` Zhang, Qi Z
@ 2017-12-20  3:20   ` Xing, Beilei
  2017-12-20  8:24   ` Zhang, Helin
  1 sibling, 0 replies; 4+ messages in thread
From: Xing, Beilei @ 2017-12-20  3:20 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: dev


> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, December 19, 2017 9:21 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/i40e: fix FDIR input set conflict
> 
> 
> 
> > -----Original Message-----
> > From: Xing, Beilei
> > Sent: Monday, December 18, 2017 1:21 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org
> > Subject: [PATCH] net/i40e: fix FDIR input set conflict
> >
> > The first FDIR rule for some PCTYPE will configure input set and
> > create flow, the following flows must use the same input set,
> > otherwise will cause input set conflict and fail to create flow.
> > But if creating the first rule after flow flush, input set should be
> > re-configured.
> >
> > Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR")
> > c: stable@dpdk.org
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> > ---
> >  drivers/net/i40e/i40e_flow.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_flow.c
> > b/drivers/net/i40e/i40e_flow.c index 7e4936e..a9e7a0d 100644
> > --- a/drivers/net/i40e/i40e_flow.c
> > +++ b/drivers/net/i40e/i40e_flow.c
> > @@ -4406,6 +4406,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
> >  	struct rte_eth_dev *dev = pf->adapter->eth_dev;
> >  	struct i40e_fdir_info *fdir_info = &pf->fdir;
> >  	struct i40e_fdir_filter *fdir_filter;
> > +	enum i40e_filter_pctype pctype;
> >  	struct rte_flow *flow;
> >  	void *temp;
> >  	int ret;
> > @@ -4427,6 +4428,10 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
> >  				rte_free(flow);
> >  			}
> >  		}
> > +
> > +		for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
> > +		     pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
> > +			pf->fdir.inset_flag[pctype] = 0;
> >  	}
> >
> >  	return ret;
> > --
> > 2.5.5
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> BTW, do we also need a fix for flow destroy? When the last flow that use
> input set be destroyed, inset_flag also need to be reset?

Thanks for the comments.
Actually input set re-configuration after flow flush is required by customer. But for the above case, in my opinion, it's not needed currently. For i40e, rte flow includes input set configuration and creating flow, we'd better to keep the global configuration.

> 
> Regards
> Qi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict
  2017-12-19 13:20 ` Zhang, Qi Z
  2017-12-20  3:20   ` Xing, Beilei
@ 2017-12-20  8:24   ` Zhang, Helin
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Helin @ 2017-12-20  8:24 UTC (permalink / raw)
  To: Zhang, Qi Z, Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Tuesday, December 19, 2017 9:21 PM
> To: Xing, Beilei
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict
> 
> 
> 
> > -----Original Message-----
> > From: Xing, Beilei
> > Sent: Monday, December 18, 2017 1:21 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org
> > Subject: [PATCH] net/i40e: fix FDIR input set conflict
> >
> > The first FDIR rule for some PCTYPE will configure input set and
> > create flow, the following flows must use the same input set,
> > otherwise will cause input set conflict and fail to create flow.
> > But if creating the first rule after flow flush, input set should be
> > re-configured.
> >
> > Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR")
> > c: stable@dpdk.org
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> > ---
> >  drivers/net/i40e/i40e_flow.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_flow.c
> > b/drivers/net/i40e/i40e_flow.c index 7e4936e..a9e7a0d 100644
> > --- a/drivers/net/i40e/i40e_flow.c
> > +++ b/drivers/net/i40e/i40e_flow.c
> > @@ -4406,6 +4406,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
> >  	struct rte_eth_dev *dev = pf->adapter->eth_dev;
> >  	struct i40e_fdir_info *fdir_info = &pf->fdir;
> >  	struct i40e_fdir_filter *fdir_filter;
> > +	enum i40e_filter_pctype pctype;
> >  	struct rte_flow *flow;
> >  	void *temp;
> >  	int ret;
> > @@ -4427,6 +4428,10 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
> >  				rte_free(flow);
> >  			}
> >  		}
> > +
> > +		for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
> > +		     pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++)
> > +			pf->fdir.inset_flag[pctype] = 0;
> >  	}
> >
> >  	return ret;
> > --
> > 2.5.5
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to next-net-intel, thanks! /Helin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-20  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18  5:20 [dpdk-dev] [PATCH] net/i40e: fix FDIR input set conflict Beilei Xing
2017-12-19 13:20 ` Zhang, Qi Z
2017-12-20  3:20   ` Xing, Beilei
2017-12-20  8:24   ` Zhang, Helin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).