[dpdk-dev] [PATCH v4 1/2] virtio: one way barrier for split vring used idx

Maxime Coquelin maxime.coquelin at redhat.com
Mon Apr 27 11:03:05 CEST 2020



On 4/24/20 5:39 AM, Joyce Kong wrote:
> In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
> and backend are assumed to be implemented in software, that is they can
> run on identical CPUs in an SMP configuration.
> Thus a weak form of memory barriers like rte_smp_r/wmb, other than
> rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
> and yields better performance.
> For the above case, this patch helps yielding even better performance
> by replacing the two-way barriers with C11 one-way barriers for used
> index in split ring.
> 
> Signed-off-by: Joyce Kong <joyce.kong at arm.com>
> Reviewed-by: Gavin Hu <gavin.hu at arm.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c            |  7 +---
>  drivers/net/virtio/virtio_ring.h              |  2 +-
>  drivers/net/virtio/virtio_rxtx.c              | 35 ++++++-----------
>  drivers/net/virtio/virtio_rxtx_simple_neon.c  |  5 +--
>  drivers/net/virtio/virtio_rxtx_simple_sse.c   |  4 +-
>  .../net/virtio/virtio_user/virtio_user_dev.c  |  8 ++--
>  drivers/net/virtio/virtqueue.c                |  2 +-
>  drivers/net/virtio/virtqueue.h                | 38 ++++++++++++++++---
>  lib/librte_vhost/virtio_net.c                 |  5 +--
>  9 files changed, 58 insertions(+), 48 deletions(-)
> 


Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list