From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 083291B449 for ; Thu, 31 Jan 2019 17:02:19 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C4498535D; Thu, 31 Jan 2019 16:02:18 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-200.ams2.redhat.com [10.36.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D6ED54504; Thu, 31 Jan 2019 16:02:08 +0000 (UTC) From: Kevin Traynor To: Ilya Maximets Cc: Shahaf Shuler , Maxime Coquelin , "Michael S . Tsirkin" , dpdk stable References: <20190131154901.5383-1-ktraynor@redhat.com> <20190131154901.5383-41-ktraynor@redhat.com> Organization: Red Hat Message-ID: <4aa1c2bd-b107-9e40-0ebb-9a6508abd31a@redhat.com> Date: Thu, 31 Jan 2019 16:02:07 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20190131154901.5383-41-ktraynor@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 31 Jan 2019 16:02:18 +0000 (UTC) Subject: Re: [dpdk-stable] patch 'net/virtio: add barrier before reading the flags' has been queued to LTS release 18.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 16:02:19 -0000 On 01/31/2019 03:48 PM, Kevin Traynor wrote: > Hi, > > FYI, your patch has been queued to LTS release 18.11.1 > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. > It will be pushed if I get no objections before 02/07/19. So please > shout if anyone has objections. > > Also note that after the patch there's a diff of the upstream commit vs the > patch applied to the branch. This will indicate if there was any rebasing > needed to apply to the stable branch. If there were code changes for rebasing > (ie: not only metadata diffs), please double check that the rebase was > correctly done. > Note: packed case is not in 18.11, so just done for non-packed case > Thanks. > > Kevin Traynor > > --- > From 60b2f24165822233009a22a81e2bfa2d90650f12 Mon Sep 17 00:00:00 2001 > From: Ilya Maximets > Date: Wed, 9 Jan 2019 17:50:13 +0300 > Subject: [PATCH] net/virtio: add barrier before reading the flags > > [ upstream commit d21d05c7a9c1c49ec927f961c4ab797a598af5ca ] > > Reading the used->flags could be reordered with avail->idx update. > vhost in kernel disables notifications for the time of packets > receiving, like this: > > 1. disable notify > 2. process packets > 3. enable notify > 4. has more packets ? goto 1 > > In case of reordering, virtio driver could read the flags on > step 2 while notifications disabled and update avail->idx after > the step 4, i.e. vhost will exit the loop on step 4 with > notifications enabled, but virtio will not notify. > > Fixes: c1f86306a026 ("virtio: add new driver") > > Reported-by: Shahaf Shuler > Signed-off-by: Ilya Maximets > Reviewed-by: Maxime Coquelin > Acked-by: Michael S. Tsirkin > --- > drivers/net/virtio/virtqueue.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h > index 26518ed98..2e2abf15b 100644 > --- a/drivers/net/virtio/virtqueue.h > +++ b/drivers/net/virtio/virtqueue.h > @@ -337,4 +337,9 @@ static inline int > virtqueue_kick_prepare(struct virtqueue *vq) > { > + /* > + * Ensure updated avail->idx is visible to vhost before reading > + * the used->flags. > + */ > + virtio_mb(); > return !(vq->vq_ring.used->flags & VRING_USED_F_NO_NOTIFY); > } >