Skip to content

Commit

Permalink
net/cnxk: fix cookies check with security offload
Browse files Browse the repository at this point in the history
[ upstream commit 7364015fefd308ac89565fc78a4b910e83546422 ]

Fix missing/incorrect check cookies call's with security offload
enabled on Rx and Tx.

Fixes: 55bfac7 ("net/cnxk: support Tx security offload on cn10k")
Fixes: 0ed7107 ("net/cnxk: remove duplicate mempool debug checks")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
  • Loading branch information
nithind1988 authored and kevintraynor committed Jul 12, 2023
1 parent dd0782d commit 988a65a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/cnxk/cn10k_rx.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,12 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
mbuf2 = (struct rte_mbuf *)vgetq_lane_u64(mbuf23, 0);
mbuf3 = (struct rte_mbuf *)vgetq_lane_u64(mbuf23, 1);

/* Mark mempool obj as "get" as it is alloc'ed by NIX */
RTE_MEMPOOL_CHECK_COOKIES(mbuf0->pool, (void **)&mbuf0, 1, 1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf1->pool, (void **)&mbuf1, 1, 1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf2->pool, (void **)&mbuf2, 1, 1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf3->pool, (void **)&mbuf3, 1, 1);

/* Mask to get packet len from NIX_RX_SG_S */
const uint8x16_t shuf_msk = {
0xFF, 0xFF, /* pkt_type set as unknown */
Expand Down Expand Up @@ -914,12 +920,6 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
roc_prefetch_store_keep(mbuf2);
roc_prefetch_store_keep(mbuf3);

/* Mark mempool obj as "get" as it is alloc'ed by NIX */
RTE_MEMPOOL_CHECK_COOKIES(mbuf0->pool, (void **)&mbuf0, 1, 1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf1->pool, (void **)&mbuf1, 1, 1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf2->pool, (void **)&mbuf2, 1, 1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf3->pool, (void **)&mbuf3, 1, 1);

packets += NIX_DESCS_PER_LOOP;

if (!(flags & NIX_RX_VWQE_F)) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/cnxk/cn10k_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1465,10 +1465,12 @@ cn10k_nix_xmit_store(struct rte_mbuf *mbuf, uint8_t segdw, uintptr_t laddr,
vst1q_u64(LMT_OFF(laddr, 0, 16), cmd2);
vst1q_u64(LMT_OFF(laddr, 0, 32), cmd1);
}
RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 0);
} else {
/* Store the prepared send desc to LMT lines */
vst1q_u64(LMT_OFF(laddr, 0, 0), cmd0);
vst1q_u64(LMT_OFF(laddr, 0, 16), cmd1);
RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 0);
}
}

Expand Down

0 comments on commit 988a65a

Please sign in to comment.