DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error
@ 2018-03-21  7:25 Wei Zhao
  2018-03-22 12:39 ` Zhang, Qi Z
  2018-03-26  1:11 ` [dpdk-dev] [PATCH v3] " Wei Zhao
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Zhao @ 2018-03-21  7:25 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, Wei Zhao

I40e need a protection for rss rule flow configuration
after one rule is set for a port.

Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Peng Yuan <yuan.peng@intel.com>
---
Changes in v2:

 change fixes version number.
---
 drivers/net/i40e/i40e_flow.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 16c47cf..7268426 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4385,14 +4385,15 @@ i40e_config_rss_filter_set(struct rte_eth_dev *dev,
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int ret = -ENOTSUP;
 
 	if (conf->queue_region_conf) {
-		i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
+		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
 		conf->queue_region_conf = 0;
 	} else {
-		i40e_config_rss_filter(pf, conf, 1);
+		ret = i40e_config_rss_filter(pf, conf, 1);
 	}
-	return 0;
+	return ret;
 }
 
 static int
@@ -4545,6 +4546,8 @@ i40e_flow_create(struct rte_eth_dev *dev,
 	case RTE_ETH_FILTER_HASH:
 		ret = i40e_config_rss_filter_set(dev,
 			    &cons_filter.rss_conf);
+		if (ret)
+			goto free_flow;
 		flow->rule = &pf->rss_info;
 		break;
 	default:
-- 
2.7.5

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

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error
  2018-03-21  7:25 [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error Wei Zhao
@ 2018-03-22 12:39 ` Zhang, Qi Z
  2018-03-23  1:33   ` Zhao1, Wei
  2018-03-26  1:11 ` [dpdk-dev] [PATCH v3] " Wei Zhao
  1 sibling, 1 reply; 6+ messages in thread
From: Zhang, Qi Z @ 2018-03-22 12:39 UTC (permalink / raw)
  To: Zhao1, Wei, dev



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, March 21, 2018 3:25 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH v2] net/i40e: fix flow RSS configuration error
> 
> I40e need a protection for rss rule flow configuration after one rule is set for a
> port.
> 
> Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> Tested-by: Peng Yuan <yuan.peng@intel.com>
> ---
> Changes in v2:
> 
>  change fixes version number.
> ---
>  drivers/net/i40e/i40e_flow.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 16c47cf..7268426 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4385,14 +4385,15 @@ i40e_config_rss_filter_set(struct rte_eth_dev
> *dev,  {
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  	struct i40e_hw *hw =
> I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	int ret = -ENOTSUP;

Why ret be initialized to -ENOTSUP?, there is no default behavior needed here.
> 
>  	if (conf->queue_region_conf) {
> -		i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
> +		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
>  		conf->queue_region_conf = 0;
>  	} else {
> -		i40e_config_rss_filter(pf, conf, 1);
> +		ret = i40e_config_rss_filter(pf, conf, 1);
>  	}
> -	return 0;
> +	return ret;
>  }
> 
>  static int
> @@ -4545,6 +4546,8 @@ i40e_flow_create(struct rte_eth_dev *dev,
>  	case RTE_ETH_FILTER_HASH:
>  		ret = i40e_config_rss_filter_set(dev,
>  			    &cons_filter.rss_conf);
> +		if (ret)
> +			goto free_flow;
>  		flow->rule = &pf->rss_info;
>  		break;
>  	default:
> --
> 2.7.5

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

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error
  2018-03-22 12:39 ` Zhang, Qi Z
@ 2018-03-23  1:33   ` Zhao1, Wei
  0 siblings, 0 replies; 6+ messages in thread
From: Zhao1, Wei @ 2018-03-23  1:33 UTC (permalink / raw)
  To: Zhang, Qi Z, dev



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Thursday, March 22, 2018 8:39 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Subject: RE: [PATCH v2] net/i40e: fix flow RSS configuration error
> 
> 
> 
> > -----Original Message-----
> > From: Zhao1, Wei
> > Sent: Wednesday, March 21, 2018 3:25 PM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [PATCH v2] net/i40e: fix flow RSS configuration error
> >
> > I40e need a protection for rss rule flow configuration after one rule
> > is set for a port.
> >
> > Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > Tested-by: Peng Yuan <yuan.peng@intel.com>
> > ---
> > Changes in v2:
> >
> >  change fixes version number.
> > ---
> >  drivers/net/i40e/i40e_flow.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_flow.c
> > b/drivers/net/i40e/i40e_flow.c index
> > 16c47cf..7268426 100644
> > --- a/drivers/net/i40e/i40e_flow.c
> > +++ b/drivers/net/i40e/i40e_flow.c
> > @@ -4385,14 +4385,15 @@ i40e_config_rss_filter_set(struct rte_eth_dev
> > *dev,  {
> >  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
> >  	struct i40e_hw *hw =
> > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > +	int ret = -ENOTSUP;
> 
> Why ret be initialized to -ENOTSUP?, there is no default behavior needed
> here.

Yes, I will commit a new v3 later.

> >
> >  	if (conf->queue_region_conf) {
> > -		i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
> > +		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
> >  		conf->queue_region_conf = 0;
> >  	} else {
> > -		i40e_config_rss_filter(pf, conf, 1);
> > +		ret = i40e_config_rss_filter(pf, conf, 1);
> >  	}
> > -	return 0;
> > +	return ret;
> >  }
> >
> >  static int
> > @@ -4545,6 +4546,8 @@ i40e_flow_create(struct rte_eth_dev *dev,
> >  	case RTE_ETH_FILTER_HASH:
> >  		ret = i40e_config_rss_filter_set(dev,
> >  			    &cons_filter.rss_conf);
> > +		if (ret)
> > +			goto free_flow;
> >  		flow->rule = &pf->rss_info;
> >  		break;
> >  	default:
> > --
> > 2.7.5

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

* [dpdk-dev] [PATCH v3] net/i40e: fix flow RSS configuration error
  2018-03-21  7:25 [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error Wei Zhao
  2018-03-22 12:39 ` Zhang, Qi Z
@ 2018-03-26  1:11 ` Wei Zhao
  2018-03-26  3:31   ` Zhang, Qi Z
  1 sibling, 1 reply; 6+ messages in thread
From: Wei Zhao @ 2018-03-26  1:11 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, Wei Zhao

I40e need a protection for rss rule flow configuration
after one rule is set for a port.

Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Peng Yuan <yuan.peng@intel.com>
---
Changes in v2:

 change fixes version number.

Changes in v3:

 change ret default number.
---
 drivers/net/i40e/i40e_flow.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 16c47cf..69d1ba5 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -4385,14 +4385,15 @@ i40e_config_rss_filter_set(struct rte_eth_dev *dev,
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int ret;
 
 	if (conf->queue_region_conf) {
-		i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
+		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
 		conf->queue_region_conf = 0;
 	} else {
-		i40e_config_rss_filter(pf, conf, 1);
+		ret = i40e_config_rss_filter(pf, conf, 1);
 	}
-	return 0;
+	return ret;
 }
 
 static int
@@ -4545,6 +4546,8 @@ i40e_flow_create(struct rte_eth_dev *dev,
 	case RTE_ETH_FILTER_HASH:
 		ret = i40e_config_rss_filter_set(dev,
 			    &cons_filter.rss_conf);
+		if (ret)
+			goto free_flow;
 		flow->rule = &pf->rss_info;
 		break;
 	default:
-- 
2.7.5

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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix flow RSS configuration error
  2018-03-26  1:11 ` [dpdk-dev] [PATCH v3] " Wei Zhao
@ 2018-03-26  3:31   ` Zhang, Qi Z
  2018-03-27 13:56     ` Zhang, Helin
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang, Qi Z @ 2018-03-26  3:31 UTC (permalink / raw)
  To: Zhao1, Wei, dev

> -----Original Message-----
> From: Zhao1, Wei
> Sent: Monday, March 26, 2018 9:12 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH v3] net/i40e: fix flow RSS configuration error
> 
> I40e need a protection for rss rule flow configuration after one rule is set for a
> port.
> 
> Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

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

> Tested-by: Peng Yuan <yuan.peng@intel.com>
> ---
> Changes in v2:
> 
>  change fixes version number.
> 
> Changes in v3:
> 
>  change ret default number.
> ---
>  drivers/net/i40e/i40e_flow.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 16c47cf..69d1ba5 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -4385,14 +4385,15 @@ i40e_config_rss_filter_set(struct rte_eth_dev
> *dev,  {
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  	struct i40e_hw *hw =
> I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	int ret;
> 
>  	if (conf->queue_region_conf) {
> -		i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
> +		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
>  		conf->queue_region_conf = 0;
>  	} else {
> -		i40e_config_rss_filter(pf, conf, 1);
> +		ret = i40e_config_rss_filter(pf, conf, 1);
>  	}
> -	return 0;
> +	return ret;
>  }
> 
>  static int
> @@ -4545,6 +4546,8 @@ i40e_flow_create(struct rte_eth_dev *dev,
>  	case RTE_ETH_FILTER_HASH:
>  		ret = i40e_config_rss_filter_set(dev,
>  			    &cons_filter.rss_conf);
> +		if (ret)
> +			goto free_flow;
>  		flow->rule = &pf->rss_info;
>  		break;
>  	default:
> --
> 2.7.5

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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix flow RSS configuration error
  2018-03-26  3:31   ` Zhang, Qi Z
@ 2018-03-27 13:56     ` Zhang, Helin
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Helin @ 2018-03-27 13:56 UTC (permalink / raw)
  To: Zhang, Qi Z, Zhao1, Wei, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Monday, March 26, 2018 11:31 AM
> To: Zhao1, Wei; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix flow RSS configuration error
> 
> > -----Original Message-----
> > From: Zhao1, Wei
> > Sent: Monday, March 26, 2018 9:12 AM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [PATCH v3] net/i40e: fix flow RSS configuration error
> >
> > I40e need a protection for rss rule flow configuration after one rule
> > is set for a port.
> >
> > Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> > Tested-by: Peng Yuan <yuan.peng@intel.com>
Applied to dpdk-next-net-intel, thanks!

/Helin

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

end of thread, other threads:[~2018-03-27 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21  7:25 [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error Wei Zhao
2018-03-22 12:39 ` Zhang, Qi Z
2018-03-23  1:33   ` Zhao1, Wei
2018-03-26  1:11 ` [dpdk-dev] [PATCH v3] " Wei Zhao
2018-03-26  3:31   ` Zhang, Qi Z
2018-03-27 13:56     ` 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).