net/cnxk: fix later skip to include mbuf private data

Fix later skip to include mbuf priv data as mbuf->buf_addr
is populated based on calculation including per-mbuf priv area.

Fixes: 706eeae607 ("net/cnxk: add multi-segment Rx for CN10K")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
This commit is contained in:
Nithin Dabilpuram 2022-10-14 11:13:07 +05:30 committed by Jerin Jacob
parent aa728ea474
commit 480b03be9d
2 changed files with 4 additions and 2 deletions

View File

@ -682,6 +682,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf,
uint64_t rearm, const uint16_t flags)
{
const rte_iova_t *iova_list;
uint16_t later_skip = 0;
struct rte_mbuf *head;
const rte_iova_t *eol;
uint8_t nb_segs;
@ -720,10 +721,11 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf,
nb_segs--;
rearm = rearm & ~0xFFFF;
later_skip = (uintptr_t)mbuf->buf_addr - (uintptr_t)mbuf;
head = mbuf;
while (nb_segs) {
mbuf->next = ((struct rte_mbuf *)*iova_list) - 1;
mbuf->next = (struct rte_mbuf *)(*iova_list - later_skip);
mbuf = mbuf->next;
RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);

View File

@ -680,7 +680,7 @@ cnxk_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,
first_skip += RTE_PKTMBUF_HEADROOM;
first_skip += rte_pktmbuf_priv_size(lpb_pool);
rq->first_skip = first_skip;
rq->later_skip = sizeof(struct rte_mbuf);
rq->later_skip = sizeof(struct rte_mbuf) + rte_pktmbuf_priv_size(mp);
rq->lpb_size = lpb_pool->elt_size;
if (roc_errata_nix_no_meta_aura())
rq->lpb_drop_ena = !(dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY);