Skip to contentSkip to conversation

net/i40e: fix issues for RSS flow API

PATCH Superseded Wei Zhao 3 participants 13 messages Jan 23, 2018 – Jan 30, 2018 Network drivers

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH 1/1 net/i40e: fix issues for RSS flow API

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API")

Coverity issues: 257020 257024 257037

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
index 5ea9f99..b0db458 100644
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf));
drivers/net/i40e/i40e_flow.c +2 -2
index cd9a9b6..a23f485 100644
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	rss = (const struct rte_flow_action_rss *)act->conf;
@@ -4219,7 +4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1;
@@ -4313,7 +4314,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}
 
 	if (!rss || !rss->num) {
Signature · 1 line
2.9.3
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix issues for RSS flow API

Quoted 6 lines

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issues:

257020 257024 257037

Acked-by Qi Zhang <[email protected]>

#2 lore raw
In reply to Wei Zhao

Hi Wei:

Quoted 49 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix issues for RSS flow API

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issues:

257020 257024 257037

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
index 5ea9f99..b0db458 100644
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf)); diff --git

a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index cd9a9b6..a23f485 100644

drivers/net/i40e/i40e_flow.c +1 -0
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
 *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);
drivers/net/i40e/i40e_flow.c +1 -1
 	rss = (const struct rte_flow_action_rss *)act->conf; @@ -4219,7
+4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {

drivers/net/i40e/i40e_flow.c

Quoted 10 lines
drivers/net/i40e/i40e_flow.c +2 -1
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1; @@ -4313,7
+4314,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}

Seems if you remove return 0, rss_config->queue_region_conf will be overwrite by FALSE at end, right?

Quoted 4 lines

if (!rss || !rss->num) {
--
2.9.3

#6 lore raw
In reply to Wei Zhao
Quoted 16 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, January 25, 2018 12:00 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Quoted 5 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei

<[email protected]>

Quoted 2 lines

Subject: [PATCH] net/i40e: fix issues for RSS flow API

Quoted 8 lines
Quoted 6 lines

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issues:

257020 257024 257037

Acked-by Qi Zhang <[email protected]>

Nacked-by Qi Zhang <[email protected]> since new issue is found, v2 is required.

author
#7 lore raw

Ok, v2 will commit later.

Quoted 33 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, January 25, 2018 2:12 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Quoted 14 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, January 25, 2018 12:00 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Quoted 5 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei

<[email protected]>

Quoted 2 lines

Subject: [PATCH] net/i40e: fix issues for RSS flow API

Quoted 8 lines
Quoted 6 lines

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issues:

257020 257024 257037

Acked-by Qi Zhang <[email protected]>

Nacked-by Qi Zhang <[email protected]> since new issue is found, v2 is required.

author
#8 lore raw

PATCH v2 1/1 net/i40e: fix issue for RSS flow API

In reply to Wei Zhao

This patch fix issue check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API")

Coverity issue: 257020 257024 257037

---

v2:
-fix an error introduced in v1 patch.

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
index 5ea9f99..b0db458 100644
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf));
drivers/net/i40e/i40e_flow.c +5 -2
index cd9a9b6..2cb9c64 100644
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	rss = (const struct rte_flow_action_rss *)act->conf;
@@ -4219,7 +4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1;
@@ -4313,9 +4314,11 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}
 
+	if (rss_config->queue_region_conf)
+		return 0;
+
 	if (!rss || !rss->num) {
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
Signature · 1 line
2.9.3
author
#3 lore raw
In reply to Zhang, Qi Z

Hi, zhang qi

V2 for this patch.
Thanks.
https://dpdk.org/dev/patchwork/patch/34533/

Quoted 77 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, January 25, 2018 1:40 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Hi Wei:

Quoted 44 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix issues for RSS flow API

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issues:

257020 257024 257037

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 5ea9f99..b0db458 100644

drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf)); diff --git

a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index cd9a9b6..a23f485 100644

drivers/net/i40e/i40e_flow.c +1 -0
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
 *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);

drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev,

Quoted 10 lines
drivers/net/i40e/i40e_flow.c +2 -1
 	rss = (const struct rte_flow_action_rss *)act->conf; @@ -4219,7
+4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1; @@ -

4313,7

drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev, · line 4317

