From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3 1/3] net/virtio: add missing barrier before reading the flags Date: Thu, 10 Jan 2019 15:31:01 +0100 Message-ID: References: <20181226163712.31596-1-i.maximets@samsung.com> <20190109145015.3010-1-i.maximets@samsung.com> <20190109145015.3010-2-i.maximets@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Tiwei Bie , Zhihong Wang , jfreimann@redhat.com, Jason Wang , xiaolong.ye@intel.com, alejandro.lucero@netronome.com, stable@dpdk.org To: Ilya Maximets , dev@dpdk.org, "Michael S . Tsirkin" , Xiao Wang Return-path: In-Reply-To: <20190109145015.3010-2-i.maximets@samsung.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 1/9/19 3:50 PM, Ilya Maximets wrote: > 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") > CC: stable@dpdk.org > > Reported-by: Shahaf Shuler > Signed-off-by: Ilya Maximets > --- > drivers/net/virtio/virtqueue.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > Reviewed-by: Maxime Coquelin Thanks, Maxime