patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2] net/i40e: fix issue for RSS flow API
       [not found] <20180123064302.118082-1-wei.zhao1@intel.com>
@ 2018-01-26  3:08 ` Wei Zhao
  2018-01-26  7:32   ` Zhang, Qi Z
  2018-01-26  8:43   ` [dpdk-stable] [PATCH v3] " Wei Zhao
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Zhao @ 2018-01-26  3:08 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, stable, 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

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

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(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5ea9f99..b0db458 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -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,
-- 
2.9.3

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

* Re: [dpdk-stable] [PATCH v2] net/i40e: fix issue for RSS flow API
  2018-01-26  3:08 ` [dpdk-stable] [PATCH v2] net/i40e: fix issue for RSS flow API Wei Zhao
@ 2018-01-26  7:32   ` Zhang, Qi Z
  2018-01-26  8:43   ` [dpdk-stable] [PATCH v3] " Wei Zhao
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2018-01-26  7:32 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Friday, January 26, 2018 11:08 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Zhao1, Wei
> <wei.zhao1@intel.com>
> 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
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> ---
> 
> 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(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 5ea9f99..b0db458 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -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
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -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,
> --
> 2.9.3

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

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

* [dpdk-stable] [PATCH v3] net/i40e: fix issue for RSS flow API
  2018-01-26  3:08 ` [dpdk-stable] [PATCH v2] net/i40e: fix issue for RSS flow API Wei Zhao
  2018-01-26  7:32   ` Zhang, Qi Z
@ 2018-01-26  8:43   ` Wei Zhao
  1 sibling, 0 replies; 3+ messages in thread
From: Wei Zhao @ 2018-01-26  8:43 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, stable, 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")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

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(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5ea9f99..b0db458 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -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,
-- 
2.9.3

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

end of thread, other threads:[~2018-01-26  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180123064302.118082-1-wei.zhao1@intel.com>
2018-01-26  3:08 ` [dpdk-stable] [PATCH v2] net/i40e: fix issue for RSS flow API Wei Zhao
2018-01-26  7:32   ` Zhang, Qi Z
2018-01-26  8:43   ` [dpdk-stable] [PATCH v3] " Wei Zhao

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).