From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id B82991D8CC for ; Fri, 15 Jun 2018 10:49:07 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32167406DE3D; Fri, 15 Jun 2018 08:49:07 +0000 (UTC) Received: from [10.36.112.38] (ovpn-112-38.ams2.redhat.com [10.36.112.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 456EB20283A3; Fri, 15 Jun 2018 08:49:05 +0000 (UTC) To: zhihong.wang@intel.com, tiwei.bie@intel.com, dev@dpdk.org References: <20180607143826.23647-1-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <9c48d964-cc32-2ac6-e12d-e66973b09bfd@redhat.com> Date: Fri, 15 Jun 2018 10:49:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180607143826.23647-1-maxime.coquelin@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 08:49:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 08:49:07 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH] vhost: use SMP memory barrier before kicking guest 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: Fri, 15 Jun 2018 08:49:08 -0000 On 06/07/2018 04:38 PM, Maxime Coquelin wrote: > vhost_vring_call() used rte_mb(), which translates into > mfence instruction on x86. > > This patch changes to use rte_smp_mb(), which changed recently > to translate into a locked ADD instruction for performance > reason. > > The measured gain is up to 3% with the testpmd benchmarks. > > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/vhost.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > index 58c425a5c..1bc99ed3c 100644 > --- a/lib/librte_vhost/vhost.h > +++ b/lib/librte_vhost/vhost.h > @@ -591,7 +591,7 @@ static __rte_always_inline void > vhost_vring_call(struct virtio_net *dev, struct vhost_virtqueue *vq) > { > /* Flush used->idx update before we read avail->flags. */ > - rte_mb(); > + rte_smp_mb(); > > /* Don't kick guest if we don't reach index specified by guest. */ > if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) { > Applied to dpdk-next-virtio Thanks, Maxime