build: add option to override max ethports

Message ID 20190131021858.5832-1-3chas3@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series build: add option to override max ethports |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Chas Williams Jan. 31, 2019, 2:18 a.m. UTC
  Allow users and packagers to override the default RTE_MAX_ETHPORTS.
This adds a new meson option, max_ethports which defaults to the
current value.

Signed-off-by: Chas Williams <3chas3@gmail.com>
---
 config/meson.build  | 1 +
 config/rte_config.h | 1 -
 meson_options.txt   | 2 ++
 3 files changed, 3 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson Jan. 31, 2019, 9:32 a.m. UTC | #1
On Wed, Jan 30, 2019 at 09:18:58PM -0500, Chas Williams wrote:
> Allow users and packagers to override the default RTE_MAX_ETHPORTS.
> This adds a new meson option, max_ethports which defaults to the
> current value.
> 
> Signed-off-by: Chas Williams <3chas3@gmail.com>

Agree with the idea. Just one small comment below re alphabetical order.

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

> ---
>  config/meson.build  | 1 +
>  config/rte_config.h | 1 -
>  meson_options.txt   | 2 ++
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index db32499b3..e59507065 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -103,6 +103,7 @@ endforeach
>  # set other values pulled from the build options
>  dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
>  dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> +dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
>  dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
>  dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id'))
>  # values which have defaults which may be overridden
> diff --git a/config/rte_config.h b/config/rte_config.h
> index d3732e953..7606f5d7b 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -51,7 +51,6 @@
>  #define RTE_PKTMBUF_HEADROOM 128
>  
>  /* ether defines */
> -#define RTE_MAX_ETHPORTS 32
>  #define RTE_MAX_QUEUES_PER_PORT 1024
>  #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
>  #define RTE_ETHDEV_RXTX_CALLBACKS 1
> diff --git a/meson_options.txt b/meson_options.txt
> index 574054597..e54eedc66 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -28,3 +28,5 @@ option('use_hpet', type: 'boolean', value: false,
>  	description: 'use HPET timer in EAL')
>  option('tests', type: 'boolean', value: true,
>  	description: 'build unit tests')
> +option('max_ethports', type: 'string', value: '32',
> +	description: 'maximum number of Ethernet devices in EAL')
> -- 

We are trying to keep the options in alphabetical order, so this setting
should be just before "max_lcores" rather than at the end.

Interestingly, I see that since 0.45 there is now the option of an
"integer" option type. We should probably switch to use that once we bump
our minimum meson version. [Luca, perhaps another change for your set?]
Ref: http://mesonbuild.com/Build-options.html#integers
  
Chas Williams Jan. 31, 2019, 11:26 p.m. UTC | #2
On 1/31/19 4:32 AM, Bruce Richardson wrote:
> On Wed, Jan 30, 2019 at 09:18:58PM -0500, Chas Williams wrote:
>> Allow users and packagers to override the default RTE_MAX_ETHPORTS.
>> This adds a new meson option, max_ethports which defaults to the
>> current value.
>>
>> Signed-off-by: Chas Williams <3chas3@gmail.com>
> 
> Agree with the idea. Just one small comment below re alphabetical order.
> 
> Otherwise:
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
...
> 
> We are trying to keep the options in alphabetical order, so this setting
> should be just before "max_lcores" rather than at the end.

If you look at the last few lines in this file:

	option('use_hpet', type: 'boolean', value: false,
		description: 'use HPET timer in EAL')
	option('tests', type: 'boolean', value: true,
		description: 'build unit tests')

I couldn't detect any ordering so I just appended.  I can submit a v2.

> Interestingly, I see that since 0.45 there is now the option of an
> "integer" option type. We should probably switch to use that once we bump
> our minimum meson version. [Luca, perhaps another change for your set?]
> Ref: http://mesonbuild.com/Build-options.html#integers

I just followed along with what everyone else was doing.
  
Bruce Richardson Feb. 4, 2019, 9:46 a.m. UTC | #3
On Thu, Jan 31, 2019 at 06:26:41PM -0500, Chas Williams wrote:
> 
> 
> On 1/31/19 4:32 AM, Bruce Richardson wrote:
> > On Wed, Jan 30, 2019 at 09:18:58PM -0500, Chas Williams wrote:
> > > Allow users and packagers to override the default RTE_MAX_ETHPORTS.
> > > This adds a new meson option, max_ethports which defaults to the
> > > current value.
> > > 
> > > Signed-off-by: Chas Williams <3chas3@gmail.com>
> > 
> > Agree with the idea. Just one small comment below re alphabetical order.
> > 
> > Otherwise:
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > 
> ...
> > 
> > We are trying to keep the options in alphabetical order, so this setting
> > should be just before "max_lcores" rather than at the end.
> 
> If you look at the last few lines in this file:
> 
> 	option('use_hpet', type: 'boolean', value: false,
> 		description: 'use HPET timer in EAL')
> 	option('tests', type: 'boolean', value: true,
> 		description: 'build unit tests')
> 
> I couldn't detect any ordering so I just appended.  I can submit a v2.

