DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Radu Nicolau <radu.nicolau@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com,
	viktorin@rehivetech.com, ruifeng.wang@arm.com,
	jerinj@marvell.com, drc@linux.vnet.ibm.com,
	konstantin.ananyev@intel.com,
	Sean Morrissey <sean.morrissey@intel.com>
Subject: Re: [dpdk-dev] [PATCH v1 1/4] x86: change cpuflag macros to compiler macros
Date: Wed, 2 Sep 2020 12:20:16 +0100	[thread overview]
Message-ID: <20200902112016.GB1064@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20200902104343.31774-2-radu.nicolau@intel.com>

On Wed, Sep 02, 2020 at 10:43:40AM +0000, Radu Nicolau wrote:
> Replace use of RTE_MACHINE_CPUFLAG macros with regular compiler
> macros.
> 

I think it's worth noting in the commit log that the set of macros provided
by the compilers are more complete than those provided by DPDK, and by not
having our own it allows new instruction sets to be leveraged without
having to do extra work to set them up in DPDK.

> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
>  app/test/test_memcpy_perf.c             |  8 ++++----
>  config/x86/meson.build                  |  2 --
>  drivers/net/enic/Makefile               |  2 +-
>  drivers/net/enic/meson.build            |  2 +-
>  drivers/net/i40e/Makefile               |  2 +-
>  drivers/net/i40e/meson.build            |  2 +-
>  drivers/net/iavf/Makefile               |  2 +-
>  drivers/net/iavf/meson.build            |  2 +-
>  drivers/net/ice/Makefile                |  2 +-
>  drivers/net/ice/meson.build             |  2 +-
>  examples/l3fwd/l3fwd_em.c               |  4 ++--
>  lib/librte_acl/Makefile                 |  2 +-
>  lib/librte_acl/meson.build              |  2 +-
>  lib/librte_eal/common/rte_random.c      |  4 ++--
>  lib/librte_eal/x86/include/rte_memcpy.h |  8 ++++----
>  lib/librte_efd/rte_efd_x86.h            |  2 +-
>  lib/librte_hash/rte_cuckoo_hash.c       |  2 +-
>  lib/librte_member/rte_member_ht.c       | 10 +++++-----
>  lib/librte_member/rte_member_x86.h      |  2 +-
>  lib/librte_net/rte_net_crc.c            |  2 +-
>  mk/rte.cpuflags.mk                      |  1 -
>  21 files changed, 31 insertions(+), 34 deletions(-)
> 
<snip>
> @@ -231,7 +231,7 @@ em_mask_key(void *key, xmm_t mask)
>  
>  	return vandq_s32(data, mask);
>  }
> -#elif defined(RTE_MACHINE_CPUFLAG_ALTIVEC)
> +#elif defined(__ALTIVEC__)

Not an x86 flag. Belongs in patch 3.

>  static inline xmm_t
>  em_mask_key(void *key, xmm_t mask)
>  {
> diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
> index f4332b044..3b591c2ed 100644
> --- a/lib/librte_acl/Makefile
> +++ b/lib/librte_acl/Makefile
> @@ -38,7 +38,7 @@ endif
>  #
>  
>  #check if flag for AVX2 is already on, if not set it up manually
> -ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)
> +ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
>  	CC_AVX2_SUPPORT=1
>  else
>  	CC_AVX2_SUPPORT=\
> diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build
> index d1e2c184c..b31a3f798 100644
> --- a/lib/librte_acl/meson.build
> +++ b/lib/librte_acl/meson.build
> @@ -15,7 +15,7 @@ if dpdk_conf.has('RTE_ARCH_X86')
>  	# in former case, just add avx2 C file to files list
>  	# in latter case, compile c file to static lib, using correct compiler
>  	# flags, and then have the .o file from static lib linked into main lib.
> -	if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
> +	if cc.get_define('__AVX2__', args: machine_args) != ''

Since this is used in a number of places, we probably should just get the
result in a variable in config/x86/meson.build.

>  		sources += files('acl_run_avx2.c')
>  		cflags += '-DCC_AVX2_SUPPORT'
>  	elif cc.has_argument('-mavx2')
<snip>

  reply	other threads:[~2020-09-02 11:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 10:43 [dpdk-dev] [PATCH v1 0/4] Remove RTE_MACHINE_CPUFLAG_ macros Radu Nicolau
2020-09-02 10:43 ` [dpdk-dev] [PATCH v1 1/4] x86: change cpuflag macros to compiler macros Radu Nicolau
2020-09-02 11:20   ` Bruce Richardson [this message]
2020-09-23 10:44   ` [dpdk-dev] [PATCH v2 0/4] Remove RTE_MACHINE_CPUFLAG_ macros Radu Nicolau
2020-09-23 10:44     ` [dpdk-dev] [PATCH v2 1/4] x86: change cpuflag macros to compiler macros Radu Nicolau
2020-09-23 15:11       ` David Marchand
2020-09-23 10:44     ` [dpdk-dev] [PATCH v2 2/4] arm: " Radu Nicolau
2020-09-23 15:11       ` David Marchand
2020-09-23 10:44     ` [dpdk-dev] [PATCH v2 3/4] ppc: " Radu Nicolau
2020-09-23 10:44     ` [dpdk-dev] [PATCH v2 4/4] doc: remove reference to RTE_MACHINE_CPUFLAG Radu Nicolau
2020-09-24  8:18   ` [dpdk-dev] [PATCH v3 0/4] Remove RTE_MACHINE_CPUFLAG_ macros Radu Nicolau
2020-09-24  8:18     ` [dpdk-dev] [PATCH v3 1/4] x86: change cpuflag macros to compiler macros Radu Nicolau
2020-09-24  8:18     ` [dpdk-dev] [PATCH v3 2/4] arm: " Radu Nicolau
2020-09-24  8:18     ` [dpdk-dev] [PATCH v3 3/4] ppc: " Radu Nicolau
2020-10-05 19:43       ` David Christensen
2020-09-24  8:18     ` [dpdk-dev] [PATCH v3 4/4] doc: remove reference to RTE_MACHINE_CPUFLAG Radu Nicolau
2020-09-25  9:18     ` [dpdk-dev] [PATCH v3 0/4] Remove RTE_MACHINE_CPUFLAG_ macros David Marchand
2020-09-02 10:43 ` [dpdk-dev] [PATCH v1 2/4] arm: change cpuflag macros to compiler macros Radu Nicolau
2020-09-02 10:43 ` [dpdk-dev] [PATCH v1 3/4] ppc: " Radu Nicolau
2020-09-02 10:43 ` [dpdk-dev] [PATCH v1 4/4] doc: remove reference to RTE_MACHINE_CPUFLAG Radu Nicolau
2020-09-02 11:21   ` Bruce Richardson
2020-09-02 16:57 ` [dpdk-dev] [PATCH v1 0/4] Remove RTE_MACHINE_CPUFLAG_ macros David Christensen
2020-09-03  9:48   ` Nicolau, Radu
2020-09-15 14:28 ` 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=20200902112016.GB1064@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=jerinj@marvell.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=ruifeng.wang@arm.com \
    --cc=sean.morrissey@intel.com \
    --cc=thomas@monjalon.net \
    --cc=viktorin@rehivetech.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).