dpdk.git
3 years agonet/bnxt: modify VXLAN decap for multichannel mode
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

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: modify TCAM opcode processing
Kishore Padmanabha [Sun, 30 May 2021 08:59:01 +0000 (14:29 +0530)]
net/bnxt: modify TCAM opcode processing

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.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add conditional processing of templates
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.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support mapper flow database opcodes
Kishore Padmanabha [Sun, 30 May 2021 08:58:59 +0000 (14:28 +0530)]
net/bnxt: support mapper flow database opcodes

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.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support generic table processing
Kishore Padmanabha [Sun, 30 May 2021 08:58:58 +0000 (14:28 +0530)]
net/bnxt: support generic table processing

Added support for generic table processing, this feature shall
enable support for shared resource like mirror and TCAM
cache tables.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: check FW capability to support TRUFLOW
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.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: add functions to clear TCAM regions
Farah Smith [Sun, 30 May 2021 08:58:56 +0000 (14:28 +0530)]
net/bnxt: add functions to clear TCAM regions

Add TRUFLOW API to clear either the hi or the low regions
in WildCard TCAM for ungraceful exit cleanup.

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>
3 years agonet/bnxt: support WC TCAM shared session
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>
3 years agonet/bnxt: cleanup WC TCAM shared pool
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>
3 years agonet/bnxt: refactor host session failure cleanup
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>
3 years agonet/bnxt: add functions to get shared table increments
Farah Smith [Sun, 30 May 2021 08:58:52 +0000 (14:28 +0530)]
net/bnxt: add functions to get shared table increments

Add TRUFLOW API to get the shared table increment value
for a given TRUFLOW table type.
The API is being added for Wh+ and Thor devices.

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>
3 years agonet/bnxt: support WC TCAM management
Farah Smith [Sun, 30 May 2021 08:58:51 +0000 (14:28 +0530)]
net/bnxt: support WC TCAM management

- Add new API to move WC TCAM regions from the hi pool
  to the low pool.
- Enable shared TCAM get/set functions on Thor.

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>
3 years agonet/bnxt: cleanup logs in session handling paths
Farah Smith [Sun, 30 May 2021 08:58:50 +0000 (14:28 +0530)]
net/bnxt: cleanup logs in session handling paths

Cleanup some of the log messages in the session open and close paths.

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support shared TCAM region
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>
3 years agonet/bnxt: modify resource reservation strategy
Jay Ding [Sun, 30 May 2021 08:58:48 +0000 (14:28 +0530)]
net/bnxt: modify resource reservation strategy

Allow an application to only reserve resources for one direction.

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>
3 years agonet/bnxt: update shared session functionality
Jay Ding [Sun, 30 May 2021 08:58:47 +0000 (14:28 +0530)]
net/bnxt: update shared session functionality

- Distinguish the shared session on host side using PCI address
- One session could be shared by multiple interfaces.

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>
3 years agonet/bnxt: add dpool allocator for EM allocation
Peter Spreadborough [Sun, 30 May 2021 08:58:46 +0000 (14:28 +0530)]
net/bnxt: add dpool allocator for EM allocation

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>
3 years agonet/bnxt: support shared session
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>
3 years agonet/bnxt: change RM database type
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>
3 years agonet/bnxt: modify TRUFLOW HWRM messages
Farah Smith [Sun, 30 May 2021 08:58:43 +0000 (14:28 +0530)]
net/bnxt: modify TRUFLOW HWRM messages

- Move Bulk get to a direct HWRM message
- Deprecate code based on HCAPI changes

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
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: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add hashing changes for Thor
Peter Spreadborough [Sun, 30 May 2021 08:58:42 +0000 (14:28 +0530)]
net/bnxt: add hashing changes for Thor