Quoted 6 lines

+4314,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,

drivers/net/i40e/i40e_flow.c +0 -1
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}

Seems if you remove return 0, rss_config->queue_region_conf will be overwrite by FALSE at end, right?

Quoted 4 lines

if (!rss || !rss->num) {
--
2.9.3

Acked-by on v2 1/1
#9 lore raw

Re: [PATCH v2] net/i40e: fix issue for RSS flow API

In reply to Wei Zhao
Quoted 75 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Friday, January 26, 2018 11:08 AM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; [email protected]; Zhao1, Wei <[email protected]>
Subject: [PATCH v2] net/i40e: fix issue for RSS flow API

This patch fix issue check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issue:

257020 257024 257037

---

v2:

(quoted diff) +0 -2
-fix an error introduced in v1 patch.
---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
index 5ea9f99..b0db458 100644
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf)); diff --git

a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index cd9a9b6..2cb9c64 100644

drivers/net/i40e/i40e_flow.c +1 -0
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
 *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);
drivers/net/i40e/i40e_flow.c +6 -3
 	rss = (const struct rte_flow_action_rss *)act->conf; @@ -4219,7
+4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1; @@ -4313,9
+4314,11 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}
 
+	if (rss_config->queue_region_conf)
+		return 0;
+
 	if (!rss || !rss->num) {
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
--
Quoted 1 line

2.9.3

#4 lore raw
In reply to Zhao1, Wei

Hi Wei

I need your helps to rework the patch to follow the commit log styles other commits use. Please find some good examples via git log. Thanks!

/Helin

Quoted 89 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Zhao1, Wei
Sent: Friday, January 26, 2018 11:18 AM
To: Zhang, Qi Z; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix issues for RSS flow API

Hi, zhang qi

V2 for this patch.
Thanks.
https://dpdk.org/dev/patchwork/patch/34533/

Quoted 77 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, January 25, 2018 1:40 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Hi Wei:

Quoted 44 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix issues for RSS flow API

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity issues:

257020 257024 257037

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 5ea9f99..b0db458 100644

drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf)); diff --git

a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index cd9a9b6..a23f485 100644

drivers/net/i40e/i40e_flow.c +1 -0
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev
 *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);

drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev,

Quoted 10 lines
drivers/net/i40e/i40e_flow.c +2 -1
 	rss = (const struct rte_flow_action_rss *)act->conf; @@ -4219,7
+4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1; @@ -

4313,7

drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev, · line 4317

Quoted 6 lines

+4314,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,

drivers/net/i40e/i40e_flow.c +0 -1
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}

Seems if you remove return 0, rss_config->queue_region_conf will be overwrite by FALSE at end, right?

Quoted 4 lines

if (!rss || !rss->num) {
--
2.9.3

author
#10 lore raw

PATCH v3 1/1 net/i40e: fix issue for RSS flow API

In reply to Wei Zhao

This patch fix issue check from DPDK coverity issues.

Coverity issue: 257020, 257024, 257037

Fixes ecad87d22383e ("net/i40e: move RSS to flow API")

---

v2:
-fix an error introduced in v1 patch.

v3:
-change coverity writing style for DPDK rule.

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
index 5ea9f99..b0db458 100644
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf));
drivers/net/i40e/i40e_flow.c +5 -2
index cd9a9b6..2cb9c64 100644
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	rss = (const struct rte_flow_action_rss *)act->conf;
@@ -4219,7 +4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1;
@@ -4313,9 +4314,11 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}
 
+	if (rss_config->queue_region_conf)
+		return 0;
+
 	if (!rss || !rss->num) {
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
Signature · 1 line
2.9.3
author
#11 lore raw

PATCH v3 1/1 net/i40e: fix issue for RSS flow API

In reply to Wei Zhao

This patch fix issue check from DPDK coverity issues.

Coverity issue: 257020, 257024, 257037

Fixes ecad87d22383e ("net/i40e: move RSS to flow API")

---

v2:
-fix an error introduced in v1 patch.

v3:
-change coverity writing style for DPDK rule.

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
index 5ea9f99..b0db458 100644
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf));
drivers/net/i40e/i40e_flow.c +5 -2
index cd9a9b6..2cb9c64 100644
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	rss = (const struct rte_flow_action_rss *)act->conf;
@@ -4219,7 +4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1;
@@ -4313,9 +4314,11 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}
 
