On 3/5/2018 4:42 PM, Reshma Pattan wrote:
Inside test_reorder_insert()
rte_mempool_get_bulk() and rte_mempool_put_bulk() are used
to allocate and free the mbufs and then rte_reorder_free()
is called which again freeing the mbufs using rte_pktmbuf_free().

The mixed use of rte_mempool_put_bulk() and rte_pktmbuf_free()
causing duplicate mbufs to be created when rte_mempool_get_bulk()
is called next in test_reorder_drain().

Since reorder library is taking care of freeing the mbufs
using rte_pktmbuf_free() change UT to allocate mbufs using
rte_pktmbuf_alloc().

Do not mix and match the bulk get/put APIs with
alloc/free APIs which can cause undefined behavior.

Fixes: d0c9b58d71 ("app/test: new reorder unit test")

--snip--

Could I also suggest the following text for the commit message:

app/test: fix reorder test failure

mbufs are being freed twice in error, once in rte_mempool_put_bulk()
and then in rte_reorder_free(). Refactor the code so that we use
rte_reorder_free() to free mbufs in the reorder buffer, and
use rte_pktmbuf_free() to free any unused or drained mbufs.

Rgds,
Dave.

Reply via email to