From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] vhost: fix notification for packed ring Date: Thu, 11 Oct 2018 15:17:14 +0200 Message-ID: <9d3be2dd-6dce-00f4-0b73-9fd81c5edd7c@redhat.com> References: <20181011130655.5485-1-tiwei.bie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mst@redhat.com, jasowang@redhat.com, stable@dpdk.org To: Tiwei Bie , zhihong.wang@intel.com, dev@dpdk.org Return-path: In-Reply-To: <20181011130655.5485-1-tiwei.bie@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/11/2018 03:06 PM, 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 > --- > 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(); > > vq->device_event->flags = flags; > Thanks for spotting this: Reviewed-by: Maxime Coquelin Maxime