Yes, that was an oversight that was missed when we were adding those
options, or I just got my alphabet scrambled in my mind. :-) Thanks for the
v2.

> 
> > Interestingly, I see that since 0.45 there is now the option of an
> > "integer" option type. We should probably switch to use that once we bump
> > our minimum meson version. [Luca, perhaps another change for your set?]
> > Ref: http://mesonbuild.com/Build-options.html#integers
> 
> I just followed along with what everyone else was doing.

Yep, no problem here. Since we still support from 0.41 onwards we can't use
integer anyway, so what you did is perfectly correct.
  
Luca Boccassi Feb. 6, 2019, 5:10 p.m. UTC | #4
On Thu, 2019-01-31 at 09:32 +0000, Bruce Richardson wrote:
> On Wed, Jan 30, 2019 at 09:18:58PM -0500, Chas Williams wrote:
> > Allow users and packagers to override the default RTE_MAX_ETHPORTS.
> > This adds a new meson option, max_ethports which defaults to the
> > current value.
> > 
> > Signed-off-by: Chas Williams <3chas3@gmail.com>
> 
> Agree with the idea. Just one small comment below re alphabetical
> order.
> 
> Otherwise:
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> > ---
> >  config/meson.build  | 1 +
> >  config/rte_config.h | 1 -
> >  meson_options.txt   | 2 ++
> >  3 files changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/config/meson.build b/config/meson.build
> > index db32499b3..e59507065 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -103,6 +103,7 @@ endforeach
> >  # set other values pulled from the build options
> >  dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> >  dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > +dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> >  dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> >  dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID',
> > get_option('allow_invalid_socket_id'))
> >  # values which have defaults which may be overridden
> > diff --git a/config/rte_config.h b/config/rte_config.h
> > index d3732e953..7606f5d7b 100644
> > --- a/config/rte_config.h
> > +++ b/config/rte_config.h
> > @@ -51,7 +51,6 @@
> >  #define RTE_PKTMBUF_HEADROOM 128
> >  
> >  /* ether defines */
> > -#define RTE_MAX_ETHPORTS 32
> >  #define RTE_MAX_QUEUES_PER_PORT 1024
> >  #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
> >  #define RTE_ETHDEV_RXTX_CALLBACKS 1
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 574054597..e54eedc66 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -28,3 +28,5 @@ option('use_hpet', type: 'boolean', value: false,
> >  	description: 'use HPET timer in EAL')
> >  option('tests', type: 'boolean', value: true,
> >  	description: 'build unit tests')
> > +option('max_ethports', type: 'string', value: '32',
> > +	description: 'maximum number of Ethernet devices in EAL')
> > -- 
> 
> We are trying to keep the options in alphabetical order, so this
> setting
> should be just before "max_lcores" rather than at the end.
> 
> Interestingly, I see that since 0.45 there is now the option of an
> "integer" option type. We should probably switch to use that once we
> bump
> our minimum meson version. [Luca, perhaps another change for your
> set?]
> Ref: http://mesonbuild.com/Build-options.html#integers

Sounds good, I've added this change in v6 of the series
  

Patch

diff --git a/config/meson.build b/config/meson.build
index db32499b3..e59507065 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -103,6 +103,7 @@  endforeach
 # set other values pulled from the build options
 dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
 dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
+dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id'))
 # values which have defaults which may be overridden
diff --git a/config/rte_config.h b/config/rte_config.h
index d3732e953..7606f5d7b 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -51,7 +51,6 @@ 
 #define RTE_PKTMBUF_HEADROOM 128
 
 /* ether defines */
-#define RTE_MAX_ETHPORTS 32
 #define RTE_MAX_QUEUES_PER_PORT 1024
 #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
diff --git a/meson_options.txt b/meson_options.txt
index 574054597..e54eedc66 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -28,3 +28,5 @@  option('use_hpet', type: 'boolean', value: false,
 	description: 'use HPET timer in EAL')
 option('tests', type: 'boolean', value: true,
 	description: 'build unit tests')
+option('max_ethports', type: 'string', value: '32',
+	description: 'maximum number of Ethernet devices in EAL')