net/bnxt: fix mark action if rule is at index zero
authorMike Baucom <michael.baucom@broadcom.com>
Fri, 22 May 2020 23:55:01 +0000 (19:55 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 28 May 2020 15:57:07 +0000 (17:57 +0200)
In the ingress path, the cfa_code field in Rx completion identifies the
CFA action rule that was used for the incoming packet. It is possible
that the packet could hit the rule at index 0 in the table.
The mark action 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")
Cc: stable@dpdk.org
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_rxr.c

index ee1acb1..91ff729 100644 (file)
@@ -465,17 +465,15 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
                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: