From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Kevin Traynor <ktraynor@redhat.com>, yuanhan.liu@linux.intel.com
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH v2] vhost: fix virtio_net false sharing
Date: Mon, 27 Mar 2017 09:34:19 +0200 [thread overview]
Message-ID: <df05ccc2-07db-b80a-2fbb-0fb3566a4d4e@redhat.com> (raw)
In-Reply-To: <1490283898-23019-1-git-send-email-ktraynor@redhat.com>
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>
I'll try to benchmark it with testpmd only to see if we measure the
same gain without OVS.
Thanks,
Maxime
next prev parent reply other threads:[~2017-03-27 7:34 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 [this message]
2017-03-27 8:33 ` Yuanhan Liu
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=df05ccc2-07db-b80a-2fbb-0fb3566a4d4e@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=ktraynor@redhat.com \
--cc=stable@dpdk.org \
--cc=yuanhan.liu@linux.intel.com \
/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).