DPDK patches and discussions
 help / color / mirror / Atom feed
From: Phil Yang <Phil.Yang@arm.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Joyce Kong <Joyce.Kong@arm.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>,
	"zhihong.wang@intel.com" <zhihong.wang@intel.com>,
	"xiaolong.ye@intel.com" <xiaolong.ye@intel.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	 Ruifeng Wang <Ruifeng.Wang@arm.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1 1/2] net/virtio: restrict pointer aliasing for NEON vpmd
Date: Tue, 23 Jun 2020 09:05:36 +0000	[thread overview]
Message-ID: <VE1PR08MB464090F62D86258504892AE9E9940@VE1PR08MB4640.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <6c7ed072-da6d-6eb1-4157-5498320a1c4d@redhat.com>

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Tuesday, June 23, 2020 4:48 PM
> To: Joyce Kong <Joyce.Kong@arm.com>; jerinj@marvell.com;
> zhihong.wang@intel.com; xiaolong.ye@intel.com; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v1 1/2] net/virtio: restrict pointer aliasing for NEON
> vpmd
>
>
>
> On 6/11/20 5:32 AM, Joyce Kong wrote:
> > Restrict pointer aliasing to allow the compiler to vectorize loops
> > more aggressively.
> >
> > With this patch, a 9.6% improvement is observed in throughput for
> > the virtio-net PVP case, and a 2.4% perf improvement in throughput
> > for the virtio-user PVP case. All performance data are measured
> > under the 0.001% acceptable packet loss with 2 cores on the vhost
> > side.
> >
> > Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> > Reviewed-by: Phil Yang <phil.yang@arm.com>
> > ---
> >  drivers/net/virtio/virtio_rxtx_simple_neon.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Very nice, we should consider doing the same on other platforms.
>
> > diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c
> b/drivers/net/virtio/virtio_rxtx_simple_neon.c
> > index 363e2b330..c08dd51fb 100644
> > --- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
> > +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
> > @@ -36,8 +36,8 @@
> >   * - nb_pkts < RTE_VIRTIO_DESC_PER_LOOP, just return no packet
> >   */
> >  uint16_t
> > -virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
> > -uint16_t nb_pkts)
> > +virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf
> > +**__restrict rx_pkts, uint16_t nb_pkts)
>
> Is __restrict supported by all the compilers?
> Wouldn't it be better to introduce a wrapper?

+1 for this.
In my understanding, the __restrict keyword is recognized in C at all language levels.
However, the restrict keyword is recognized in C under compilation with c99.
DPDK uses the restrict qualifier a lot, which might have some issues with some old compilers.
So the wrapper will be useful.

Thanks,
Phil

>
> >  {
> >  struct virtnet_rx *rxvq = rx_queue;
> >  struct virtqueue *vq = rxvq->vq;
> >

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

  reply	other threads:[~2020-06-23  9:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  3:32 [dpdk-dev] [PATCH v1 0/2] virtio: restrict pointer aliasing for loops vectorization Joyce Kong
2020-06-11  3:32 ` [dpdk-dev] [PATCH v1 1/2] net/virtio: restrict pointer aliasing for NEON vpmd Joyce Kong
2020-06-23  8:47   ` Maxime Coquelin
2020-06-23  9:05     ` Phil Yang [this message]
2020-06-24  2:58       ` Joyce Kong
2020-06-24  4:16         ` Stephen Hemminger
2020-06-11  3:32 ` [dpdk-dev] [PATCH v1 2/2] lib/vhost: restrict pointer aliasing for packed path Joyce Kong
2020-07-07 16:25   ` Adrian Moreno
2020-07-10  3:15     ` Joyce Kong
2020-07-06  7:49 ` [dpdk-dev] [PATCH v2 0/6] Restrict pointer aliasing with a common wrapper Joyce Kong
2020-07-06  7:49   ` [dpdk-dev] [PATCH v2 1/6] lib/eal: add a common wrapper for restricted pointers Joyce Kong
2020-07-07  2:15     ` Jerin Jacob
2020-07-07  2:24     ` Phil Yang
2020-07-07  2:40     ` Ruifeng Wang
2020-07-07 13:57     ` David Marchand
2020-07-08  2:46       ` Joyce Kong
2020-07-06  7:49   ` [dpdk-dev] [PATCH v2 2/6] net/virtio: restrict pointer aliasing for NEON vpmd Joyce Kong
2020-07-06  7:49   ` [dpdk-dev] [PATCH v2 3/6] lib/vhost: restrict pointer aliasing for packed vpmd Joyce Kong
2020-07-07 13:58     ` David Marchand
2020-07-06  7:49   ` [dpdk-dev] [PATCH v2 4/6] net/i40e: replace restrict with rte restrict Joyce Kong
2020-07-07  2:25     ` Phil Yang
2020-07-07  2:43     ` Ruifeng Wang
2020-07-07 14:00     ` David Marchand
2020-07-08  3:21       ` Joyce Kong
2020-07-09  9:57         ` David Marchand
2020-07-10  2:45           ` Joyce Kong
2020-07-06  7:49   ` [dpdk-dev] [PATCH v2 5/6] examples/performance-thread: replace restrict with wrapper Joyce Kong
2020-07-07  2:27     ` Phil Yang
2020-07-07  2:45     ` Ruifeng Wang
2020-07-06  7:49   ` [dpdk-dev] [PATCH v2 6/6] net/mlx5: replace restrict keyword with rte restrict Joyce Kong
2020-07-07  2:28     ` Phil Yang
2020-07-07  2:47     ` Ruifeng Wang
2020-07-09 13:52   ` [dpdk-dev] [PATCH v2 0/6] Restrict pointer aliasing with a commonwrapper Morten Brørup
2020-07-10  3:17     ` Joyce Kong
2020-07-10  2:38 ` [dpdk-dev] [PATCH v3 0/3] restrict pointer aliasing with a common wrapper Joyce Kong
2020-07-10  2:38   ` [dpdk-dev] [PATCH v3 1/3] lib/eal: add a common wrapper for restricted pointers Joyce Kong
2020-07-10  2:38   ` [dpdk-dev] [PATCH v3 2/3] net/virtio: restrict pointer aliasing for NEON vpmd Joyce Kong
2020-07-10  2:38   ` [dpdk-dev] [PATCH v3 3/3] lib/vhost: restrict pointer aliasing for packed vpmd Joyce Kong
2020-07-10 13:41     ` Adrian Moreno
2020-07-10 14:05   ` [dpdk-dev] [PATCH v3 0/3] restrict pointer aliasing with a common wrapper David Marchand

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=VE1PR08MB464090F62D86258504892AE9E9940@VE1PR08MB4640.eurprd08.prod.outlook.com \
    --to=phil.yang@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Joyce.Kong@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=xiaolong.ye@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).