DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson)
@ 2018-11-14 11:34 Christian Ehrhardt
  2018-11-14 11:34 ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Christian Ehrhardt
  2018-11-14 11:39 ` [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson) Luca Boccassi
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 11:34 UTC (permalink / raw)
  To: Luca Boccassi, dev; +Cc: Christian Ehrhardt

So far only if machine was "native" it did use the re-direction to
not set -march on ppc64 (where -march is not supported).
We have to use mcpu/mtune in any case on ppc for whatever someone using
the build system defines as machine.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/meson.build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 0b710b795..1af305f46 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -9,8 +9,9 @@ else
 endif
 dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
-# ppc64 does not support -march=native
-if host_machine.cpu_family().startswith('ppc') and machine == 'native'
+
+# ppc64 does not support -march= at all, use -mcpu and -mtune for that
+if host_machine.cpu_family().startswith('ppc')
 	machine_args += '-mcpu=' + machine
 	machine_args += '-mtune=' + machine
 else
-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 11:34 [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
@ 2018-11-14 11:34 ` Christian Ehrhardt
  2018-11-14 11:40   ` Luca Boccassi
  2018-11-14 13:06   ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Luca Boccassi
  2018-11-14 11:39 ` [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson) Luca Boccassi
  1 sibling, 2 replies; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 11:34 UTC (permalink / raw)
  To: Luca Boccassi, dev; +Cc: Christian Ehrhardt

Add the machine definition 'baseline' which is special compared
to 'native' (most optimized for current system) or any explicit
type (external entity has to decide on the type).

It defaults to the per arch agreed common minimal baseline
needed for DPDK to reasonable work.

That might not be the most optimized, but the most portable
version while still being able to support the CPU features
required for DPDK.

Going forward this can be bumped up by the DPDK project, but it
can never be an invariant like 'native'.

Distributions and other needing portable code are expected to
define the machine as 'baseline'.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 1af305f46..23f612457 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -7,6 +7,27 @@ if meson.is_cross_build()
 else
 	machine = get_option('machine')
 endif
