From: Mike Baucom Date: Fri, 22 May 2020 23:55:01 +0000 (-0400) Subject: net/bnxt: fix mark action if rule is at index zero X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=2e449a26e7e81632dac39ff975081473c90e7b73 net/bnxt: fix mark action if rule is at index zero 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 Reviewed-by: Kishore Padmanabha Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index ee1acb1969..91ff729042 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -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: