Skip to content

Commit

Permalink
net/cnxk: fix DF bit in vector mode
Browse files Browse the repository at this point in the history
[ upstream commit 8a96c7f ]

In vector mode, DF bit is not programmed correctly, as the
return value of vsetq_lane_u64() is ignored, which actually
contains the updated value, leading HW to free mbufs though
NIX_TX_OFFLOAD_MBUF_NOFF_F flag is set.

Hence, save return value of vsetq_lane_u64() appropriately so
that DF bit is programmed correctly.

Fixes: 862e281 ("net/cnxk: add vector Tx for CN9K")
Fixes: f71b7db ("net/cnxk: add vector Tx for CN10K")

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
  • Loading branch information
hpothula-git authored and kevintraynor committed Oct 11, 2022
1 parent d141aba commit 1747e29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions drivers/net/cnxk/cn10k_tx.h
Expand Up @@ -2350,28 +2350,28 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
mbuf3 = (uint64_t *)tx_pkts[3];

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf0))
vsetq_lane_u64(0x80000, xmask01, 0);
xmask01 = vsetq_lane_u64(0x80000, xmask01, 0);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf0)->pool,
(void **)&mbuf0, 1, 0);

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf1))
vsetq_lane_u64(0x80000, xmask01, 1);
xmask01 = vsetq_lane_u64(0x80000, xmask01, 1);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf1)->pool,
(void **)&mbuf1, 1, 0);

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf2))
vsetq_lane_u64(0x80000, xmask23, 0);
xmask23 = vsetq_lane_u64(0x80000, xmask23, 0);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf2)->pool,
(void **)&mbuf2, 1, 0);

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf3))
vsetq_lane_u64(0x80000, xmask23, 1);
xmask23 = vsetq_lane_u64(0x80000, xmask23, 1);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf3)->pool,
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/cnxk/cn9k_tx.h
Expand Up @@ -1625,28 +1625,28 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
mbuf3 = (uint64_t *)tx_pkts[3];

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf0))
vsetq_lane_u64(0x80000, xmask01, 0);
xmask01 = vsetq_lane_u64(0x80000, xmask01, 0);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf0)->pool,
(void **)&mbuf0, 1, 0);

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf1))
vsetq_lane_u64(0x80000, xmask01, 1);
xmask01 = vsetq_lane_u64(0x80000, xmask01, 1);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf1)->pool,
(void **)&mbuf1, 1, 0);

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf2))
vsetq_lane_u64(0x80000, xmask23, 0);
xmask23 = vsetq_lane_u64(0x80000, xmask23, 0);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf2)->pool,
(void **)&mbuf2, 1, 0);

if (cnxk_nix_prefree_seg((struct rte_mbuf *)mbuf3))
vsetq_lane_u64(0x80000, xmask23, 1);
xmask23 = vsetq_lane_u64(0x80000, xmask23, 1);
else
RTE_MEMPOOL_CHECK_COOKIES(
((struct rte_mbuf *)mbuf3)->pool,
Expand Down

0 comments on commit 1747e29

Please sign in to comment.