DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Zhihong Wang <zhihong.wang@intel.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>,
	dev@dpdk.org, lei.a.yao@intel.com
Subject: Re: [dpdk-dev] [PATCH v2] eal: optimize aligned rte_memcpy
Date: Tue, 17 Jan 2017 16:08:42 +0100	[thread overview]
Message-ID: <1597948.LxUmgnGZos@xps13> (raw)
In-Reply-To: <20161208021843.GM31182@yliu-dev.sh.intel.com>

2016-12-08 10:18, Yuanhan Liu:
> On Tue, Dec 06, 2016 at 08:31:06PM -0500, Zhihong Wang wrote:
> > This patch optimizes rte_memcpy for well aligned cases, where both
> > dst and src addr are aligned to maximum MOV width. It introduces a
> > dedicated function called rte_memcpy_aligned to handle the aligned
> > cases with simplified instruction stream. The existing rte_memcpy
> > is renamed as rte_memcpy_generic. The selection between them 2 is
> > done at the entry of rte_memcpy.
> > 
> > The existing rte_memcpy is for generic cases, it handles unaligned
> > copies and make store aligned, it even makes load aligned for micro
> > architectures like Ivy Bridge. However alignment handling comes at
> > a price: It adds extra load/store instructions, which can cause
> > complications sometime.
> > 
> > DPDK Vhost memcpy with Mergeable Rx Buffer feature as an example:
> > The copy is aligned, and remote, and there is header write along
> > which is also remote. In this case the memcpy instruction stream
> > should be simplified, to reduce extra load/store, therefore reduce
> > the probability of load/store buffer full caused pipeline stall, to
> > let the actual memcpy instructions be issued and let H/W prefetcher
> > goes to work as early as possible.
> > 
> > This patch is tested on Ivy Bridge, Haswell and Skylake, it provides
> > up to 20% gain for Virtio Vhost PVP traffic, with packet size ranging
> > from 64 to 1500 bytes.
> > 
> > The test can also be conducted without NIC, by setting loopback
> > traffic between Virtio and Vhost. For example, modify the macro
> > TXONLY_DEF_PACKET_LEN to the requested packet size in testpmd.h,
> > rebuild and start testpmd in both host and guest, then "start" on
> > one side and "start tx_first 32" on the other.
> > 
> > 
> > Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> 
> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>

Applied, thanks

      reply	other threads:[~2017-01-17 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  1:19 [dpdk-dev] [PATCH] vhost: optimize vhost memcpy Zhihong Wang
2016-12-02 10:30 ` Thomas Monjalon
2016-12-05  8:27 ` Yuanhan Liu
2016-12-05 10:27   ` Wang, Zhihong
2016-12-05 10:37     ` Yuanhan Liu
2016-12-07  6:11       ` Wang, Zhihong
2016-12-07  1:31 ` [dpdk-dev] [PATCH v2] eal: optimize aligned rte_memcpy Zhihong Wang
2016-12-08  0:55   ` Yao, Lei A
2016-12-08  2:18   ` Yuanhan Liu
2017-01-17 15:08     ` Thomas Monjalon [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=1597948.LxUmgnGZos@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=lei.a.yao@intel.com \
    --cc=yuanhan.liu@linux.intel.com \
    --cc=zhihong.wang@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).