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 681E01B743; Thu, 10 Jan 2019 15:31:08 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94013144030; Thu, 10 Jan 2019 14:31:07 +0000 (UTC) Received: from [10.36.112.17] (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC1496717D; Thu, 10 Jan 2019 14:31:03 +0000 (UTC) To: Ilya Maximets , dev@dpdk.org, "Michael S . Tsirkin" , Xiao Wang Cc: Tiwei Bie , Zhihong Wang , jfreimann@redhat.com, Jason Wang , xiaolong.ye@intel.com, alejandro.lucero@netronome.com, stable@dpdk.org References: <20181226163712.31596-1-i.maximets@samsung.com> <20190109145015.3010-1-i.maximets@samsung.com> <20190109145015.3010-2-i.maximets@samsung.com> From: Maxime Coquelin Message-ID: Date: Thu, 10 Jan 2019 15:31:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20190109145015.3010-2-i.maximets@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 10 Jan 2019 14:31:07 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 1/3] net/virtio: add missing barrier before reading the flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2019 14:31:08 -0000 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