+
+# machine type 'baseline' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK.
+# That might not be the most optimized, but the most portable version while
+# still being able to support the CPU features required for DPDK.
+# This can be bumped up by the DPDK project, but it can never be an
+# invariant like 'native'
+if machine == 'baseline'
+	if host_machine.cpu_family().startswith('x86')
+		# matches the old pre-meson build systems default
+		machine = 'corei7'
+	elif host_machine.cpu_family().startswith('arm')
+		machine = 'armv7a'
+	elif host_machine.cpu_family().startswith('aarch')
+		# arm64 manages defaults in config/arm/meson.build
+		machine = 'default'
+	elif host_machine.cpu_family().startswith('ppc')
+		machine = 'power8'
+	endif
+endif
+
 dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson)
  2018-11-14 11:34 [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
  2018-11-14 11:34 ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Christian Ehrhardt
@ 2018-11-14 11:39 ` Luca Boccassi
  1 sibling, 0 replies; 17+ messages in thread
From: Luca Boccassi @ 2018-11-14 11:39 UTC (permalink / raw)
  To: Christian Ehrhardt, dev

On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> So far only if machine was "native" it did use the re-direction to
> not set -march on ppc64 (where -march is not supported).
> We have to use mcpu/mtune in any case on ppc for whatever someone
> using
> the build system defines as machine.
> 
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>  config/meson.build | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 0b710b795..1af305f46 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -9,8 +9,9 @@ else
>  endif
>  dpdk_conf.set('RTE_MACHINE', machine)
>  machine_args = []
> -# ppc64 does not support -march=native
> -if host_machine.cpu_family().startswith('ppc') and machine ==
> 'native'
> +
> +# ppc64 does not support -march= at all, use -mcpu and -mtune for
> that
> +if host_machine.cpu_family().startswith('ppc')
>  	machine_args += '-mcpu=' + machine
>  	machine_args += '-mtune=' + machine
>  else

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 11:34 ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Christian Ehrhardt
@ 2018-11-14 11:40   ` Luca Boccassi
  2018-11-14 11:52     ` Bruce Richardson
  2018-11-14 13:06   ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Luca Boccassi
  1 sibling, 1 reply; 17+ messages in thread
From: Luca Boccassi @ 2018-11-14 11:40 UTC (permalink / raw)
  To: Christian Ehrhardt, dev

On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> Add the machine definition 'baseline' which is special compared
> to 'native' (most optimized for current system) or any explicit
> type (external entity has to decide on the type).
> 
> It defaults to the per arch agreed common minimal baseline
> needed for DPDK to reasonable work.
> 
> That might not be the most optimized, but the most portable
> version while still being able to support the CPU features
> required for DPDK.
> 
> Going forward this can be bumped up by the DPDK project, but it
> can never be an invariant like 'native'.
> 
> Distributions and other needing portable code are expected to
> define the machine as 'baseline'.
> 
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>  config/meson.build | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 1af305f46..23f612457 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -7,6 +7,27 @@ if meson.is_cross_build()
>  else
>  	machine = get_option('machine')
>  endif
> +
> +# machine type 'baseline' is special, it defaults to the per arch
> agreed common
> +# minimal baseline needed for DPDK.
> +# That might not be the most optimized, but the most portable
> version while
> +# still being able to support the CPU features required for DPDK.
> +# This can be bumped up by the DPDK project, but it can never be an
> +# invariant like 'native'
> +if machine == 'baseline'
> +	if host_machine.cpu_family().startswith('x86')
> +		# matches the old pre-meson build systems default
> +		machine = 'corei7'
> +	elif host_machine.cpu_family().startswith('arm')
> +		machine = 'armv7a'
> +	elif host_machine.cpu_family().startswith('aarch')
> +		# arm64 manages defaults in config/arm/meson.build
> +		machine = 'default'
> +	elif host_machine.cpu_family().startswith('ppc')
> +		machine = 'power8'
> +	endif
> +endif
> +
>  dpdk_conf.set('RTE_MACHINE', machine)
>  machine_args = []

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 11:40   ` Luca Boccassi
@ 2018-11-14 11:52     ` Bruce Richardson
  2018-11-14 12:05       ` Luca Boccassi
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2018-11-14 11:52 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Christian Ehrhardt, dev

On Wed, Nov 14, 2018 at 11:40:11AM +0000, Luca Boccassi wrote:
> On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> > Add the machine definition 'baseline' which is special compared
> > to 'native' (most optimized for current system) or any explicit
> > type (external entity has to decide on the type).
> > 
> > It defaults to the per arch agreed common minimal baseline
> > needed for DPDK to reasonable work.
> > 
> > That might not be the most optimized, but the most portable
> > version while still being able to support the CPU features
> > required for DPDK.
> > 
> > Going forward this can be bumped up by the DPDK project, but it
> > can never be an invariant like 'native'.
> > 
> > Distributions and other needing portable code are expected to
> > define the machine as 'baseline'.
> > 
> > Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> > ---
> >  config/meson.build | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/config/meson.build b/config/meson.build
> > index 1af305f46..23f612457 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -7,6 +7,27 @@ if meson.is_cross_build()
> >  else
> >  	machine = get_option('machine')
> >  endif
> > +
> > +# machine type 'baseline' is special, it defaults to the per arch
> > agreed common
> > +# minimal baseline needed for DPDK.
> > +# That might not be the most optimized, but the most portable
> > version while
> > +# still being able to support the CPU features required for DPDK.
> > +# This can be bumped up by the DPDK project, but it can never be an
> > +# invariant like 'native'
> > +if machine == 'baseline'
> > +	if host_machine.cpu_family().startswith('x86')
> > +		# matches the old pre-meson build systems default
> > +		machine = 'corei7'
> > +	elif host_machine.cpu_family().startswith('arm')
> > +		machine = 'armv7a'
> > +	elif host_machine.cpu_family().startswith('aarch')
> > +		# arm64 manages defaults in config/arm/meson.build
> > +		machine = 'default'
> > +	elif host_machine.cpu_family().startswith('ppc')
> > +		machine = 'power8'
> > +	endif
> > +endif
> > +
> >  dpdk_conf.set('RTE_MACHINE', machine)
> >  machine_args = []
> 
> Acked-by: Luca Boccassi <bluca@debian.org>
> 
No objection in principle, but, for alignment with make build system, do we
want to call this "default" instead? Given a clean slate, "baseline" is more
descriptive, but make already uses "default" for this. Perhaps support
both?

/Bruce

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 11:52     ` Bruce Richardson
@ 2018-11-14 12:05       ` Luca Boccassi
  2018-11-14 13:09         ` Christian Ehrhardt
  0 siblings, 1 reply; 17+ messages in thread
From: Luca Boccassi @ 2018-11-14 12:05 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Christian Ehrhardt, dev

On Wed, 2018-11-14 at 11:52 +0000, Bruce Richardson wrote:
> On Wed, Nov 14, 2018 at 11:40:11AM +0000, Luca Boccassi wrote:
> > On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> > > Add the machine definition 'baseline' which is special compared
> > > to 'native' (most optimized for current system) or any explicit
> > > type (external entity has to decide on the type).
> > > 
> > > It defaults to the per arch agreed common minimal baseline
> > > needed for DPDK to reasonable work.
> > > 
> > > That might not be the most optimized, but the most portable
> > > version while still being able to support the CPU features
> > > required for DPDK.
> > > 
> > > Going forward this can be bumped up by the DPDK project, but it
> > > can never be an invariant like 'native'.
> > > 
> > > Distributions and other needing portable code are expected to
> > > define the machine as 'baseline'.
> > > 
> > > Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.c
> > > om>
> > > ---
> > >  config/meson.build | 21 +++++++++++++++++++++
> > >  1 file changed, 21 insertions(+)
> > > 
> > > diff --git a/config/meson.build b/config/meson.build
> > > index 1af305f46..23f612457 100644
> > > --- a/config/meson.build
> > > +++ b/config/meson.build
> > > @@ -7,6 +7,27 @@ if meson.is_cross_build()
> > >  else
> > >  	machine = get_option('machine')
> > >  endif
> > > +
> > > +# machine type 'baseline' is special, it defaults to the per
> > > arch
> > > agreed common
> > > +# minimal baseline needed for DPDK.
> > > +# That might not be the most optimized, but the most portable
> > > version while
> > > +# still being able to support the CPU features required for
> > > DPDK.
> > > +# This can be bumped up by the DPDK project, but it can never be
> > > an
> > > +# invariant like 'native'
> > > +if machine == 'baseline'
> > > +	if host_machine.cpu_family().startswith('x86')
> > > +		# matches the old pre-meson build systems
> > > default
> > > +		machine = 'corei7'
> > > +	elif host_machine.cpu_family().startswith('arm')
> > > +		machine = 'armv7a'
> > > +	elif host_machine.cpu_family().startswith('aarch')
> > > +		# arm64 manages defaults in
> > > config/arm/meson.build
> > > +		machine = 'default'
> > > +	elif host_machine.cpu_family().startswith('ppc')
> > > +		machine = 'power8'
> > > +	endif
> > > +endif
> > > +
> > >  dpdk_conf.set('RTE_MACHINE', machine)
> > >  machine_args = []
> > 
> > Acked-by: Luca Boccassi <bluca@debian.org>
> > 
> 
> No objection in principle, but, for alignment with make build system,
> do we
> want to call this "default" instead? Given a clean slate, "baseline"
> is more
> descriptive, but make already uses "default" for this. Perhaps
> support
> both?
> 
> /Bruce

I'm fine with both - but if make already has default, it makes sense to
keep it consistent.

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 11:34 ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Christian Ehrhardt
  2018-11-14 11:40   ` Luca Boccassi
@ 2018-11-14 13:06   ` Luca Boccassi
  2018-11-14 13:08     ` Christian Ehrhardt
  1 sibling, 1 reply; 17+ messages in thread
From: Luca Boccassi @ 2018-11-14 13:06 UTC (permalink / raw)
  To: Christian Ehrhardt, dev

On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> Add the machine definition 'baseline' which is special compared
> to 'native' (most optimized for current system) or any explicit
> type (external entity has to decide on the type).
> 
> It defaults to the per arch agreed common minimal baseline
> needed for DPDK to reasonable work.
> 
> That might not be the most optimized, but the most portable
> version while still being able to support the CPU features
> required for DPDK.
> 
> Going forward this can be bumped up by the DPDK project, but it
> can never be an invariant like 'native'.
> 
> Distributions and other needing portable code are expected to
> define the machine as 'baseline'.
> 
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>  config/meson.build | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 1af305f46..23f612457 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -7,6 +7,27 @@ if meson.is_cross_build()
>  else
>  	machine = get_option('machine')
>  endif
> +
> +# machine type 'baseline' is special, it defaults to the per arch
> agreed common
> +# minimal baseline needed for DPDK.
> +# That might not be the most optimized, but the most portable
> version while
> +# still being able to support the CPU features required for DPDK.
> +# This can be bumped up by the DPDK project, but it can never be an
> +# invariant like 'native'
> +if machine == 'baseline'
> +	if host_machine.cpu_family().startswith('x86')
> +		# matches the old pre-meson build systems default
> +		machine = 'corei7'
> +	elif host_machine.cpu_family().startswith('arm')
> +		machine = 'armv7a'

gcc complains, it wants armv7-a instead (tried on a native armhf
machine, with the change the meson configure passes and ninja is now
_slowly_ building its way through)

> +	elif host_machine.cpu_family().startswith('aarch')
> +		# arm64 manages defaults in config/arm/meson.build
> +		machine = 'default'
> +	elif host_machine.cpu_family().startswith('ppc')
> +		machine = 'power8'
> +	endif
> +endif
> +
>  dpdk_conf.set('RTE_MACHINE', machine)
>  machine_args = []
>  

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 13:06   ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Luca Boccassi
@ 2018-11-14 13:08     ` Christian Ehrhardt
  0 siblings, 0 replies; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 13:08 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev

On Wed, Nov 14, 2018 at 2:06 PM Luca Boccassi <bluca@debian.org> wrote:
>
> On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> > Add the machine definition 'baseline' which is special compared
> > to 'native' (most optimized for current system) or any explicit
> > type (external entity has to decide on the type).
> >
> > It defaults to the per arch agreed common minimal baseline
> > needed for DPDK to reasonable work.
> >
> > That might not be the most optimized, but the most portable
> > version while still being able to support the CPU features
> > required for DPDK.
> >
> > Going forward this can be bumped up by the DPDK project, but it
> > can never be an invariant like 'native'.
> >
> > Distributions and other needing portable code are expected to
> > define the machine as 'baseline'.
> >
> > Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> > ---
> >  config/meson.build | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> >
> > diff --git a/config/meson.build b/config/meson.build
> > index 1af305f46..23f612457 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -7,6 +7,27 @@ if meson.is_cross_build()
> >  else
> >       machine = get_option('machine')
> >  endif
> > +
> > +# machine type 'baseline' is special, it defaults to the per arch
> > agreed common
> > +# minimal baseline needed for DPDK.
> > +# That might not be the most optimized, but the most portable
> > version while
> > +# still being able to support the CPU features required for DPDK.
> > +# This can be bumped up by the DPDK project, but it can never be an
> > +# invariant like 'native'
> > +if machine == 'baseline'
> > +     if host_machine.cpu_family().startswith('x86')
> > +             # matches the old pre-meson build systems default
> > +             machine = 'corei7'
> > +     elif host_machine.cpu_family().startswith('arm')
> > +             machine = 'armv7a'
>
> gcc complains, it wants armv7-a instead (tried on a native armhf
> machine, with the change the meson configure passes and ninja is now
> _slowly_ building its way through)

Thanks will update that in a v2

>
> > +     elif host_machine.cpu_family().startswith('aarch')
> > +             # arm64 manages defaults in config/arm/meson.build
> > +             machine = 'default'
> > +     elif host_machine.cpu_family().startswith('ppc')
> > +             machine = 'power8'
> > +     endif
> > +endif
> > +
> >  dpdk_conf.set('RTE_MACHINE', machine)
> >  machine_args = []
> >
>
> --
> Kind regards,
> Luca Boccassi



-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type
  2018-11-14 12:05       ` Luca Boccassi
@ 2018-11-14 13:09         ` Christian Ehrhardt
  2018-11-14 13:18           ` [dpdk-dev] [PATCH] " Christian Ehrhardt
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 13:09 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Bruce Richardson, dev

On Wed, Nov 14, 2018 at 1:05 PM Luca Boccassi <bluca@debian.org> wrote:
>
> On Wed, 2018-11-14 at 11:52 +0000, Bruce Richardson wrote:
> > On Wed, Nov 14, 2018 at 11:40:11AM +0000, Luca Boccassi wrote:
> > > On Wed, 2018-11-14 at 12:34 +0100, Christian Ehrhardt wrote:
> > > > Add the machine definition 'baseline' which is special compared
> > > > to 'native' (most optimized for current system) or any explicit
> > > > type (external entity has to decide on the type).
> > > >
> > > > It defaults to the per arch agreed common minimal baseline
> > > > needed for DPDK to reasonable work.
> > > >
> > > > That might not be the most optimized, but the most portable
> > > > version while still being able to support the CPU features
> > > > required for DPDK.
> > > >
> > > > Going forward this can be bumped up by the DPDK project, but it
> > > > can never be an invariant like 'native'.
> > > >
> > > > Distributions and other needing portable code are expected to
> > > > define the machine as 'baseline'.
> > > >
> > > > Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.c
> > > > om>
> > > > ---
> > > >  config/meson.build | 21 +++++++++++++++++++++
> > > >  1 file changed, 21 insertions(+)
> > > >
> > > > diff --git a/config/meson.build b/config/meson.build
> > > > index 1af305f46..23f612457 100644
> > > > --- a/config/meson.build
> > > > +++ b/config/meson.build
> > > > @@ -7,6 +7,27 @@ if meson.is_cross_build()
> > > >  else
> > > >   machine = get_option('machine')
> > > >  endif
> > > > +
> > > > +# machine type 'baseline' is special, it defaults to the per
> > > > arch
> > > > agreed common
> > > > +# minimal baseline needed for DPDK.
> > > > +# That might not be the most optimized, but the most portable
> > > > version while
> > > > +# still being able to support the CPU features required for
> > > > DPDK.
> > > > +# This can be bumped up by the DPDK project, but it can never be
> > > > an
> > > > +# invariant like 'native'
> > > > +if machine == 'baseline'
> > > > + if host_machine.cpu_family().startswith('x86')
> > > > +         # matches the old pre-meson build systems
> > > > default
> > > > +         machine = 'corei7'
> > > > + elif host_machine.cpu_family().startswith('arm')
> > > > +         machine = 'armv7a'
> > > > + elif host_machine.cpu_family().startswith('aarch')
> > > > +         # arm64 manages defaults in
> > > > config/arm/meson.build
> > > > +         machine = 'default'
> > > > + elif host_machine.cpu_family().startswith('ppc')
> > > > +         machine = 'power8'
> > > > + endif
> > > > +endif
> > > > +
> > > >  dpdk_conf.set('RTE_MACHINE', machine)
> > > >  machine_args = []
> > >
> > > Acked-by: Luca Boccassi <bluca@debian.org>
> > >
> >
> > No objection in principle, but, for alignment with make build system,
> > do we
> > want to call this "default" instead? Given a clean slate, "baseline"
> > is more
> > descriptive, but make already uses "default" for this. Perhaps
> > support
> > both?
> >
> > /Bruce
>
> I'm fine with both - but if make already has default, it makes sense to
> keep it consistent.

Yeah I agree for consistency, I just need to check for a v2 if none of
them will misuse default to become native again

> --
> Kind regards,
> Luca Boccassi



-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH] build: establish an invariant machine type
  2018-11-14 13:09         ` Christian Ehrhardt
@ 2018-11-14 13:18           ` Christian Ehrhardt
  2018-11-14 13:54             ` Bruce Richardson
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 13:18 UTC (permalink / raw)
  To: Luca Boccassi, dev, Bruce Richardson; +Cc: Christian Ehrhardt

Add the machine definition 'default' which is special compared
to 'native' (most optimized for current system) or any explicit
type (external entity has to decide on the type).

It defaults to the per arch agreed common minimal baseline
needed for DPDK to reasonable work.

That might not be the most optimized, but the most portable
version while still being able to support the CPU features
required for DPDK.

Going forward this can be bumped up by the DPDK project, but it
can never be an invariant like 'native'.

Distributions and other needing portable code are expected to
define the machine as 'baseline'.

Changes in v2:
- fixed the non 64 bit arm default type
- changed baseline to default to match the old build system

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 1af305f46..db32499b3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -7,6 +7,27 @@ if meson.is_cross_build()
 else
 	machine = get_option('machine')
 endif
+
+# machine type 'default' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK.
+# That might not be the most optimized, but the most portable version while
+# still being able to support the CPU features required for DPDK.
+# This can be bumped up by the DPDK project, but it can never be an
+# invariant like 'native'
+if machine == 'default'
+	if host_machine.cpu_family().startswith('x86')
+		# matches the old pre-meson build systems default
+		machine = 'corei7'
+	elif host_machine.cpu_family().startswith('arm')
+		machine = 'armv7-a'
+	elif host_machine.cpu_family().startswith('aarch')
+		# arm64 manages defaults in config/arm/meson.build
+		machine = 'default'
+	elif host_machine.cpu_family().startswith('ppc')
+		machine = 'power8'
+	endif
+endif
+
 dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH] build: establish an invariant machine type
  2018-11-14 13:18           ` [dpdk-dev] [PATCH] " Christian Ehrhardt
