[dpdk-dev] [PATCH v3 2/3] net/virtio: update memory ordering comment for vq notify

Gavin Hu (Arm Technology China) Gavin.Hu at arm.com
Thu Jan 10 09:19:04 CET 2019



> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Ilya Maximets
> Sent: Wednesday, January 9, 2019 10:50 PM
> To: dev at dpdk.org; Maxime Coquelin <maxime.coquelin at redhat.com>;
> Michael S . Tsirkin <mst at redhat.com>; Xiao Wang
> <xiao.w.wang at intel.com>
> Cc: Tiwei Bie <tiwei.bie at intel.com>; Zhihong Wang
> <zhihong.wang at intel.com>; jfreimann at redhat.com; Jason Wang
> <jasowang at redhat.com>; xiaolong.ye at intel.com;
> alejandro.lucero at netronome.com; Ilya Maximets
> <i.maximets at samsung.com>
> Subject: [dpdk-dev] [PATCH v3 2/3] net/virtio: update memory ordering
> comment for vq notify
> 
> We're not using io ports in case of modern device even on IA.
> Also, this comment useless for other architectures.

Agree, it should be architecture neutral. 

> 
> Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
> ---
>  drivers/net/virtio/virtqueue.h | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
> index dffa03669..53aeac238 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -437,14 +437,13 @@ virtqueue_kick_prepare_packed(struct virtqueue
> *vq)
>  	return flags != RING_EVENT_FLAGS_DISABLE;
>  }
> 
> +/*
> + * virtqueue_kick_prepare*() or the virtio_wmb() should be called
> + * before this function to be sure that all the data is visible to vhost.
> + */

C11 _atomic APIs are preferred for new code, other than wmb or rmb,  could you work on that? 

>  static inline void
>  virtqueue_notify(struct virtqueue *vq)
>  {
> -	/*
> -	 * Ensure updated avail->idx is visible to host.
> -	 * For virtio on IA, the notificaiton is through io port operation
> -	 * which is a serialization instruction itself.
> -	 */
>  	VTPCI_OPS(vq->hw)->notify_queue(vq->hw, vq);
>  }
> 
> --
> 2.17.1



More information about the dev mailing list