Skip to content

Commit

Permalink
test/mbuf: fix external mbuf case with assert enabled
Browse files Browse the repository at this point in the history
[ upstream commit 6dbaa4ee67135ac6ff8ef35fa98a93e0f08af494 ]

when RTE_ENABLE_ASSERT is defined test_mbuf application is
failing because we are trying to attach extbuf to a cloned
buffer to which external mbuf is already attached.
To make test_mbuf pass CI we have updated ol_flags.
This patch fixes the same.

Fixes: 7b295dc ("test/mbuf: add unit test cases")

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
  • Loading branch information
Rakesh Kudurumalla authored and bluca committed Mar 13, 2024
1 parent 0426b17 commit af4304e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/test/test_mbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2345,16 +2345,13 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
__func__);

/* allocate one more mbuf */
/* allocate one more mbuf, it is attached to the same external buffer */
clone = rte_pktmbuf_clone(m, pktmbuf_pool);
if (clone == NULL)
GOTO_FAIL("%s: mbuf clone allocation failed!\n", __func__);
if (rte_pktmbuf_pkt_len(clone) != 0)
GOTO_FAIL("%s: Bad packet length\n", __func__);

/* attach the same external buffer to the cloned mbuf */
rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
ret_shinfo);
if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)
GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
__func__);
Expand Down

0 comments on commit af4304e

Please sign in to comment.