+	if (rss_config->queue_region_conf)
+		return 0;
+
 	if (!rss || !rss->num) {
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
Signature · 1 line
2.9.3
author
#5 lore raw
In reply to Zhang, Helin

Hi, helin

A new v3 has been commit, https://dpdk.org/dev/patchwork/patch/34546/

Thanks.

Quoted 105 lines

-----Original Message-----
From: Zhang, Helin
Sent: Friday, January 26, 2018 4:32 PM
To: Zhao1, Wei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Hi Wei

I need your helps to rework the patch to follow the commit log styles other commits use. Please find some good examples via git log. Thanks!

/Helin

Quoted 6 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Zhao1, Wei
Sent: Friday, January 26, 2018 11:18 AM
To: Zhang, Qi Z; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix issues for RSS flow API

Quoted 26 lines

Hi, zhang qi

V2 for this patch.
Thanks.
https://dpdk.org/dev/patchwork/patch/34533/

Quoted 20 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Thursday, January 25, 2018 1:40 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix issues for RSS flow API

Hi Wei:

Quoted 11 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, January 23, 2018 2:43 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH] net/i40e: fix issues for RSS flow API

This patch fix issues check from DPDK coverity issues.

Fixes ecad87d22383e ("net/i40e: move RSS to flow API") Coverity

issues:

Quoted 58 lines
Quoted 58 lines
Quoted 34 lines

257020 257024 257037

---
 drivers/net/i40e/i40e_ethdev.c | 2 +-
 drivers/net/i40e/i40e_flow.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 5ea9f99..b0db458 100644

drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -11681,7 +11681,7 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 							sizeof(uint32_t);
 	}
 
-	return i40e_hw_rss_hash_set(pf, &rss_conf);
+	i40e_hw_rss_hash_set(pf, &rss_conf);
 
 	rte_memcpy(rss_info,
 		conf, sizeof(struct i40e_rte_flow_rss_conf)); diff --git

a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
cd9a9b6..a23f485 100644

drivers/net/i40e/i40e_flow.c +1 -0
@@ -4201,6 +4201,7 @@ i40e_flow_parse_rss_action(struct
 rte_eth_dev *dev,
 	struct i40e_rte_flow_rss_conf *rss_info = &pf->rss_info;
 	uint16_t i, j, n, tmp;
 	uint32_t index = 0;
+	uint64_t hf_bit = 1;
 
 	NEXT_ITEM_OF_ACTION(act, actions, index);

drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev,

Quoted 10 lines
drivers/net/i40e/i40e_flow.c +2 -1
 	rss = (const struct rte_flow_action_rss *)act->conf; @@ -4219,7
+4220,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
 
 	if (action_flag) {
 		for (n = 0; n < 64; n++) {
-			if (rss->rss_conf->rss_hf & (1 << n)) {
+			if (rss->rss_conf->rss_hf & (hf_bit << n)) {
 				conf_info->region[0].hw_flowtype[0] = n;
 				conf_info->region[0].flowtype_num = 1;
 				conf_info->queue_region_number = 1; @@ -

4313,7

drivers/net/i40e/i40e_flow.c i40e_flow_parse_rss_action(struct rte_eth_dev *dev, · line 4317

Quoted 6 lines

+4314,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,

drivers/net/i40e/i40e_flow.c +0 -1
 		}
 
 		rss_config->queue_region_conf = TRUE;
-		return 0;
 	}

Seems if you remove return 0, rss_config->queue_region_conf will be overwrite by FALSE at end, right?

Quoted 4 lines

if (!rss || !rss->num) {
--
2.9.3

Applied
#12 lore raw

Re: [PATCH v3] net/i40e: fix issue for RSS flow API

In reply to Wei Zhao
Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wei Zhao
Sent: Friday, January 26, 2018 4:47 PM
To: [email protected]
Cc: Zhang, Qi Z; Zhao1, Wei
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix issue for RSS flow API

Quoted 7 lines

This patch fix issue check from DPDK coverity issues.

Coverity issue: 257020, 257024, 257037

Fixes ecad87d22383e ("net/i40e: move RSS to flow API")

Applied to dpdk-next-net-intel, with commit log changes. Thanks!

/Helin