LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Wei Xu <wexu@redhat.com>
Cc: mst@redhat.com, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	jfreimann@redhat.com, tiwei.bie@intel.com
Subject: Re: [RFC V5 PATCH 8/8] vhost: event suppression for packed ring
Date: Thu, 31 May 2018 11:09:07 +0800	[thread overview]
Message-ID: <12f2c455-5868-3b07-0eba-d49dcafd10f2@redhat.com> (raw)
In-Reply-To: <20180530114200.GA23792@wei-ubt>



On 2018年05月30日 19:42, Wei Xu wrote:
>>   /* This actually signals the guest, using eventfd. */
>>   void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq)
>>   {
>> @@ -2802,10 +2930,34 @@ static bool vhost_enable_notify_packed(struct vhost_dev *dev,
>>   				       struct vhost_virtqueue *vq)
>>   {
>>   	struct vring_desc_packed *d = vq->desc_packed + vq->avail_idx;
>> -	__virtio16 flags;
>> +	__virtio16 flags = RING_EVENT_FLAGS_ENABLE;
>>   	int ret;
>>   
>> -	/* FIXME: disable notification through device area */
>> +	if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY))
>> +		return false;
>> +	vq->used_flags &= ~VRING_USED_F_NO_NOTIFY;
> 'used_flags' was originally designed for 1.0, why should we pay attetion to it here?
>
> Wei

It was used to recored whether or not we've disabled notification. Then 
we can avoid unnecessary userspace writes or memory barriers.

Thanks

  reply	other threads:[~2018-05-31  3:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29  2:10 [RFC V5 PATCH 0/8] Packed ring layout for vhost Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 1/8] vhost: move get_rx_bufs to vhost.c Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 2/8] vhost: hide used ring layout from device Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 3/8] vhost: do not use vring_used_elem Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 4/8] vhost_net: do not explicitly manipulate vhost_used_elem Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 5/8] vhost: vhost_put_user() can accept metadata type Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 6/8] virtio: introduce packed ring defines Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 7/8] vhost: packed ring support Jason Wang
2018-05-29  2:10 ` [RFC V5 PATCH 8/8] vhost: event suppression for packed ring Jason Wang
2018-05-30 11:42   ` Wei Xu
2018-05-31  3:09     ` Jason Wang [this message]
2018-06-03 15:40       ` Wei Xu

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=12f2c455-5868-3b07-0eba-d49dcafd10f2@redhat.com \
    --to=jasowang@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=tiwei.bie@intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wexu@redhat.com \
    --subject='Re: [RFC V5 PATCH 8/8] vhost: event suppression for packed ring' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).