[dpdk-dev] [PATCH 1/2] vhost: fix deadlock on IOTLB miss

Jens Freimann jfreimann at redhat.com
Fri Oct 13 13:32:04 CEST 2017

On Thu, Oct 12, 2017 at 03:38:49PM +0000, Maxime Coquelin wrote:
>An optimization was done to only take the iotlb cache lock
>once per packet burst instead of once per IOVA translation.
>With this, IOTLB miss requests are sent to Qemu with the lock
>held, which can cause a deadlock if the socket buffer is full,
>and if Qemu is waiting for an IOTLB update to be done.
>Holding the lock is not necessary when sending an IOTLB miss
>request, as it is not manipulating the IOTLB cache list, which
>the lock protects. Let's just release it while sending the
>IOTLB miss.
>Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> lib/librte_vhost/vhost.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)

Seems to be safe, because in case of an IOTLB miss we only take a
different lock. 

Reviewed-by: Jens Freimann <jfreimann at redhat.com>

More information about the dev mailing list