DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jerin Jacob <jerinjacobk@gmail.com>
Cc: fengchengwen <fengchengwen@huawei.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	David Marchand <david.marchand@redhat.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
	"Ruifeng Wang (Arm Technology China)" <ruifeng.wang@arm.com>,
	"humin29@huawei.com" <humin29@huawei.com>
Subject: Re: [dpdk-dev] How to disable SVE auto vectorization while using GCC
Date: Fri, 30 Apr 2021 09:09:26 -0700	[thread overview]
Message-ID: <20210430090926.12178aea@hermes.local> (raw)
In-Reply-To: <CALBAE1O362gLyV-oko0RwhRrWSgJbWK63vk7V8u9L9pvkD9oHA@mail.gmail.com>

On Fri, 30 Apr 2021 20:41:13 +0530
Jerin Jacob <jerinjacobk@gmail.com> wrote:

> On Fri, Apr 30, 2021 at 5:27 PM fengchengwen <fengchengwen@huawei.com> wrote:
> >
> > Hi, ALL
> > We have a question for your help:
> >   1. We have two platforms, both of which are ARM64, one of which supports
> >      both NEON and SVE, the other only support NEON.
> >   2. We want to run on both platforms with a single binary file, and use the
> >      highest vector capability of the corresponding platform whenever possible.  
> 
> I see VPP has a similar feature. IMO, it is not present in DPDK.
> Basically, In order to do this.
> - Compile slow-path code(90% of DPDK) with minimal CPU instruction set support
> - Have fastpath function compile with different CPU instruction set levels
> -In slowpath, Attach the fastpath function pointer-based on CPU
> instruction-level support.
> 
> 
> >   3. So we build the DPDK program with -march=armv8-a+sve+crc (GCC 10.2).
> >      However, it is found that invalid instructions occur when the program
> >      runs on a machine that does not support SVE (pls see below).
> >   4. The problem is caused by the introduction of SVE in GCC automatic vector
> >      optimization.
> >
> >   So Is there a way to disable GCC automatic vector optimization or use only
> >   NEON to perform automatic vector optimization?
> >
> >   BTW: we already test -fno-tree-vectorize (as link below) but found no effect.
> >   https://stackoverflow.com/questions/7778174/how-can-i-disable-vectorization-while-using-gcc
> >
> >
> > The GDB output:
> >      EAL: Detected 128 lcore(s)
> >      EAL: Detected 4 NUMA nodes
> >      Option -w, --pci-whitelist is deprecated, use -a, --allow option instead
> >
> >      Program received signal SIGILL, Illegal instruction.
> >      0x0000000000671b88 in eal_adjust_config ()
> >      (gdb)
> >      (gdb) where
> >      #0  0x0000000000671b88 in eal_adjust_config ()
> >      #1  0x0000000000682840 in rte_eal_init ()
> >      #2  0x000000000051c870 in main ()
> >      (gdb)
> >
> > The disassembly output of eal_adjust_config:
> >      671b7c:       f8237a81        str     x1, [x20, x3, lsl #3]
> >      671b80:       f110001f        cmp     x0, #0x400
> >      671b84:       54ffff21        b.ne    671b68 <eal_adjust_config+0x1f4>  // b.any
> >      671b88:       043357f5        addvl   x21, x19, #-1
> >      671b8c:       043457e1        addvl   x1, x20, #-1
> >      671b90:       910562b5        add     x21, x21, #0x158
> >      671b94:       04e0e3e0        cntd    x0
> >      671b98:       914012b5        add     x21, x21, #0x4, lsl #12
> >      671b9c:       52800218        mov     w24, #0x10                      // #16
> >      671ba0:       25d8e3e1        ptrue   p1.d
> >      671ba4:       25f80fe0        whilelo p0.d, wzr, w24
> >      671ba8:       a5e04020        ld1d    {z0.d}, p0/z, [x1, x0, lsl #3]
> >
> >
> > Best regards.
> >  

Is there a way to use Gcc function multiversioning for this?
https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html

Not sure if this is only available on all compiler versions that DPDK
claims to support. It looks like it made into GCC 6 and LLVM 7

  reply	other threads:[~2021-04-30 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 11:57 fengchengwen
2021-04-30 15:11 ` Jerin Jacob
2021-04-30 16:09   ` Stephen Hemminger [this message]
2021-05-08 19:17     ` Honnappa Nagarahalli
2021-04-30 20:54   ` Honnappa Nagarahalli
2021-05-08  3:23     ` fengchengwen
2021-05-08 18:46       ` Honnappa Nagarahalli
2021-05-11 11:23         ` fengchengwen
2021-05-11 14:10           ` Honnappa Nagarahalli
2021-05-12  8:47             ` fengchengwen

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=20210430090926.12178aea@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=humin29@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=jerinjacobk@gmail.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=ruifeng.wang@arm.com \
    --cc=sthemmin@microsoft.com \
    --cc=thomas@monjalon.net \
    /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).