[2/2] net/bnxt: fix check for null spec and mask

Message ID 20191120042907.1030-2-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series [1/2] doc: update bnxt feature list |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail apply issues

Commit Message

Ajit Khaparde Nov. 20, 2019, 4:29 a.m. UTC
  bnxt_validate_and_parse_flow_type already has protocol specific NULL
checks for rte_flow_item spec and mask and take actions accordingly.
A check at the top of the loop is redundant and is preventing the
protocol specific checks from being executed.

Fixes: b7e01f386059 ("net/bnxt: handle cleanup if flow creation fails")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 8 --------
 1 file changed, 8 deletions(-)
  

Comments

Ajit Khaparde Nov. 20, 2019, 5:01 a.m. UTC | #1
On Tue, Nov 19, 2019 at 8:29 PM Ajit Khaparde <ajit.khaparde@broadcom.com>
wrote:

> bnxt_validate_and_parse_flow_type already has protocol specific NULL
> checks for rte_flow_item spec and mask and take actions accordingly.
> A check at the top of the loop is redundant and is preventing the
> protocol specific checks from being executed.
>
> Fixes: b7e01f386059 ("net/bnxt: handle cleanup if flow creation fails")
>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Santoshkumar Karanappa Rastapur <
> santosh.rastapur@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
>
Patch applied to dpdk-next-net-brcm.


> ---
>  drivers/net/bnxt/bnxt_flow.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> index 5af571448..76e9584da 100644
> --- a/drivers/net/bnxt/bnxt_flow.c
> +++ b/drivers/net/bnxt/bnxt_flow.c
> @@ -177,14 +177,6 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
>                         return -rte_errno;
>                 }
>
> -               if (!item->spec || !item->mask) {
> -                       rte_flow_error_set(error, EINVAL,
> -                                          RTE_FLOW_ERROR_TYPE_ITEM,
> -                                          item,
> -                                          "spec/mask is NULL");
> -                       return -rte_errno;
> -               }
> -
>                 switch (item->type) {
>                 case RTE_FLOW_ITEM_TYPE_ANY:
>                         inner =
> --
> 2.21.0 (Apple Git-122.2)
>
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 5af571448..76e9584da 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -177,14 +177,6 @@  bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			return -rte_errno;
 		}
 
-		if (!item->spec || !item->mask) {
-			rte_flow_error_set(error, EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ITEM,
-					   item,
-					   "spec/mask is NULL");
-			return -rte_errno;
-		}
-
 		switch (item->type) {
 		case RTE_FLOW_ITEM_TYPE_ANY:
 			inner =