patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Kevin Traynor <ktraynor@redhat.com>, dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH v2] vhost: fix virtio_net false sharing
Date: Mon, 27 Mar 2017 16:33:12 +0800	[thread overview]
Message-ID: <20170327083312.GW18844@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <df05ccc2-07db-b80a-2fbb-0fb3566a4d4e@redhat.com>

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 <ktraynor@redhat.com>
> >---
> >
> >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 <maxime.coquelin@redhat.com>

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

      reply	other threads:[~2017-03-27  8:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 19:10 [dpdk-stable] [PATCH] vhost: fix virtio_net cache sharing of broadcast_rarp Kevin Traynor
2017-03-16  6:21 ` Yuanhan Liu
2017-03-16 10:10   ` Kevin Traynor
2017-03-17  5:47     ` Yuanhan Liu
2017-03-17 10:01       ` Maxime Coquelin
2017-03-20 11:13         ` Kevin Traynor
2017-03-23 15:44 ` [dpdk-stable] [PATCH v2] vhost: fix virtio_net false sharing Kevin Traynor
2017-03-27  7:34   ` Maxime Coquelin
2017-03-27  8:33     ` Yuanhan Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170327083312.GW18844@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).