1. The flow database opcode is updated to split the alloc push resource
item so it can be controlled using the control table.
2. The class and action match signatures are populated with pattern ids
that are matched against template pattern id to reject any unsupported
class and action combinations.
3. The flow DB opcode should be no op when accessing the
global registry identifiers.
4. The resource function for branch is changed to control so that it
is extended to perform flow database operations and not just branch
operations.
5. The conditional goto processing now supports negative numbers to
support looping of the mapper tables to support flow ranges and
also enable conditional fail goto to support failure path mapper
tables.
6. The field mapper opcode is updated to add all ones to fields
that support exact match.
7. Added key info and identifier list to whitney action templates
The whitney plus templates are updated to use the mapper infrastructure
changes.
8. The partition interface table configuration of the default
egress rule for the representor interface needs to use the
reserved parif interface that is specific to each
platform. The pipeline for the representor interface is broken
since incorrect parif configuration cause the miss path packets to
be dropped.
9. In the mapper table processing, if a failure condition is hit
due to invalid memory type then use the conditional goto failure
configuration instead of jumping to next table. This causes ipv6
exact match entry to be skipped. This patch fixes that issue.
net/bnxt: add conditional opcode and L4 port fields
The conditional field opcode provides capability to perform
changes to the field values specified by template to address
platform specific modifications. For instance, mirror id value
is modified before it is configured in the hardware.
The addition of L4 port compute fields enables support of
generic exact match rule that can support both TCP and UDP
flows with the same template.
The shared handle is set in the mapper params when generic resource
are created, this shall be used by application as a handle to the
shared resource like mirror handle.
The condition execute of the mapper tables have goto field that
defines the offset of the next table to be processed instead of
sequential processing of the tables, this improving the performance.
Also, modify key and mask field opcode processing
Conflict resolution feature allows rejection of flows based on
the previously added flows that conflict. For instance, a five
tuple flow is added and then you add a new flow with only 4 tuple
instead having same layer2 details then it will be rejected.
1. Added interface table specific opcode to process interface table
entry creation and reuse. This allows reuse of the interface table
entry for multiple flows. Changed the regfile apis to store
the data in big endian format.
2. The result blob creation being done in tcam, interface, index
tables are consolidate to a common method.
3. Added result blob processing for generic table write
4. Modified the index table opcode processing to support new opcodes.
5. The driver was setting key size that did not take into account
the word alignment.
6. The hard coded values for critical resource is replaced with
template defined values.
Venkat Duvvuru [Sun, 30 May 2021 08:59:02 +0000 (14:29 +0530)]
net/bnxt: modify VXLAN decap for multichannel mode
The driver is using physical port id as the index into
the tunnel inner flow table. However, this will not work in case
of multichannel mode where multiple physical functions are going
to share the same physical port id.
When tunnel inner flow offload request comes before tunnel
outer flow offload request, the driver caches the tunnel inner flow
details and programs it in the hardware after installing the tunnel
outer flow in the hardware. If more than one tunnel inner flow arrives
before tunnel outer flow is offloaded, the driver rejects any such
tunnel inner flow offload requests.
This patch fixes the above two problems by
1. Using dpdk port id as the index to store tunnel inner info.
2. Caching any number of tunnel inner flow offload requests that come
before offloading tunnel outer flow offload request
Added TCAM table specific opcode to process TCAM entry creation
and reuse. This change removes the TCAM cache mechanism and uses
the generic table mechanism for reuse of TCAM entries.
Mike Baucom [Sun, 30 May 2021 08:59:00 +0000 (14:29 +0530)]
net/bnxt: add conditional processing of templates
Conditional execution and rejection processing added for templates and
tables. This allows the mapper to skip tables and reject templates
based on the content without having to hard code rules.
Added support for mapper flow database opcode to enable
shared resources like mirror action. This allows mapper
to conditionally populate flow database based on template content.
Venkat Duvvuru [Sun, 30 May 2021 08:58:57 +0000 (14:28 +0530)]
net/bnxt: check FW capability to support TRUFLOW
Currently, a devarg (host-based-truflow) is passed while launching
the app to enable TRUFLOW feature. However, this mechanism adds
an extra step in enabling TRUFLOW. This doesn't give a seamless
experience when flow offloads has to work with FW that doesn't/does
support TRUFLOW feature. Also, it's likely that customers may not
want to use devarg to enable flow offloads.
This patch fixes it by checking for TRUFLOW feature support in
device's capabilities and configurations field of the hwrm_ver_get.
Jay Ding [Sun, 30 May 2021 08:58:55 +0000 (14:28 +0530)]
net/bnxt: support WC TCAM shared session
If the session shares WC TCAM entries with others,
specify it in the session name by attach "-wc_tcam".
Firmware will flush the shared WC TCAM entries if
the last shared session using them is closed.
Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Mike Baucom <michael.baucom@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Farah Smith [Sun, 30 May 2021 08:58:54 +0000 (14:28 +0530)]
net/bnxt: cleanup WC TCAM shared pool
Clean up all allocated hi or lo pool TCAM regions on close.
Along with message cleanup and remove unnecessary multi-slice options
Also make sure that find next free entry should start from 0 first time.
Signed-off-by: Farah Smith <farah.smith@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Jay Ding [Sun, 30 May 2021 08:58:53 +0000 (14:28 +0530)]
net/bnxt: refactor host session failure cleanup
- Close FW session if session open fails after Fw session open.
- Additional WC TCAM debug info to help in future debug
- Reduce key/mask buffer sizes for performance
- When a 64b counter is freed, clear the entry
Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Farah Smith <farah.smith@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Farah Smith [Sun, 30 May 2021 08:58:49 +0000 (14:28 +0530)]
net/bnxt: support shared TCAM region
- switch to single slice management on Wh+
- Support of shared session WC_TCAM_HIGH and WC_TCAM_LOW regions
- Enable/disable using TF_TCAM_SHARED flag in tf_core.h
- Fix empty session module DBs in the case that none are
allocated for a given module type
Signed-off-by: Farah Smith <farah.smith@broadcom.com> Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
The dpool allocator supports variable size entries and
also supports defragmentation of the allocation space.
EM will by default use the fixed size stack allocator.
The dynamic allocator may be selected at build time.
The dpool allocator supports variable size entries and
also supports defragmentation of the allocation space.
Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Jay Ding [Sun, 30 May 2021 08:58:45 +0000 (14:28 +0530)]
net/bnxt: support shared session
There are 2 types of sessions - shared and non-shared. For non-shared
all the allocated resources are owned and managed by a single
session instance. No other applications have access to the
resources owned by the non-shared session. For a shared session,
resources are shared between 2 applications.
The FW shared session can only be created by one application and
shared by other apps. The host session that creates the FW shared
session is the creator.
Applications can retrieve the reserved resources through a new API
tf_get_session_resc_info.
Each module supports two sessions, one is shared session, the other
is non-shared session.
Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Jay Ding [Sun, 30 May 2021 08:58:44 +0000 (14:28 +0530)]
net/bnxt: change RM database type
RM databases are statically defined in each module. New static
database needs to be defined in the code when multiple sessions
are added. Add dynamic alloc database and associate it to each
session.
Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
- Move HCAPI hashing code to common file and add Thor support.
- Change DPDK EM insert for FKB to use limited size Type 3 key.
- Update FKB builder to be able to tell between EM and WC keys
during transform.
FKB is the Flexible Key Builder in Thor used while inserting flows.
Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Farah Smith [Sun, 30 May 2021 08:58:41 +0000 (14:28 +0530)]
net/bnxt: add 64B SRAM record management with RM
HCAPI RM now manages 64Byte records instead of 8Byte.
Truflow core RM will manage the same. The tf_tbl core
APIs now return 8B pointer addresses. These can
be used directly as SRAM pointers in Action Records.
When communicating with the firmware 8 byte addresses
will be used.
Signed-off-by: Farah Smith <farah.smith@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Jay Ding [Sun, 30 May 2021 08:58:40 +0000 (14:28 +0530)]
net/bnxt: support Thor WC TCAM
1. Add set/get/free/alloc for WC TCAM
2. Rework the key size in slice management.
3. Add 3 FKB WC keys for WC TCAM set cli cmd
4. Add transform key function for WC TCAM FKB key
5. Add checking for key buffer length for get_tcam
Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Farah Smith [Sun, 30 May 2021 08:58:39 +0000 (14:28 +0530)]
net/bnxt: add action SRAM translation
- Translate Truflow action types for Thor to HCAPI RM
resource defined SRAM banks.
- move module type enum definitions to tf_core API
- Switch to subtype concept for RM.
- alloc/free working for Thor SRAM table type for full AR.
Signed-off-by: Farah Smith <farah.smith@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Farah Smith [Sun, 30 May 2021 08:58:36 +0000 (14:28 +0530)]
net/bnxt: update TRUFLOW resources
- Remove unused tables from tf_tbl_type
- Encode flow type into flow handle (internal or external)
- Clean up Whitney resource tables
- Clean up Truflow CLI open tables and update Thor resources
- Add Thor SRAM and external pool types to core API
- Remove unneeded Stingray table reference
Signed-off-by: Farah Smith <farah.smith@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Jay Ding <jay.ding@broadcom.com> Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Jay Ding [Sun, 30 May 2021 08:58:35 +0000 (14:28 +0530)]
net/bnxt: check resource reservation in TRUFLOW
- Allow tf_open to continue if no resource is allocated
for some table type.
- Close the session if binding fails for any table.
- Close the session if no resource is allocated for all tables.
Signed-off-by: Jay Ding <jay.ding@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Jeffrey Huang [Sun, 30 May 2021 08:58:32 +0000 (14:28 +0530)]
net/bnxt: add CFA subdirectory of HCAPI
Before introducing more HCAPI components to DPDK, the CFA code needs
to be organized into a dedicated folder so it is separated from
other new HCAPI components
Signed-off-by: Jeffrey Huang <jeffrey.huang@broadcom.com> Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Farah Smith <farah.smith@broadcom.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Currently, ACPI and PSTATE modes have lots of code duplication,
confusing logic, and a bunch of other issues that can, and have, led to
various bugs and resource leaks.
This commit factors out the common parts of sysfs reading/writing for
ACPI and PSTATE drivers.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Signed-off-by: David Hunt <david.hunt@intel.com>
Currently, ACPI code uses rte_power_info as the struct name, which
gives the appearance that this is an externally visible API. Fix to
use internal namespace.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Huisong Li [Wed, 7 Jul 2021 09:53:34 +0000 (17:53 +0800)]
ethdev: add dev configured flag
Currently, if dev_configure is not called or fails to be called, users
can still call dev_start successfully. So it is necessary to have a flag
which indicates whether the device is configured, to control whether
dev_start can be called and eliminate dependency on user invocation order.
The flag stored in "struct rte_eth_dev_data" is more reasonable than
"enum rte_eth_dev_state". "enum rte_eth_dev_state" is private to the
primary and secondary processes, and can be independently controlled.
However, the secondary process does not make resource allocations and
does not call dev_configure(). These are done by the primary process
and can be obtained or used by the secondary process. So this patch
adds a "dev_configured" flag in "rte_eth_dev_data", like "dev_started".
Signed-off-by: Huisong Li <lihuisong@huawei.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
libabigail raised a warning on this change.
This change is fine wrt ABI as far as we understand, but we can't
express an exception rule (see libabigail bug #28060) to waive the
changes only in this part of the rte_eth_dev_data struct.
The solution for now is to globally waive any change on the
rte_eth_dev_data structure.
Signed-off-by: David Marchand <david.marchand@redhat.com>
David Marchand [Wed, 7 Jul 2021 11:02:29 +0000 (13:02 +0200)]
ipc: stop mp control thread on cleanup
When calling rte_eal_cleanup, the mp channel cleanup routine only sets
mp_fd to -1 leaving the rte_mp_handle control thread running.
This control thread can spew warnings on reading on an invalid fd.
This is especially noticed with ASAN enabled.
To handle this situation, set mp_fd to -1 to signal the control thread
it should exit, but since this thread might be sleeping on the socket,
cancel the thread too.
Fixes: 85d6815fa6d0 ("eal: close multi-process socket during cleanup") Cc: stable@dpdk.org Reported-by: Owen Hilyard <ohilyard@iol.unh.edu> Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Dana Vardi [Thu, 1 Jul 2021 07:00:43 +0000 (10:00 +0300)]
crypto/mvsam: fix options parsing
This patch fix the input arguments assignment to the correct
parameters in mrvl_pmd_init_params struct.
Fixes: 25b05a1c806 ("crypto/mvsam: parse max number of sessions") Cc: stable@dpdk.org Signed-off-by: Dana Vardi <danat@marvell.com> Reviewed-by: Liron Himi <lironh@marvell.com>
Michael Shamis [Thu, 1 Jul 2021 07:00:05 +0000 (10:00 +0300)]
crypto/mvsam: update queue mapping comments
Till now comments explain queue mapping per
one and two crypto devices.
Now added comments for queue mapping for three
crypto devices supported in CN9132.
Signed-off-by: Michael Shamis <michaelsh@marvell.com> Reviewed-by: Liron Himi <lironh@marvell.com>
Dana Vardi [Thu, 1 Jul 2021 06:59:20 +0000 (09:59 +0300)]
crypto/mvsam: fix session data reset
This patch fix wrong clear memory session pointer.
When call mrvl_crypto_pmd_sym_session_clear function,
it might cause the following error:
CRYPTODEV: set_sym_session_private_data() line 497:
Set private data for driver 1 not allowed
This fix set zeroes to mrvl_crypto_session pointer instead to
rte_cryptodev_sym_session pointer, and will verify that
rte_cryptodev_sym_session pointer will not lose data such as
nb_drivers.
Michael Shamis [Thu, 1 Jul 2021 06:58:53 +0000 (09:58 +0300)]
crypto/mvsam: fix capabilities
Increased AAD max size up to 64B and allowed AAD increment step
1B according to EIP197 token HW limitation.
In addition, some capabilities were found incorrect due to
running FIPS tests. The patch fix the capabilities.
Dana Vardi [Thu, 1 Jul 2021 06:58:12 +0000 (09:58 +0300)]
crypto/mvsam: fix AES-GCM session parameters
For AEAD session and AES-GCM mode, IV offset will
set to include the Nonce.
In addition, the following operations order will define:
first encryption and then authentication.
Rebecca Troy [Wed, 30 Jun 2021 15:29:39 +0000 (15:29 +0000)]
test/crypto: rename slave to worker
Modifies the scheduler tests in the crypto unit test suite
to replace the usage of the word 'slave' with the more
appropriate word 'worker'.
The scheduler test functions were modified as follows:
test_scheduler_attach_slave_op is now called
test_scheduler_attach_worker_op,
test_scheduler_detach_slave_op is
test_scheduler_detach_worker_op.
Kai Ji [Tue, 29 Jun 2021 15:19:07 +0000 (16:19 +0100)]
crypto/aesni_gcm: fix performance on some AVX512 CPUs
This patch fixes the aesni_gcm performance issue on systems with AVX512
CPU flag presented but with VAES CPU flag missing, such as Skylake.
Fixes: 81fe96a0cece ("crypto/aesni_gcm: use architecture independent API") Cc: stable@dpdk.org Signed-off-by: Kai Ji <kai.ji@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Fan Zhang [Wed, 23 Jun 2021 16:20:15 +0000 (17:20 +0100)]
doc: update dependencies for SW crypto PMDs
This patch updates the dependency requirement information
for aesni-gcm, aesni-mb, snow3g, zuc, and kasumi PMDs. Previously
building these PMDs with Make will fail when the system is
installed intel-ipsec-mb library version 1.0 or newer.
Since Make build system is deprecated already, instead of fixing
the issue the documentation is updated to state it.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Add missing rte_mbuf size in mempool allocation for
out-of-place operation.
Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool") Cc: stable@dpdk.org Signed-off-by: Kai Ji <kai.ji@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Feifei Wang [Fri, 21 May 2021 02:00:04 +0000 (10:00 +0800)]
crypto/qat: fix Arm build with special memcpy
In Arm platform, when "RTE_ARCH_ARM64_MEMCPY" is set as true, gcc will
report variable uninitialized warning:
../drivers/crypto/qat/qat_sym_session.c: In function ‘partial_hash_compute’:
../lib/eal/include/generic/rte_byteorder.h:241:24: warning:
‘<U35a0>’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
241 | #define rte_bswap32(x) __builtin_bswap32(x)
...
This is because "digest" will be initialized by "rte_memcpy" function
rather than "memcpy" if "RTE_ARCH_ARM64_MEMCPY" is set as true.
Furthermore, 'rte_memcpy' will initialize 'digest' with two steps
by invoking rte_mov_x functions. For example: