[dpdk-dev] [PATCH v2] vhost: avoid memory barriers when no descriptors dequeued

Maxime Coquelin maxime.coquelin at redhat.com
Wed Oct 24 12:51:22 CEST 2018



On 10/23/18 12:07 PM, Maxime Coquelin wrote:
> In both split and packed dequeue paths, flush_shadow_used_ring
> and vhost_ring_call variants gets called even if not packets
> have been dequeued, and so no descriptors updates happened.
> 
> It has an impact on CPU pipeline, as memory barriers are used
> in these functions.
> 
> This patch don't call these functions if no descriptors have
> been dequeued. The performance gain with split ring when
> dequeue zero-copy is disabled should be null, but should be
> noticeable with packed ring or dequeue zero-copy enabled.
> 
> Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring")
> Fixes: 915cf9404225 ("vhost: use shadow used ring in dequeue path")
> Cc:stable at dpdk.org
> 
> Signed-off-by: Maxime Coquelin<maxime.coquelin at redhat.com>
> ---
> 
> Changes in v2:
> - Fix shadow_used_idx reset in error path (Tiwei)
> 
>   lib/librte_vhost/virtio_net.c | 24 ++++++++++++++++--------
>   1 file changed, 16 insertions(+), 8 deletions(-)


Applied to dpdk-next-virtio/master.

Maxime


More information about the dev mailing list