@ 2018-11-14 13:54             ` Bruce Richardson
  2018-11-14 14:33               ` [dpdk-dev] [PATCH v3] " Christian Ehrhardt
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2018-11-14 13:54 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: Luca Boccassi, dev

On Wed, Nov 14, 2018 at 02:18:38PM +0100, Christian Ehrhardt wrote:
> Add the machine definition 'default' which is special compared
> to 'native' (most optimized for current system) or any explicit
> type (external entity has to decide on the type).
> 
> It defaults to the per arch agreed common minimal baseline
> needed for DPDK to reasonable work.
> 
> That might not be the most optimized, but the most portable
> version while still being able to support the CPU features
> required for DPDK.
> 
> Going forward this can be bumped up by the DPDK project, but it
> can never be an invariant like 'native'.
> 
> Distributions and other needing portable code are expected to
> define the machine as 'baseline'.
> 
Need to change 'baseline' to 'default' here.

> Changes in v2:
> - fixed the non 64 bit arm default type
> - changed baseline to default to match the old build system
> 
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3] build: establish an invariant machine type
  2018-11-14 13:54             ` Bruce Richardson
@ 2018-11-14 14:33               ` Christian Ehrhardt
  2018-11-14 19:39                 ` Christian Ehrhardt
  2018-11-14 19:40                 ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 14:33 UTC (permalink / raw)
  To: Luca Boccassi, dev, Bruce Richardson; +Cc: Christian Ehrhardt

Add the machine definition 'default' which is special compared
to 'native' (most optimized for current system) or any explicit
type (external entity has to decide on the type).

It defaults to the per arch agreed common minimal baseline
needed for DPDK to reasonable work.

That might not be the most optimized, but the most portable
version while still being able to support the CPU features
required for DPDK.

Going forward this can be bumped up by the DPDK project, but it
can never be an invariant like 'native'.

Distributions and other needing portable code are expected to
define the machine as 'default'.

Changes in v2:
- fixed the non 64 bit arm default type
- changed baseline to default to match the old build system

Changes in v3:
- add acked-by's
- removed old wording from commit message
- adding Fixes line per request by Luca Boccassi

Fixes: 54d609a13876 ("build: add ppc64 meson build")

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 1af305f46..db32499b3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -7,6 +7,27 @@ if meson.is_cross_build()
 else
 	machine = get_option('machine')
 endif
+
+# machine type 'default' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK.
+# That might not be the most optimized, but the most portable version while
+# still being able to support the CPU features required for DPDK.
+# This can be bumped up by the DPDK project, but it can never be an
+# invariant like 'native'
+if machine == 'default'
+	if host_machine.cpu_family().startswith('x86')
+		# matches the old pre-meson build systems default
+		machine = 'corei7'
+	elif host_machine.cpu_family().startswith('arm')
+		machine = 'armv7-a'
+	elif host_machine.cpu_family().startswith('aarch')
+		# arm64 manages defaults in config/arm/meson.build
+		machine = 'default'
+	elif host_machine.cpu_family().startswith('ppc')
+		machine = 'power8'
+	endif
+endif
+
 dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3] build: establish an invariant machine type
  2018-11-14 14:33               ` [dpdk-dev] [PATCH v3] " Christian Ehrhardt
@ 2018-11-14 19:39                 ` Christian Ehrhardt
  2018-11-18 13:24                   ` Thomas Monjalon
  2018-11-14 19:40                 ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
  1 sibling, 1 reply; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 19:39 UTC (permalink / raw)
  To: Luca Boccassi, dev, Bruce Richardson

On Wed, Nov 14, 2018 at 3:33 PM Christian Ehrhardt
<christian.ehrhardt@canonical.com> wrote:
>
> Add the machine definition 'default' which is special compared
> to 'native' (most optimized for current system) or any explicit
> type (external entity has to decide on the type).
>
> It defaults to the per arch agreed common minimal baseline
> needed for DPDK to reasonable work.
>
> That might not be the most optimized, but the most portable
> version while still being able to support the CPU features
> required for DPDK.
>
> Going forward this can be bumped up by the DPDK project, but it
> can never be an invariant like 'native'.
>
> Distributions and other needing portable code are expected to
> define the machine as 'default'.
>
> Changes in v2:
> - fixed the non 64 bit arm default type
> - changed baseline to default to match the old build system
>
> Changes in v3:
> - add acked-by's
> - removed old wording from commit message
> - adding Fixes line per request by Luca Boccassi

FYI: I'll drop the version update from the commit (I didn't have a
cover letter to add them instead).
Also I'll add the Acked-by of Luca to the other patch as well and move
the Fixes line as it was meant for the 1/2 of these.

Overall I think v4 will then be fine, all acks in place and hopefully
making it in before -rc4 is defined to fix more peoples builds.
Replying to this mail with both updated patches soon, let me know if
anything else is holding these back from being accepted.

> Fixes: 54d609a13876 ("build: add ppc64 meson build")
>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Luca Boccassi <bluca@debian.org>
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>  config/meson.build | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/config/meson.build b/config/meson.build
> index 1af305f46..db32499b3 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -7,6 +7,27 @@ if meson.is_cross_build()
>  else
>         machine = get_option('machine')
>  endif
> +
> +# machine type 'default' is special, it defaults to the per arch agreed common
> +# minimal baseline needed for DPDK.
> +# That might not be the most optimized, but the most portable version while
> +# still being able to support the CPU features required for DPDK.
> +# This can be bumped up by the DPDK project, but it can never be an
> +# invariant like 'native'
> +if machine == 'default'
> +       if host_machine.cpu_family().startswith('x86')
> +               # matches the old pre-meson build systems default
> +               machine = 'corei7'
> +       elif host_machine.cpu_family().startswith('arm')
> +               machine = 'armv7-a'
> +       elif host_machine.cpu_family().startswith('aarch')
> +               # arm64 manages defaults in config/arm/meson.build
> +               machine = 'default'
> +       elif host_machine.cpu_family().startswith('ppc')
> +               machine = 'power8'
> +       endif
> +endif
> +
>  dpdk_conf.set('RTE_MACHINE', machine)
>  machine_args = []
>
> --
> 2.17.1
>


-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson)
  2018-11-14 14:33               ` [dpdk-dev] [PATCH v3] " Christian Ehrhardt
  2018-11-14 19:39                 ` Christian Ehrhardt
@ 2018-11-14 19:40                 ` Christian Ehrhardt
  2018-11-14 19:40                   ` [dpdk-dev] [PATCH v4 2/2] build: establish an invariant machine type Christian Ehrhardt
  2018-11-18 14:24                   ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Thomas Monjalon
  1 sibling, 2 replies; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 19:40 UTC (permalink / raw)
  To: Luca Boccassi, dev, Bruce Richardson; +Cc: Christian Ehrhardt

So far only if machine was "native" it did use the re-direction to
not set -march on ppc64 (where -march is not supported).
We have to use mcpu/mtune in any case on ppc for whatever someone using
the build system defines as machine.

Fixes: 54d609a13876 ("build: add ppc64 meson build")

Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/meson.build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 0b710b795..1af305f46 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -9,8 +9,9 @@ else
 endif
 dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
-# ppc64 does not support -march=native
-if host_machine.cpu_family().startswith('ppc') and machine == 'native'
+
+# ppc64 does not support -march= at all, use -mcpu and -mtune for that
+if host_machine.cpu_family().startswith('ppc')
 	machine_args += '-mcpu=' + machine
 	machine_args += '-mtune=' + machine
 else
-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v4 2/2] build: establish an invariant machine type
  2018-11-14 19:40                 ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
@ 2018-11-14 19:40                   ` Christian Ehrhardt
  2018-11-18 14:24                   ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Thomas Monjalon
  1 sibling, 0 replies; 17+ messages in thread
From: Christian Ehrhardt @ 2018-11-14 19:40 UTC (permalink / raw)
  To: Luca Boccassi, dev, Bruce Richardson; +Cc: Christian Ehrhardt

Add the machine definition 'default' which is special compared
to 'native' (most optimized for current system) or any explicit
type (external entity has to decide on the type).

It defaults to the per arch agreed common minimal baseline
needed for DPDK to reasonable work.

That might not be the most optimized, but the most portable
version while still being able to support the CPU features
required for DPDK.

Going forward this can be bumped up by the DPDK project, but it
can never be an invariant like 'native'.

Distributions and other needing portable code are expected to
define the machine as 'default'.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 config/meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 1af305f46..db32499b3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -7,6 +7,27 @@ if meson.is_cross_build()
 else
 	machine = get_option('machine')
 endif
+
+# machine type 'default' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK.
+# That might not be the most optimized, but the most portable version while
+# still being able to support the CPU features required for DPDK.
+# This can be bumped up by the DPDK project, but it can never be an
+# invariant like 'native'
+if machine == 'default'
+	if host_machine.cpu_family().startswith('x86')
+		# matches the old pre-meson build systems default
+		machine = 'corei7'
+	elif host_machine.cpu_family().startswith('arm')
+		machine = 'armv7-a'
+	elif host_machine.cpu_family().startswith('aarch')
+		# arm64 manages defaults in config/arm/meson.build
+		machine = 'default'
+	elif host_machine.cpu_family().startswith('ppc')
+		machine = 'power8'
+	endif
+endif
+
 dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3] build: establish an invariant machine type
  2018-11-14 19:39                 ` Christian Ehrhardt
@ 2018-11-18 13:24                   ` Thomas Monjalon
  0 siblings, 0 replies; 17+ messages in thread
From: Thomas Monjalon @ 2018-11-18 13:24 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: dev, Luca Boccassi, Bruce Richardson

14/11/2018 20:39, Christian Ehrhardt:
> On Wed, Nov 14, 2018 at 3:33 PM Christian Ehrhardt
> <christian.ehrhardt@canonical.com> wrote:
> >
> > Add the machine definition 'default' which is special compared
> > to 'native' (most optimized for current system) or any explicit
> > type (external entity has to decide on the type).
> >
> > It defaults to the per arch agreed common minimal baseline
> > needed for DPDK to reasonable work.
> >
> > That might not be the most optimized, but the most portable
> > version while still being able to support the CPU features
> > required for DPDK.
> >
> > Going forward this can be bumped up by the DPDK project, but it
> > can never be an invariant like 'native'.
> >
> > Distributions and other needing portable code are expected to
> > define the machine as 'default'.
> >
> > Changes in v2:
> > - fixed the non 64 bit arm default type
> > - changed baseline to default to match the old build system
> >
> > Changes in v3:
> > - add acked-by's
> > - removed old wording from commit message
> > - adding Fixes line per request by Luca Boccassi
> 
> FYI: I'll drop the version update from the commit (I didn't have a
> cover letter to add them instead).

You don't need a cover letter for changelogs.
You can insert it after ---
Usually, I insert changelogs between two --- lines.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson)
  2018-11-14 19:40                 ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
  2018-11-14 19:40                   ` [dpdk-dev] [PATCH v4 2/2] build: establish an invariant machine type Christian Ehrhardt
@ 2018-11-18 14:24                   ` Thomas Monjalon
  1 sibling, 0 replies; 17+ messages in thread
From: Thomas Monjalon @ 2018-11-18 14:24 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: dev, Luca Boccassi, Bruce Richardson

14/11/2018 20:40, Christian Ehrhardt:
> So far only if machine was "native" it did use the re-direction to
> not set -march on ppc64 (where -march is not supported).
> We have to use mcpu/mtune in any case on ppc for whatever someone using
> the build system defines as machine.
> 
> Fixes: 54d609a13876 ("build: add ppc64 meson build")
> 
> Acked-by: Luca Boccassi <bluca@debian.org>
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>

Series applied, thanks

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-11-18 14:24 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 11:34 [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
2018-11-14 11:34 ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Christian Ehrhardt
2018-11-14 11:40   ` Luca Boccassi
2018-11-14 11:52     ` Bruce Richardson
2018-11-14 12:05       ` Luca Boccassi
2018-11-14 13:09         ` Christian Ehrhardt
2018-11-14 13:18           ` [dpdk-dev] [PATCH] " Christian Ehrhardt
2018-11-14 13:54             ` Bruce Richardson
2018-11-14 14:33               ` [dpdk-dev] [PATCH v3] " Christian Ehrhardt
2018-11-14 19:39                 ` Christian Ehrhardt
2018-11-18 13:24                   ` Thomas Monjalon
2018-11-14 19:40                 ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Christian Ehrhardt
2018-11-14 19:40                   ` [dpdk-dev] [PATCH v4 2/2] build: establish an invariant machine type Christian Ehrhardt
2018-11-18 14:24                   ` [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) Thomas Monjalon
2018-11-14 13:06   ` [dpdk-dev] [PATCH 2/2] build: establish an invariant machine type Luca Boccassi
2018-11-14 13:08     ` Christian Ehrhardt
2018-11-14 11:39 ` [dpdk-dev] [PATCH 1/2] build: avoid non supported -march on ppc (meson) Luca Boccassi

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git