- 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>
3 years agonet/bnxt: add 64B SRAM record management with RM
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>
3 years agonet/bnxt: support Thor WC TCAM
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>
3 years agonet/bnxt: add action SRAM translation
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>
3 years agonet/bnxt: support L2 context TCAM operations
Jay Ding [Sun, 30 May 2021 08:58:38 +0000 (14:28 +0530)]
net/bnxt: support L2 context TCAM operations

- Implement TCAM get in host
- Add Thor support for TCAM set/free

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>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support EM with FKB
Peter Spreadborough [Sun, 30 May 2021 08:58:37 +0000 (14:28 +0530)]
net/bnxt: support EM with FKB

Main TF changes to support EM insert with FKB.
Flexible Key builder is required to create Wild Card
and Exact Match keys for TCAM lookups.

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>
3 years agonet/bnxt: update TRUFLOW resources
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>
3 years agonet/bnxt: check resource reservation in TRUFLOW
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>
3 years agonet/bnxt: add mailbox selection via device operation
Peter Spreadborough [Sun, 30 May 2021 08:58:34 +0000 (14:28 +0530)]
net/bnxt: add mailbox selection via device operation

Add get mailbox dev op so that mailbox offset is based on device
instead of a hard coded value.

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>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add base TRUFLOW support for Thor
Farah Smith [Sun, 30 May 2021 08:58:33 +0000 (14:28 +0530)]
net/bnxt: add base TRUFLOW support for Thor

Add infrastructure code to support TRUFLOW on Thor NICs.
Also update meson.build

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
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>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add CFA subdirectory of HCAPI
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>
3 years agopower: refactor ACPI and intel_pstate support
Anatoly Burakov [Thu, 8 Jul 2021 15:38:23 +0000 (16:38 +0100)]
power: refactor ACPI and intel_pstate support

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>
3 years agopower: fix namespace for internal struct
Anatoly Burakov [Thu, 8 Jul 2021 15:38:22 +0000 (16:38 +0100)]
power: fix namespace for internal struct

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>
3 years agoethdev: add dev configured flag
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>
3 years agoipc: stop mp control thread on cleanup
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>
3 years agocrypto/octeontx2: clear session data upon destroy
Anoob Joseph [Fri, 2 Jul 2021 10:36:36 +0000 (16:06 +0530)]
crypto/octeontx2: clear session data upon destroy

During session destroy, clear session private memory.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
3 years agocrypto/octeontx2: reset feature flags during config
Anoob Joseph [Fri, 2 Jul 2021 10:36:35 +0000 (16:06 +0530)]
crypto/octeontx2: reset feature flags during config

Feature flags in dev would be updated during config. On reconfigure, the
field need to be set again to original value.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
3 years agocrypto/mvsam: fix options parsing
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>
3 years agocrypto/mvsam: update queue mapping comments
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>
3 years agocrypto/mvsam: fix session data reset
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.

Bugzilla ID: 646
Fixes: 8a61c83af2fa ("crypto/mrvl: add mrvl crypto driver")
Cc: stable@dpdk.org
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
3 years agocrypto/mvsam: fix capabilities
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.

Fixes: 8a61c83af2f ("crypto/mrvl: add mrvl crypto driver")
Fixes: 2c22aa4f8f6 ("crypto/mvsam: update hash digest sizes")
Fixes: a84226fc055 ("crypto/mvsam: support HMAC SHA224")
Cc: stable@dpdk.org
Signed-off-by: Michael Shamis <michaelsh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
3 years agocrypto/mvsam: fix AES-GCM session parameters
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.

Fixes: 8a61c83af2fa ("crypto/mrvl: add mrvl crypto driver")
Cc: stable@dpdk.org
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
3 years agotest/crypto: use formal array size macro
Rebecca Troy [Mon, 5 Jul 2021 11:50:30 +0000 (11:50 +0000)]
test/crypto: use formal array size macro

Replaces the use of local ARRAY_SIZE macro, which is not used
anywhere else, with the formal RTE_DIM macro for better
consistency in crypto unit test.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: fix typo in ESN case
Rebecca Troy [Thu, 1 Jul 2021 10:39:09 +0000 (10:39 +0000)]
test/crypto: fix typo in ESN case

