net/bnxt: allow the mark to use a cfa code of zero
diff mbox series

Message ID 1590191701-8420-1-git-send-email-michael.baucom@broadcom.com
State Awaiting Upstream
Delegated to: Ajit Khaparde
Headers show
Series
  • net/bnxt: allow the mark to use a cfa code of zero
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-testing fail Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Mike Baucom May 22, 2020, 11:55 p.m. UTC
The mark code was too restrictive by disallowing a cfa_code of zero.
This code loosens the requirement and allows zero.

Fixes: b87abb2e55cb ("net/bnxt: support marking packet")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

Comments

Ajit Khaparde May 23, 2020, 3:52 a.m. UTC | #1
On Fri, May 22, 2020 at 4:55 PM Mike Baucom <michael.baucom@broadcom.com>
wrote:

> The mark code was too restrictive by disallowing a cfa_code of zero.
> This code loosens the requirement and allows zero.
>
> Fixes: b87abb2e55cb ("net/bnxt: support marking packet")
>
> Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
> Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
>
Applied to dpdk-next-net-brcm with updated commit headline [1].

[1] net/bnxt: fix mark action

> ---
>  drivers/net/bnxt/bnxt_rxr.c | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index ee1acb1..91ff729 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -465,17 +465,15 @@ static inline struct rte_mbuf *bnxt_tpa_end(
>                 break;
>         }
>
> -       if (cfa_code) {
> -               rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
> -                                         cfa_code, &mark_id);
> -               if (!rc) {
> -                       /* Got the mark, write it to the mbuf and return */
> -                       mbuf->hash.fdir.hi = mark_id;
> -                       mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
> -                       mbuf->hash.fdir.id = rxcmp1->cfa_code;
> -                       mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
> -                       return;
> -               }
> +       rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
> +                                 cfa_code, &mark_id);
> +       if (!rc) {
> +               /* Got the mark, write it to the mbuf and return */
> +               mbuf->hash.fdir.hi = mark_id;
> +               mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
> +               mbuf->hash.fdir.id = rxcmp1->cfa_code;
> +               mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
> +               return;
>         }
>
>  skip_mark:
> --
> 1.9.1
>
>

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index ee1acb1..91ff729 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -465,17 +465,15 @@  static inline struct rte_mbuf *bnxt_tpa_end(
 		break;
 	}
 
-	if (cfa_code) {
-		rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
-					  cfa_code, &mark_id);
-		if (!rc) {
-			/* Got the mark, write it to the mbuf and return */
-			mbuf->hash.fdir.hi = mark_id;
-			mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
-			mbuf->hash.fdir.id = rxcmp1->cfa_code;
-			mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
-			return;
-		}
+	rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
+				  cfa_code, &mark_id);
+	if (!rc) {
+		/* Got the mark, write it to the mbuf and return */
+		mbuf->hash.fdir.hi = mark_id;
+		mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
+		mbuf->hash.fdir.id = rxcmp1->cfa_code;
+		mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
+		return;
 	}
 
 skip_mark: