Skip to contentSkip to conversation

net/bnxt: add meson build option

PATCH In review Ajit Khaparde 2 participants 4 messages Jul 21, 2020 – Jul 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net/bnxt: add meson build option

Add an option in meson build to indicate the memory management scheme. bnxt_eem_system is set to false by default.

---
 doc/guides/nics/bnxt.rst     |  9 +++++++++
 drivers/net/bnxt/meson.build | 16 ++++++++++++++--
 meson_options.txt            |  2 ++
 3 files changed, 25 insertions(+), 2 deletions(-)
doc/guides/nics/bnxt.rst +9 -0
index 6ff75d0a2..dcb4309d2 100644
@@ -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
 --------
 
drivers/net/bnxt/meson.build +14 -2
index 8529b333c..21a1df915 100644
@@ -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')
meson_options.txt +2 -0
index 9bf18ab6b..24d72fb10 100644
@@ -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>',
Signature · 1 line
2.21.1 (Apple Git-122.3)
#1 lore raw

PATCH 2/2 doc: update bnxt doc

Update bnxt doc to indicate support for VF-representors and some notes about rte_flow API implementation.

---
 doc/guides/nics/bnxt.rst | 46 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
doc/guides/nics/bnxt.rst +46 -0
index dcb4309d2..98c47a243 100644
@@ -688,6 +688,52 @@ optimizes flow insertions and deletions.
 This is a tech preview feature, and is disabled by default. It can be enabled
 using bnxt devargs. For ex: "-w 0000:0d:00.0,host-based-truflow=1”.
 
+Notes
+-----
+
+- On stopping a device port, all the flows created on a port by the
+  application will be flushed from the hardware and any tables maintained
+  by the PMD. After stopping the device port, all flows on the port become
+  invalid and are not represented in the system anymore.
+  Instead of destroying or flushing such flows an application should discard
+  all references to these flows and re-create the flows as required after the
+  port is restarted.
+
+- While an application is free to use the group id attribute to group flows
+  together using a specific criteria, the BNXT PMD currently associates this
+  group id to a VNIC id. One such case is grouping of flows which are filtered
+  on the same source or destination MAC address. This allows packets of such
+  flows to be directed to one or more queues associated with the VNIC id.
+  This implementation is supported only when TRUFLOW functionality is disabled.
+
+Note: A VNIC represents a virtual interface in the hardware. It is a resource
+in the RX path of the chip and is used to setup various target actions such as
+RSS, MAC filtering etc. for the physical function in use.
+
+Virtual Function Port Representors
+----------------------------------
+The BNXT PMD supports the creation of VF port representors for the control
+and monitoring of BNXT virtual function devices. Each port representor
+corresponds to a single virtual function of that device that is connected to a
+VF. When there is no hardware flow offload, each packet transmitted by the VF
+will be received by the corresponding representor. Similarly each packet that is
+sent to a representor will be received by the VF. Applications can take
+advantage of this feature when SRIOV is enabled. The representor will allow the
+first packet that is transmitted by the VF to be received by the DPDK
+application which can then decide if the flow should be offloaded to the
+hardware. Once the flow is offloaded in the hardware, any packet matching the
+flow will be received by the VF while the DPDK application will not receive it
+any more. The BNXT PMD supports creation and handling of the port representors
+when the PMD is initialized on a PF or trusted-VF. The user can specify the list
+of VF IDs of the VFs for which the representors are needed by using the
+``devargs`` option ``representor``.::
+
+  -w DBDF,representor=[0,1,4]
+
+Note that currently hot-plugging of representor ports is not supported so all
+the required representors must be specified on the creation of the PF or the
+trusted VF.
+
 Application Support
 -------------------
 
Signature · 1 line
2.21.1 (Apple Git-122.3)
#2 lore raw
In reply to Ajit Khaparde
Quoted 4 lines · Ajit Khaparde

Add an option in meson build to indicate the memory management scheme. bnxt_eem_system is set to false by default.

<...>

meson_options.txt line 9

Quoted 12 lines
meson_options.txt +2 -0
@@ -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?

#3 lore raw
Quoted 34 lines · Ferruh Yigit
Quoted 4 lines · Ajit Khaparde

Add an option in meson build to indicate the memory management scheme. bnxt_eem_system is set to false by default.

<...>

meson_options.txt line 4

Quoted 6 lines
meson_options.txt +0 -0
@@ -2,6 +2,8 @@
 
 option('armv8_crypto_dir', type: 'string', value: '',
      description: 'path to the armv8_crypto library installation

directory')

meson_options.txt

Quoted 4 lines
meson_options.txt +2 -0
+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.')

meson_options.txt line 9

Quoted 1 line
meson_options.txt +0 -0
 option('drivers_install_subdir', type: 'string', value:

'dpdk/pmds-<VERSION>',

Quoted 1 line

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.

Quoted 7 lines

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.