Fixed typo in the crypto unit test ESN function name by
replacing the word 'encryt' with the correct word 'encrypt'.

test_authenticated_encryt_with_esn is now called
test_authenticated_encrypt_with_esn.

Fixes: 699741912d71 ("test/crypto: add case for auth only trailer")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agotest/crypto: fix typo in AES case
Rebecca Troy [Thu, 1 Jul 2021 09:22:38 +0000 (09:22 +0000)]
test/crypto: fix typo in AES case

Fixed typo in the testcase description for AES in the crypto
unit test suite by changing the word 'Scater' to 'Scatter'.

Fixes: c9c9c4ed8746 ("app/test: check scatter-gather for crypto drivers")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
3 years agotest/crypto: rename slave to worker
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.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: fix autotest function parameters
Rebecca Troy [Wed, 30 Jun 2021 14:01:41 +0000 (14:01 +0000)]
test/crypto: fix autotest function parameters

Fixed parameters on autotest functions by removing comments.

Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Fixes: 4ed1e79e7819 ("test/crypto: add tests for virtio-crypto")
Fixes: 3aafc423cf4d ("snow3g: add driver for SNOW 3G library")
Fixes: 27a1c4714d54 ("app/test: add KASUMI crypto")
Fixes: 4c99481f49c4 ("app/test: add ZUC")
Fixes: c8e69fce7046 ("crypto/scheduler: add unit test")
Fixes: ae002048bbea ("test/crypto: add DPAA2 crypto functional test")
Fixes: b674d6d0381a ("test/crypto: add dpaa crypto test cases")
Fixes: a8dbd44d6b4c ("test/crypto: add CAAM JR validation cases")
Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/aesni_gcm: fix performance on some AVX512 CPUs
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>
3 years agocrypto/octeontx: add crypto adapter data path
Shijith Thotton [Wed, 23 Jun 2021 20:53:50 +0000 (02:23 +0530)]
crypto/octeontx: add crypto adapter data path

Added support for crypto adapter OP_FORWARD mode.

As OcteonTx CPT crypto completions could be out of order, each crypto op
is enqueued to CPT, dequeued from CPT and enqueued to SSO one-by-one.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/octeontx: add crypto adapter framework
Shijith Thotton [Wed, 23 Jun 2021 20:53:49 +0000 (02:23 +0530)]
crypto/octeontx: add crypto adapter framework

Set crypto adapter event device slow-path call backs.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agodoc: update dependencies for SW crypto PMDs
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>
3 years agocommon/cpt: add checks for offset overflow
Anoob Joseph [Mon, 10 May 2021 09:44:00 +0000 (15:14 +0530)]
common/cpt: add checks for offset overflow

Add checks to catch overflow of any offsets. Offset control word
specifies,

1. 16 bits encryption offset
2. 8 bits IV offset
3. 8 bits auth offset

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: fix mbuf reset after null check
Thierry Herbelot [Mon, 24 May 2021 09:01:13 +0000 (11:01 +0200)]
test/crypto: fix mbuf reset after null check

Use m only after it was checked not to be NULL.

Fixes: 202d375c60bc1 ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agoapp/crypto-perf: fix out-of-place mempool allocation
Kai Ji [Mon, 24 May 2021 16:46:27 +0000 (17:46 +0100)]
app/crypto-perf: fix out-of-place mempool allocation

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>
3 years agocrypto/qat: fix Arm build with special memcpy
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:

partial_hash_sha1 -> rte_memcpy -> rte_memcpy_ge16_lt_128 ->
step 1: rte_mov16(dst,src )
step 2: rte_mov16(dst - 16 + n, src - 16 + n)

However, gcc compiler cannot identify this multi-step initialization,
then it will report warning.

To fix this, use "memset" to initialize "digest".

Fixes: cd7fc8a84b48 ("eal/arm64: optimize memcpy")
Cc: stable@dpdk.org
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
3 years agocrypto/octeontx: increase metabuf pool
Anoob Joseph [Fri, 11 Jun 2021 10:21:13 +0000 (15:51 +0530)]
crypto/octeontx: increase metabuf pool

When used with crypto adapter, metabuf pool would be shared across
cores. Account for the same in pool size.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/octeontx2: increase metabuf pool
Anoob Joseph [Fri, 11 Jun 2021 10:21:12 +0000 (15:51 +0530)]
crypto/octeontx2: increase metabuf pool

When used with crypto adapter, metabuf pool would be shared across
cores. Account for the same in pool size.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: add cnxk for asymmetric cases
Kiran Kumar K [Tue, 29 Jun 2021 07:34:36 +0000 (13:04 +0530)]
test/crypto: add cnxk for asymmetric cases

Registered cn9k and cn10k for asymmetric crypto
autotest. Documentation and release notes are also
updated.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add asymmetric capabilities
Anoob Joseph [Tue, 29 Jun 2021 07:34:35 +0000 (13:04 +0530)]
crypto/cnxk: add asymmetric capabilities

Add asymmetric crypto capabilities supported
by cn9k and cn10k PMDs. Documentation is also
updated for the same.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add asymmetric datapath
Kiran Kumar K [Tue, 29 Jun 2021 07:34:34 +0000 (13:04 +0530)]
crypto/cnxk: add asymmetric datapath

Add asymmetric crypto datapath for cn9k and cn10k PMD.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add asymmetric session
Kiran Kumar K [Tue, 29 Jun 2021 07:34:33 +0000 (13:04 +0530)]
crypto/cnxk: add asymmetric session

Add asymmetric crypto session ops for both cn9k
and cn10k PMD.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add security capabilities
Anoob Joseph [Tue, 29 Jun 2021 07:34:32 +0000 (13:04 +0530)]
crypto/cnxk: add security capabilities

Add security capabilities supported by crypto cn10k PMD.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add IPsec datapath
Tejasree Kondoj [Tue, 29 Jun 2021 07:34:31 +0000 (13:04 +0530)]
crypto/cnxk: add IPsec datapath

Add rte_security handling in cn10k crypto enqueue
dequeue ops to support IPSec protocol offload.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add security session operations
Tejasree Kondoj [Tue, 29 Jun 2021 07:34:30 +0000 (13:04 +0530)]
crypto/cnxk: add security session operations

Add security session ops in cn10k crypto PMD
to support lookaside protocol offload IPsec.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add security context skeleton
Srujana Challa [Tue, 29 Jun 2021 07:34:29 +0000 (13:04 +0530)]
crypto/cnxk: add security context skeleton

Add security ctx in cn10k crypto PMD.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agotest/crypto: enable cnxk
Tejasree Kondoj [Fri, 25 Jun 2021 05:56:31 +0000 (11:26 +0530)]
test/crypto: enable cnxk

Enable tests for cn9k & cn10k crypto PMDs.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add symmetric capabilities
Ankur Dwivedi [Fri, 25 Jun 2021 05:56:30 +0000 (11:26 +0530)]
crypto/cnxk: add symmetric capabilities

Add symmetric crypto capabilities for cn9k & cn10k.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add digest support
Tejasree Kondoj [Fri, 25 Jun 2021 05:56:29 +0000 (11:26 +0530)]
crypto/cnxk: add digest support

Add support for digest support for various algorithms.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add KASUMI decryption
Tejasree Kondoj [Fri, 25 Jun 2021 05:56:28 +0000 (11:26 +0530)]
crypto/cnxk: add KASUMI decryption

Add KASUMI decrypt support.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add KASUMI encryption
Tejasree Kondoj [Fri, 25 Jun 2021 05:56:27 +0000 (11:26 +0530)]
crypto/cnxk: add KASUMI encryption

Add KASUMI encrypt support.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add ZUC and SNOW3G decryption
Tejasree Kondoj [Fri, 25 Jun 2021 05:56:26 +0000 (11:26 +0530)]
crypto/cnxk: add ZUC and SNOW3G decryption

Add PDCP opcode which handles ZUC and SNOW3G.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add ZUC and SNOW3G encryption
Archana Muniganti [Fri, 25 Jun 2021 05:56:25 +0000 (11:26 +0530)]
crypto/cnxk: add ZUC and SNOW3G encryption

Add PDCP opcode which handles ZUC and SNOW3G.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add flexi cipher decryption
Archana Muniganti [Fri, 25 Jun 2021 05:56:24 +0000 (11:26 +0530)]
crypto/cnxk: add flexi cipher decryption

Add flexi crypto cipher decrypt support in enqueue API. Flexi crypto
opcode covers a broad set of ciphers including variants of AES.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add flexi cipher encryption
Archana Muniganti [Fri, 25 Jun 2021 05:56:23 +0000 (11:26 +0530)]
crypto/cnxk: add flexi cipher encryption

Add flexi crypto cipher encrypt in enqueue API. Flexi crypto
opcode covers a broad set of ciphers including variants of AES.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add chained operation in session
Archana Muniganti [Fri, 25 Jun 2021 05:56:22 +0000 (11:26 +0530)]
crypto/cnxk: add chained operation in session

Add support for chained operations in session.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add AEAD operation in session
Archana Muniganti [Fri, 25 Jun 2021 05:56:21 +0000 (11:26 +0530)]
crypto/cnxk: add AEAD operation in session

Add support for AEAD operations in session.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add auth operation in session
Anoob Joseph [Fri, 25 Jun 2021 05:56:20 +0000 (11:26 +0530)]
crypto/cnxk: add auth operation in session

Add support for auth operations in session.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add cipher operation in session
Anoob Joseph [Fri, 25 Jun 2021 05:56:19 +0000 (11:26 +0530)]
crypto/cnxk: add cipher operation in session

Add support for cipher operation in session.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add dequeue burst
Anoob Joseph [Fri, 25 Jun 2021 05:56:18 +0000 (11:26 +0530)]
crypto/cnxk: add dequeue burst

Add dequeue_burst op in cn9k & cn10k.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add enqueue burst
Anoob Joseph [Fri, 25 Jun 2021 05:56:17 +0000 (11:26 +0530)]
crypto/cnxk: add enqueue burst

Add enqueue_burst op in cn9k & cn10k.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add session operations framework
Anoob Joseph [Fri, 25 Jun 2021 05:56:16 +0000 (11:26 +0530)]
crypto/cnxk: add session operations framework

Add session ops
- sym_session_get_size
- sym_session_configure
- sym_session_clear

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add queue pair operations
Ankur Dwivedi [Fri, 25 Jun 2021 05:56:15 +0000 (11:26 +0530)]
crypto/cnxk: add queue pair operations

Add ops for
- queue_pair_setup()
- queue_pair_release()

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add device control operations
Ankur Dwivedi [Fri, 25 Jun 2021 05:56:14 +0000 (11:26 +0530)]
crypto/cnxk: add device control operations

Add ops for
- dev_configure()
- dev_start()
- dev_stop()
- dev_close()
- dev_infos_get()

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add probe and remove
Ankur Dwivedi [Fri, 25 Jun 2021 05:56:13 +0000 (11:26 +0530)]
crypto/cnxk: add probe and remove

Add probe & remove for cn9k & cn10k crypto PMDs.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/cnxk: add driver skeleton
Ankur Dwivedi [Fri, 25 Jun 2021 05:56:12 +0000 (11:26 +0530)]
crypto/cnxk: add driver skeleton

