DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>,
	maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org,
	stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost: fix notification for packed ring
Date: Thu, 11 Oct 2018 22:10:28 +0800	[thread overview]
Message-ID: <20181011141028.GA11493@debian> (raw)
In-Reply-To: <20181011093628-mutt-send-email-mst@kernel.org>

On Thu, Oct 11, 2018 at 09:36:48AM -0400, Michael S. Tsirkin wrote:
> On Thu, Oct 11, 2018 at 09:34:06PM +0800, Jason Wang wrote:
> > 
> > 
> > On 2018年10月11日 21:06, Tiwei Bie wrote:
> > > The notification can't be disabled in packed ring when
> > > application tries to disable notification, because the
> > > device event flags field is overwritten by an unexpected
> > > value. This patch fixes this issue.
> > > 
> > > Fixes: b1cce26af1dc ("vhost: add notification for packed ring")
> > > Cc: stable@dpdk.org
> > > 
> > > Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> > > ---
> > >   lib/librte_vhost/vhost.c | 7 +++++--
> > >   1 file changed, 5 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> > > index e62f4c594..c9270bdec 100644
> > > --- a/lib/librte_vhost/vhost.c
> > > +++ b/lib/librte_vhost/vhost.c
> > > @@ -667,8 +667,10 @@ vhost_enable_notify_packed(struct virtio_net *dev,
> > >   {
> > >   	uint16_t flags;
> > > -	if (!enable)
> > > -		vq->device_event->flags = VRING_EVENT_F_DISABLE;
> > > +	if (!enable) {
> > > +		flags = VRING_EVENT_F_DISABLE;
> > > +		goto out;
> > > +	}
> > >   	flags = VRING_EVENT_F_ENABLE;
> > >   	if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) {
> > > @@ -677,6 +679,7 @@ vhost_enable_notify_packed(struct virtio_net *dev,
> > >   			vq->avail_wrap_counter << 15;
> > >   	}
> > > +out:
> > >   	rte_smp_wmb();
> > 
> > It looks to me the barrier is even not needed for !enable.
> > 
> > Thanks
> 
> Good point, I agree.
> Besides that
> 
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> 

Yeah, it's better to return directly after disabling the
interrupt. I will send a new version to do this change.

Thanks!

> 
> 
> > >   	vq->device_event->flags = flags;

  reply	other threads:[~2018-10-11 14:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 13:06 Tiwei Bie
2018-10-11 13:17 ` Maxime Coquelin
2018-10-11 13:34 ` Jason Wang
2018-10-11 13:36   ` Michael S. Tsirkin
2018-10-11 14:10     ` Tiwei Bie [this message]
2018-10-11 14:22 ` [dpdk-dev] [PATCH v2] " Tiwei Bie
2018-10-11 15:21   ` Maxime Coquelin
2018-10-11 23:47   ` Jason Wang
2018-10-16  8:36   ` Maxime Coquelin

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=20181011141028.GA11493@debian \
    --to=tiwei.bie@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasowang@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=stable@dpdk.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;
as well as URLs for NNTP newsgroup(s).