net/enic: decrement Tx mbuf reference count before recycling
authorJohn Daley <johndale@cisco.com>
Mon, 11 Jul 2016 19:45:01 +0000 (12:45 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 Jul 2016 21:37:13 +0000 (23:37 +0200)
commitda24f6f658fb7892606b3796a5ed03a5dff688af
treec38e038e09476a99adee516b0c5d098faa1123e7
parentd0c98d9e19a94a580ad51778e88875715a4460a4
net/enic: decrement Tx mbuf reference count before recycling

In the burst Tx cleanup function, the reference count in mbufs
returned to the pool should to be decremented before they are
returned. Decrementing is not done by rte_mempool_put_bulk()
so it must be done separately using __rte_pktmbuf_prefree_seg().

Also when returning unsent buffers when the device is stopped
use rte_mbuf_free_seg() instead of rte_mempool_put() so that
reference counts are properly decremented.

Fixes: 36935afbc53c ("net/enic: refactor Tx mbuf recycling")

Reviewed-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
drivers/net/enic/enic_main.c
drivers/net/enic/enic_rxtx.c