test/mbuf: fix virtual address conversion
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 5 Jul 2021 07:27:34 +0000 (09:27 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 6 Jul 2021 14:41:13 +0000 (16:41 +0200)
Seen with address sanitizer.

rte_mempool_virt2iova() can only be used on mempool elements. In this case,
it is incorrect, and rte_mem_virt2iova() has to be used.

Bugzilla ID: 737
Fixes: 7b295dceea07 ("test/mbuf: add unit test cases")
Cc: stable@dpdk.org
Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
app/test/test_mbuf.c

index 8e0561e..9a248df 100644 (file)
@@ -2363,7 +2363,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
        if (rte_mbuf_refcnt_read(m) != 1)
                GOTO_FAIL("%s: Invalid refcnt in mbuf\n", __func__);
 
-       buf_iova = rte_mempool_virt2iova(ext_buf_addr);
+       buf_iova = rte_mem_virt2iova(ext_buf_addr);
        rte_pktmbuf_attach_extbuf(m, ext_buf_addr, buf_iova, buf_len,
                ret_shinfo);
        if (m->ol_flags != EXT_ATTACHED_MBUF)