Linux virtualization list
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Tiwei Bie <tiwei.bie@intel.com>,
	mst@redhat.com, pbonzini@redhat.com, stefanha@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Cc: zhihong.wang@intel.com
Subject: Re: [RFC] virtio: support VIRTIO_F_IO_BARRIER
Date: Thu, 3 May 2018 15:30:03 +0800	[thread overview]
Message-ID: <ab66939d-47fb-5f43-3938-0c156ffc6918@redhat.com> (raw)
In-Reply-To: <20180503025955.28816-1-tiwei.bie@intel.com>



On 2018年05月03日 10:59, Tiwei Bie wrote:
> This patch introduces the support for VIRTIO_F_IO_BARRIER.
> When this feature is negotiated, driver will use the barriers
> suitable for hardware devices.
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/virtio/virtio_ring.c       | 5 +++++
>   include/uapi/linux/virtio_config.h | 8 +++++++-
>   2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 21d464a29cf8..edb565643bf4 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -996,6 +996,9 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index,
>   		!context;
>   	vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX);
>   
> +	if (virtio_has_feature(vdev, VIRTIO_F_IO_BARRIER))
> +		vq->weak_barriers = false;
> +
>   	/* No callback?  Tell other side not to bother us. */
>   	if (!callback) {
>   		vq->avail_flags_shadow |= VRING_AVAIL_F_NO_INTERRUPT;
> @@ -1164,6 +1167,8 @@ void vring_transport_features(struct virtio_device *vdev)
>   			break;
>   		case VIRTIO_F_IOMMU_PLATFORM:
>   			break;
> +		case VIRTIO_F_IO_BARRIER:
> +			break;
>   		default:
>   			/* We don't understand this bit. */
>   			__virtio_clear_bit(vdev, i);
> diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
> index 308e2096291f..6ca8d24bf468 100644
> --- a/include/uapi/linux/virtio_config.h
> +++ b/include/uapi/linux/virtio_config.h
> @@ -49,7 +49,7 @@
>    * transport being used (eg. virtio_ring), the rest are per-device feature
>    * bits. */
>   #define VIRTIO_TRANSPORT_F_START	28
> -#define VIRTIO_TRANSPORT_F_END		34
> +#define VIRTIO_TRANSPORT_F_END		38
>   
>   #ifndef VIRTIO_CONFIG_NO_LEGACY
>   /* Do we get callbacks when the ring is completely used, even if we've
> @@ -71,4 +71,10 @@
>    * this is for compatibility with legacy systems.
>    */
>   #define VIRTIO_F_IOMMU_PLATFORM		33
> +
> +/*
> + * If clear - driver may use barriers suitable for CPU cores.
> + * If set - driver must use barriers suitable for hardware devices.
> + */
> +#define VIRTIO_F_IO_BARRIER		37
>   #endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */

Hi:

I believe this depends on Michael's patch of

"[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg"

?

Thanks
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

       reply	other threads:[~2018-05-03  7:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180503025955.28816-1-tiwei.bie@intel.com>
2018-05-03  7:30 ` Jason Wang [this message]
2018-05-03  8:30   ` [RFC] virtio: support VIRTIO_F_IO_BARRIER Tiwei Bie
     [not found]   ` <20180503083015.kb7po26ga46g66tc@debian>
2018-05-03  9:09     ` Jason Wang
     [not found]     ` <1292c46c-34ad-ea21-1f05-164044a5f35a@redhat.com>
2018-05-03  9:58       ` Tiwei Bie
     [not found]       ` <20180503095823.zpxskdts7etpwl6x@debian>
2018-05-03 12:57         ` Jason Wang
2018-05-03  9:06 ` Stefan Hajnoczi
     [not found] ` <20180503090652.GB5301@stefanha-x1.localdomain>
2018-05-03 13:26   ` Tiwei Bie
2018-05-03 13:50     ` Stefan Hajnoczi
2018-05-03 17:57 ` Michael S. Tsirkin
     [not found] ` <20180503203108-mutt-send-email-mst@kernel.org>
2018-05-04  1:14   ` Tiwei Bie
2018-05-03  2:59 Tiwei Bie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab66939d-47fb-5f43-3938-0c156ffc6918@redhat.com \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox