[1/2] net/bnxt: add meson build option

Message ID 20200721174712.48625-1-ajit.khaparde@broadcom.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ajit Khaparde
Headers
Series [1/2] net/bnxt: add meson build option |

Checks

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

Commit Message

Ajit Khaparde July 21, 2020, 5:47 p.m. UTC
  Add an option in meson build to indicate the memory management scheme.
bnxt_eem_system is set to false by default.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/nics/bnxt.rst     |  9 +++++++++
 drivers/net/bnxt/meson.build | 16 ++++++++++++++--
 meson_options.txt            |  2 ++
 3 files changed, 25 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit July 21, 2020, 11:09 p.m. UTC | #1
On 7/21/2020 6:47 PM, Ajit Khaparde wrote:
> Add an option in meson build to indicate the memory management scheme.
> bnxt_eem_system is set to false by default.
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

<...>

> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -2,6 +2,8 @@
>  
>  option('armv8_crypto_dir', type: 'string', value: '',
>  	description: 'path to the armv8_crypto library installation directory')
> +option('bnxt_eem_system', type: 'boolean', value: false,
> +	description: 'EEM system memory support')
>  option('disable_drivers', type: 'string', value: '',
>  	description: 'Comma-separated list of drivers to explicitly disable.')
>  option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
> 

I think it was a design decision to not have all Make config options to meson
build, and reduce compile time configuration as much as possible.

For a while we are pushing back new compile time config options unless they are
really must, the 'RTE_LIBRTE_BNXT_PMD_SYSTEM' has been merged mostly because it
has been missed.

Instead of introducing this PMD level compile time option to meson, can it be
possible to convert the config to runtime config. In the past we have used the
device arguments many times for same reason, can something similar be used here?
  
Ajit Khaparde July 22, 2020, 12:18 a.m. UTC | #2
On Tue, Jul 21, 2020 at 4:09 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 7/21/2020 6:47 PM, Ajit Khaparde wrote:
> > Add an option in meson build to indicate the memory management scheme.
> > bnxt_eem_system is set to false by default.
> >
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
> <...>
>
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -2,6 +2,8 @@
> >
> >  option('armv8_crypto_dir', type: 'string', value: '',
> >       description: 'path to the armv8_crypto library installation
> directory')
> > +option('bnxt_eem_system', type: 'boolean', value: false,
> > +     description: 'EEM system memory support')
> >  option('disable_drivers', type: 'string', value: '',
> >       description: 'Comma-separated list of drivers to explicitly
> disable.')
> >  option('drivers_install_subdir', type: 'string', value:
> 'dpdk/pmds-<VERSION>',
> >
>
> I think it was a design decision to not have all Make config options to
> meson
> build, and reduce compile time configuration as much as possible.
>
> For a while we are pushing back new compile time config options unless
> they are
> really must, the 'RTE_LIBRTE_BNXT_PMD_SYSTEM' has been merged mostly
> because it
> has been missed.
>
> Instead of introducing this PMD level compile time option to meson, can it
> be
> possible to convert the config to runtime config. In the past we have used
> the
> device arguments many times for same reason, can something similar be used
> here?
>
Sure. I can take a look at that.
  

Patch

diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
index 6ff75d0a2..dcb4309d2 100644
--- a/doc/guides/nics/bnxt.rst
+++ b/doc/guides/nics/bnxt.rst
@@ -809,6 +809,15 @@  is stopped.
 Note that TX (or RX) vector mode can be enabled independently from RX (or TX)
 vector mode.
 
+Configuration
+-------------
+
+Compilation options
+~~~~~~~~~~~~~~~~~~~
+
+- ``bnxt_eem_system``	(default **false**)
+This option allows to select the flow table memory management scheme.
+
 Appendix
 --------
 
diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index 8529b333c..21a1df915 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -4,6 +4,14 @@ 
 
 install_headers('rte_pmd_bnxt.h')
 
+bnxt_eem_sys = (get_option('bnxt_eem_system'))
+if bnxt_eem_sys
+	dpdk_conf.set('RTE_LIBRTE_BNXT_PMD_SYSTEM', true)
+	cflags += [
+		'-DTF_USE_SYSTEM_MEM'
+	]
+endif
+
 includes += include_directories('tf_ulp')
 includes += include_directories('tf_core')
 
@@ -29,7 +37,6 @@  sources = files('bnxt_cpr.c',
 	'tf_core/rand.c',
 	'tf_core/stack.c',
         'tf_core/tf_em_common.c',
-        'tf_core/tf_em_host.c',
         'tf_core/tf_em_internal.c',
 	'tf_core/tf_rm.c',
 	'tf_core/tf_tbl.c',
@@ -45,7 +52,6 @@  sources = files('bnxt_cpr.c',
 	'tf_core/tf_if_tbl.c',
 	'tf_core/ll.c',
 	'tf_core/tf_global_cfg.c',
-	'tf_core/tf_em_host.c',
 	'tf_core/tf_shadow_identifier.c',
 
 	'hcapi/hcapi_cfa_p4.c',
@@ -67,6 +73,12 @@  sources = files('bnxt_cpr.c',
 
 	'rte_pmd_bnxt.c')
 
+if bnxt_eem_sys
+	sources += files('tf_core/tf_em_system.c')
+elif not bnxt_eem_sys
+	sources += files('tf_core/tf_em_host.c')
+endif
+
 if arch_subdir == 'x86'
 	sources += files('bnxt_rxtx_vec_sse.c')
 elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64')
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..24d72fb10 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,6 +2,8 @@ 
 
 option('armv8_crypto_dir', type: 'string', value: '',
 	description: 'path to the armv8_crypto library installation directory')
+option('bnxt_eem_system', type: 'boolean', value: false,
+	description: 'EEM system memory support')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',