]> git.proxmox.com Git - ovs.git/commit
netdev-dpdk: Free mempool only when no in-use mbufs.
authorKevin Traynor <ktraynor@redhat.com>
Fri, 13 Apr 2018 17:40:13 +0000 (18:40 +0100)
committerIan Stokes <ian.stokes@intel.com>
Sat, 21 Apr 2018 15:59:45 +0000 (16:59 +0100)
commit91fccdad72a253a3892dcb3c4453a31833851bb7
tree3e141aa1b98e386ca3b8c07b1bce813af6cb80b1
parent293e7c56f6649045f84f25f0fa5a3012f9feb73f
netdev-dpdk: Free mempool only when no in-use mbufs.

DPDK mempools are freed when they are no longer needed.
This can happen when a port is removed or a port's mtu
is reconfigured so that a new mempool is used.

It is possible that an mbuf is attempted to be returned
to a freed mempool from NIC Tx queues and this can lead
to a segfault.

In order to prevent this, only free mempools when they
are not needed and have no in-use mbufs. As this might
not be possible immediately, create a free list of
mempools and sweep it anytime a port tries to get a
mempool.

Fixes: 8d38823bdf8b ("netdev-dpdk: fix memory leak")
Cc: mark.b.kavanagh81@gmail.com
Cc: Ilya Maximets <i.maximets@samsung.com>
Reported-by: Venkatesan Pradeep <venkatesan.pradeep@ericsson.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
lib/netdev-dpdk.c