[v3,1/1] app/test: fix external mbuf test when assertions enabled

Message ID 20231123064221.509668-1-rkudurumalla@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3,1/1] app/test: fix external mbuf test when assertions enabled |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Rakesh Kudurumalla Nov. 23, 2023, 6:42 a.m. UTC
  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: 7b295dceea07 ("test/mbuf: add unit test cases")

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
v3: Updated commit message and added Fixes
 app/test/test_mbuf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Thomas Monjalon March 6, 2024, 5:37 p.m. UTC | #1
23/11/2023 07:42, Rakesh Kudurumalla:
> 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: 7b295dceea07 ("test/mbuf: add unit test cases")
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks.
  

Patch

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index d7393df7eb..a39288a5f8 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -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__);