app/testpmd: fix refcnt in mbuf allocation
app/testpmd: fix refcnt in mbuf allocation

test-pmd txonly leaks mbuf from the pool.
The function tx_mbuf_alloc() does not change the refcnt
and the refcnt is 0 when it is first allocated.
However, rte_pktmbuf_free_seg called by the driver's xmit code decrements
reference count to -1. So mbuf never goes back to the pool.
As a result, txonly can't send packets after it exhausts the mempool.

The function tx_mbuf_alloc() was getting mbuf directly from mempool and so
was bypassing mbuf API.
The dedicated function is rte_pktmbuf_alloc() but it is much slower because
it does unnecessary initializations in rte_pktmbuf_reset().
By using the internal API __rte_mbuf_raw_alloc(), refcnt is correctly handled
without adding too much overload.

Signed-off-by: Dongsu Han <707f5069874eafd125feb618053725771332e866@cs.cmu.edu>
Signed-off-by: Thomas Monjalon <ee2fa8b2681c737f775687e475dcbf2028a412f1@6wind.com>
Acked-by: Adrien Mazarguil <9d39ea493ca46c560334f650ac5d4b5ffbcb5cf0@6wind.com>

tsphillips/dpdk-fork,venkynv/dpdk-mirror,msune/dpdk,venkynv/dpdk-mirror,msune/dpdk,msune/dpdk,tsphillips/dpdk-fork,venkynv/dpdk-mirror,john-mcnamara-intel/dpdk,mixja/dpdk,mixja/dpdk,mixja/dpdk,tsphillips/dpdk-fork,venkynv/dpdk-mirror,john-mcnamara-intel/dpdk,msune/dpdk,tsphillips/dpdk-fork,john-mcnamara-intel/dpdk,mixja/dpdk,john-mcnamara-intel/dpdk