Add driver skeleton for crypto_cn9k & crypto_cn10k
PMDs leveraging cnxk common framework.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add SE set key for crypto
Ankur Dwivedi [Fri, 25 Jun 2021 05:36:49 +0000 (11:06 +0530)]
common/cnxk: add SE set key for crypto

The set key functions are added in roc to be used
in crypto operations.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add IPsec common code
Srujana Challa [Fri, 25 Jun 2021 05:36:48 +0000 (11:06 +0530)]
common/cnxk: add IPsec common code

Add code that can be leveraged across
lookaside and inline IPsec on cn10k.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add EC vectors for asymmetric crypto
Kiran Kumar K [Fri, 25 Jun 2021 05:36:47 +0000 (11:06 +0530)]
common/cnxk: add EC vectors for asymmetric crypto

EC group static vectors are required for CPT asymmetric
crypto operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add FPM tables for asymmetric crypto
Kiran Kumar K [Fri, 25 Jun 2021 05:36:46 +0000 (11:06 +0530)]
common/cnxk: add FPM tables for asymmetric crypto

Add scalar FPM tables to be used for asymmetric crypto
operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add lmtline initialization
Anoob Joseph [Fri, 25 Jun 2021 05:36:45 +0000 (11:06 +0530)]
common/cnxk: add lmtline initialization

Add routine to initialize LMTLINE which facilitates instruction
submission to CPT. Add common macros required in the enqueue
operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add AE definitions for asymmetric crypto
Kiran Kumar K [Fri, 25 Jun 2021 05:36:44 +0000 (11:06 +0530)]
common/cnxk: add AE definitions for asymmetric crypto

Microcode AE opcodes support asymmetric operations. Add defines
and structs defined by microcode.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add IE definitions for IPsec
Srujana Challa [Fri, 25 Jun 2021 05:36:43 +0000 (11:06 +0530)]
common/cnxk: add IE definitions for IPsec

Microcode IE opcodes support IPsec operations. Add defines
and structs defined by microcode.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add SE definitions for symmetric crypto
Kiran Kumar K [Fri, 25 Jun 2021 05:36:42 +0000 (11:06 +0530)]
common/cnxk: add SE definitions for symmetric crypto

Microcode SE opcodes support symmetric operations. Add defines
and structs defined by microcode.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add inline IPsec configuration mailbox
Vidya Sagar Velumuri [Fri, 25 Jun 2021 05:36:41 +0000 (11:06 +0530)]
common/cnxk: add inline IPsec configuration mailbox

Add mbox to configure inbound & outbound inline IPsec.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add CPT LF flush
Aakash Sasidharan [Fri, 25 Jun 2021 05:36:40 +0000 (11:06 +0530)]
common/cnxk: add CPT LF flush

Add routine to flush context from CPT context processor cache.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add CPT diagnostics
Aakash Sasidharan [Fri, 25 Jun 2021 05:36:39 +0000 (11:06 +0530)]
common/cnxk: add CPT diagnostics

Add routines to fetch and dump CPT statistics and states.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add CPT LF configuration
Archana Muniganti [Fri, 25 Jun 2021 05:36:38 +0000 (11:06 +0530)]
common/cnxk: add CPT LF configuration

Add routines to init & fini CPT LFs. CPT LFs are
queues to the hardware enabling instruction submissions.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add mailbox to configure RXC
Vidya Sagar Velumuri [Fri, 25 Jun 2021 05:36:37 +0000 (11:06 +0530)]
common/cnxk: add mailbox to configure RXC

Add mailbox to configure timeouts and thresholds in
CPT RXC unit.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add CPT get/set
Anoob Joseph [Fri, 25 Jun 2021 05:36:36 +0000 (11:06 +0530)]
common/cnxk: add CPT get/set

Add APIs to set & get CPT device.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocommon/cnxk: add CPT configuration
Anoob Joseph [Fri, 25 Jun 2021 05:36:35 +0000 (11:06 +0530)]
common/cnxk: add CPT configuration

Add routines to init, fini, configure & clear CPT device.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>