[dpdk-stable] [PATCH v16.11 LTS] vhost: protect active rings from async ring changes

Luca Boccassi bluca at debian.org
Fri Mar 2 18:28:10 CET 2018


On Fri, 2018-03-02 at 18:10 +0100, Maxime Coquelin wrote:
> From: Victor Kaplansky <victork at redhat.com>
> 
> [ backported from upstream commit
> a3688046995f88c518fa27c45b39ae389260b18d ]
> 
> When performing live migration or memory hot-plugging,
> the changes to the device and vrings made by message handler
> done independently from vring usage by PMD threads.
> 
> This causes for example segfaults during live-migration
> with MQ enable, but in general virtually any request
> sent by qemu changing the state of device can cause
> problems.
> 
> These patches fixes all above issues by adding a spinlock
> to every vring and requiring message handler to start operation
> only after ensuring that all PMD threads related to the device
> are out of critical section accessing the vring data.
> 
> Each vring has its own lock in order to not create contention
> between PMD threads of different vrings and to prevent
> performance degradation by scaling queue pair number.
> 
> See https://bugzilla.redhat.com/show_bug.cgi?id=1450680
> 
> Cc: stable at dpdk.org
> Signed-off-by: Victor Kaplansky <victork at redhat.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> Acked-by: Yuanhan Liu <yliu at fridaylinux.org>
> 
> Backport conflicts:
> 	lib/librte_vhost/vhost.c
> 	lib/librte_vhost/vhost.h
> 	lib/librte_vhost/vhost_user.c
> 	lib/librte_vhost/virtio_net.c
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
> 
> Hi Luca, All,
> 
> This is the v16.11 backport for Victor's patch already available in
> master and v17.11 LTS. It needed some rework to be applied to v16.11.

Thank you, applied and pushed to dpdk-stable/16.11.

-- 
Kind regards,
Luca Boccassi


More information about the stable mailing list