Skip to contentSkip to conversation

net/i40e: fix flow RSS configuration error

PATCH Superseded Wei Zhao 3 participants 6 messages Mar 21, 2018 – Mar 27, 2018 Network drivers

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH v2 1/1 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")

---
Changes in v2:

change fixes version number.

---
 drivers/net/i40e/i40e_flow.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c +6 -3
index 16c47cf..7268426 100644
@@ -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:
Signature · 1 line
2.7.5
#1 lore raw
Quoted 28 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, March 21, 2018 3:25 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
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")

---
Changes in v2:

change fixes version number.

---
 drivers/net/i40e/i40e_flow.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_flow.c index renamed from drivers/net/i40e/i40e_flow.c +0 -0

16c47cf..7268426 100644

drivers/net/i40e/i40e_flow.c i40e_config_rss_filter_set(struct rte_eth_dev · line 4389

Quoted 5 lines
drivers/net/i40e/i40e_flow.c +1 -0
@@ -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.

Quoted 25 lines
drivers/net/i40e/i40e_flow.c +5 -4
 	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

author
#2 lore raw
Quoted 32 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, March 22, 2018 8:39 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH v2] net/i40e: fix flow RSS configuration error

Quoted 22 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, March 21, 2018 3:25 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
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")

---
Changes in v2:

change fixes version number.

---
 drivers/net/i40e/i40e_flow.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Quoted 15 lines

drivers/net/i40e/i40e_flow.c i40e_config_rss_filter_set(struct rte_eth_dev · line 4390

Quoted 12 lines
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_flow.c index
16c47cf..7268426 100644

drivers/net/i40e/i40e_flow.c +1 -0
@@ -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.

Quoted 25 lines
Quoted 25 lines
drivers/net/i40e/i40e_flow.c +3 -3
 	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

drivers/net/i40e/i40e_flow.c +2 -1
@@ -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

author
#3 lore raw

PATCH v3 1/1 net/i40e: fix flow RSS configuration error

In reply to 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")

---
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(-)
drivers/net/i40e/i40e_flow.c +6 -3
index 16c47cf..69d1ba5 100644
@@ -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:
Signature · 1 line
2.7.5
Acked-by on v3 1/1
#4 lore raw
Quoted 7 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Monday, March 26, 2018 9:12 AM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v3] net/i40e: fix flow RSS configuration error

Quoted 5 lines

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")
Quoted 48 lines

---
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(-)
drivers/net/i40e/i40e_flow.c index renamed from drivers/net/i40e/i40e_flow.c +0 -0

16c47cf..69d1ba5 100644

drivers/net/i40e/i40e_flow.c +4 -3
@@ -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

drivers/net/i40e/i40e_flow.c +2 -1
@@ -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

Applied
#5 lore raw
Quoted 16 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Zhang, Qi Z
Sent: Monday, March 26, 2018 11:31 AM
To: Zhao1, Wei; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix flow RSS configuration error

Quoted 8 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Monday, March 26, 2018 9:12 AM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v3] net/i40e: fix flow RSS configuration error

Quoted 9 lines
Quoted 5 lines

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")
Quoted 1 line

Applied to dpdk-next-net-intel, thanks!

/Helin