netdev-dpdk: Fix memory leak in dpdk_do_tx_copy().
authorRyan Wilson <wryan@nicira.com>
Fri, 27 Jun 2014 01:16:39 +0000 (18:16 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Mon, 30 Jun 2014 17:53:58 +0000 (10:53 -0700)
commit175cf4de3f785d7b0e4c9d834aaad3dcc11c18fe
treeef7624eac2e41f038315d5df551c257025ed653f
parent844f2d749ab02b59218e869483e78725869c199f
netdev-dpdk: Fix memory leak in dpdk_do_tx_copy().

This patch fixes a bug where rte_pktmbuf_alloc() would fail and
packets which succeeded to allocate memory with rte_pktmbuf_alloc()
would not be sent and leak memory.

Also, as a byproduct of using a local variable to record dropped
packets, this reduces the locking of the netdev's mutex when
multiple packets are dropped in dpdk_do_tx_copy().

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
lib/netdev-dpdk.c