From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3262CFA41; Mon, 27 Mar 2017 10:35:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490603736; x=1522139736; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=z1e5IAnzxYRPo0gaV0XW9+aIvgJH2NOYhS7NMmTUvRc=; b=fQXR+KkCNuOtLns47o8Q9EDXceyV3oe0kYpMqnwcrNLjElcU1YDzQbjx MYvm8TvK/88Ca47ezxoEOvKmQcLw7g==; Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 01:35:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="1147343306" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga002.fm.intel.com with ESMTP; 27 Mar 2017 01:35:33 -0700 Date: Mon, 27 Mar 2017 16:33:12 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: Kevin Traynor , dev@dpdk.org, stable@dpdk.org Message-ID: <20170327083312.GW18844@yliu-dev.sh.intel.com> References: <1489605049-18686-1-git-send-email-ktraynor@redhat.com> <1490283898-23019-1-git-send-email-ktraynor@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-stable] [PATCH v2] vhost: fix virtio_net false sharing 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: Mon, 27 Mar 2017 08:35:36 -0000 On Mon, Mar 27, 2017 at 09:34:19AM +0200, Maxime Coquelin wrote: > > > On 03/23/2017 04:44 PM, Kevin Traynor wrote: > >The broadcast_rarp field in the virtio_net struct is checked in the > >dequeue datapath regardless of whether descriptors are available or not. > > > >As it is checked with cmpset leading to a write, false sharing on the > >virtio_net struct can happen between enqueue and dequeue datapaths > >regardless of whether a RARP is requested. In OVS, the issue can cause > >a uni-directional performance drop of up to 15%. > > > >Fix that by only performing the cmpset if a read of broadcast_rarp > >indicates that the cmpset is likely to succeed. > > > >Fixes: a66bcad32240 ("vhost: arrange struct fields for better cache sharing") > >Cc: stable@dpdk.org > > > >Signed-off-by: Kevin Traynor > >--- > > > >V2: > >Change from fixing by moving broadcast_rarp location in virtio_net struct > >to performing a read before cmpset. > > > > lib/librte_vhost/virtio_net.c | 16 ++++++++++++++-- > > 1 file changed, 14 insertions(+), 2 deletions(-) > > Nice! > Reviewed-by: Maxime Coquelin Applied to dpdk-next-virtio. Thanks. --yliu > > I'll try to benchmark it with testpmd only to see if we measure the > same gain without OVS. > > Thanks, > Maxime