---
name: "RTE_PMD_CNXK_SEC_ACTION_ALG1"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_pmd_cnxk.h"
---

# RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG1(3)

Part of [rte\_pmd\_cnxk.h(3)](/rte_pmd_cnxk.h/3.md).

## NAME

rte\_pmd\_cnxk.h

## SYNOPSIS

`#include <rte_compat.h>`\
 `#include <rte_ethdev.h>`\
 `#include <rte_ether.h>`\
 `#include <rte_security.h>`\

### Data Structures

struct **rte\_pmd\_cnxk\_cpt\_q\_stats**\
 union **rte\_pmd\_cnxk\_ipsec\_outer\_ip\_hdr**\
 struct **rte\_pmd\_cnxk\_ipsec\_inb\_ctx\_update\_reg**\
 union **rte\_pmd\_cnxk\_ipsec\_outb\_iv**\
 struct **rte\_pmd\_cnxk\_ipsec\_outb\_ctx\_update\_reg**\
 struct **rte\_pmd\_cnxk\_ipsec\_inb\_sa**\
 struct **rte\_pmd\_cnxk\_ipsec\_outb\_sa**\
 union **rte\_pmd\_cnxk\_ipsec\_hw\_sa**\
 union **rte\_pmd\_cnxk\_cpt\_res\_s**\
 struct **rte\_pmd\_cnxk\_cpt\_res\_s::rte\_pmd\_cpt\_cn10k\_res\_s**\
 struct **rte\_pmd\_cnxk\_cpt\_res\_s::rte\_pmd\_cpt\_cn9k\_res\_s**\
 struct **rte\_pmd\_cnxk\_ipsec\_inb\_cfg**\

### Macros

\#define **RTE\_PMD\_CNXK\_AR\_WIN\_SIZE\_MIN**   64\
 \#define **RTE\_PMD\_CNXK\_AR\_WINBITS\_SZ**   (**RTE\_ALIGN\_CEIL**(RTE\_PMD\_CNXK\_AR\_WIN\_SIZE\_MAX, 64) / 64)\

### Enumerations

enum **rte\_pmd\_cnxk\_sec\_action\_alg** { **RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG0**, **RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG1**, **RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG2**, **RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG3**, **RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG4** }\
 enum **rte\_pmd\_cnxk\_cpt\_q\_stats\_type** { **RTE\_PMD\_CNXK\_CPT\_Q\_STATS\_INL\_DEV**, **RTE\_PMD\_CNXK\_CPT\_Q\_STATS\_KERNEL**, **RTE\_PMD\_CNXK\_CPT\_Q\_STATS\_ETHDEV** }\

### Functions

\_\_rte\_experimental int **rte\_pmd\_cnxk\_hw\_sa\_read** (uint16\_t portid, void \*sess, union **rte\_pmd\_cnxk\_ipsec\_hw\_sa** \*data, uint32\_t len, bool inb)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_hw\_sa\_write** (uint16\_t portid, void \*sess, union **rte\_pmd\_cnxk\_ipsec\_hw\_sa** \*data, uint32\_t len, bool inb)\
 \_\_rte\_experimental union **rte\_pmd\_cnxk\_cpt\_res\_s** \* **rte\_pmd\_cnxk\_inl\_ipsec\_res** (struct **rte\_mbuf** \*mbuf)\
 \_\_rte\_experimental union **rte\_pmd\_cnxk\_ipsec\_hw\_sa** \* **rte\_pmd\_cnxk\_hw\_session\_base\_get** (uint16\_t portid, bool inb)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_sa\_flush** (uint16\_t portid, union **rte\_pmd\_cnxk\_ipsec\_hw\_sa** \*sess, bool inb)\
 \_\_rte\_experimental struct rte\_pmd\_cnxk\_inl\_dev\_q \* **rte\_pmd\_cnxk\_inl\_dev\_qptr\_get** (void)\
 \_\_rte\_experimental uint16\_t **rte\_pmd\_cnxk\_inl\_dev\_submit** (struct rte\_pmd\_cnxk\_inl\_dev\_q \*qptr, void \*inst, uint16\_t nb\_inst)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_cpt\_q\_stats\_get** (uint16\_t portid, enum **rte\_pmd\_cnxk\_cpt\_q\_stats\_type** type, struct **rte\_pmd\_cnxk\_cpt\_q\_stats** \*stats, uint16\_t idx)\
 \_\_rte\_experimental void **rte\_pmd\_cnxk\_hw\_inline\_inb\_cfg\_set** (uint16\_t portid, struct **rte\_pmd\_cnxk\_ipsec\_inb\_cfg** \*cfg)\
 \_\_rte\_experimental const char \* **rte\_pmd\_cnxk\_model\_str\_get** (void)\

## Detailed Description

CNXK PMD specific functions.

Definition in file **rte\_pmd\_cnxk.h**.

## Macro Definition Documentation

### #define RTE\_PMD\_CNXK\_AR\_WIN\_SIZE\_MIN 64

Anti reply window size supported

Definition at line **91** of file **rte\_pmd\_cnxk.h**.

### #define RTE\_PMD\_CNXK\_AR\_WINBITS\_SZ (RTE\_ALIGN\_CEIL(RTE\_PMD\_CNXK\_AR\_WIN\_SIZE\_MAX, 64) / 64)

u64 array size to fit anti replay window bits

Definition at line **96** of file **rte\_pmd\_cnxk.h**.

## Enumeration Type Documentation

### enum rte\_pmd\_cnxk\_sec\_action\_alg

Algorithm type to be used with security action to calculate SA\_index

**Enumerator**

- *RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG0*

  *No swizzling of SPI bits into SA index. SA\_index is from SA\_XOR if enabled.*

- *RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG1*

  *SPI\<31:28\> has 4 upper bits which segment the sequence number space. Initial SA\_index is from SA\_XOR if enabled. SA\_alg = { 4'b0, SA\_mcam\[27:0\] + SPI\[31:28\]}*

- *RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG2*

  *SPI\<27:25\> segment the sequence number space. Initial SA\_index is from SA\_XOR if enabled. SA\_alg = { 7'b0, SA\_mcam\[24:0\] + SPI\[27:25\]}*

- *RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG3*

  *SPI\<28:25\> segment the sequence number space. Initial SA\_index is from SA\_XOR if enabled. SA\_alg = { 7'b0, SA\_mcam\[24:0\] + SPI\[28:25\]}*

- *RTE\_PMD\_CNXK\_SEC\_ACTION\_ALG4*

  *The inbound SPI maybe 'random', therefore we want the MCAM to be capable of remapping the SPI to an arbitrary SA\_index. SPI to SA is done using a lookup in NIX/NPC cam entry with key as SPI, MATCH\_ID, LFID.*

*Definition at line* **22** *of file* **rte\_pmd\_cnxk.h***.*

### enum rte\_pmd\_cnxk\_cpt\_q\_stats\_type

*CPT queue type for obtaining queue hardware statistics.*

**Enumerator**

- *RTE\_PMD\_CNXK\_CPT\_Q\_STATS\_INL\_DEV*

  *Type to get Inline Device queue(s) statistics*

- *RTE\_PMD\_CNXK\_CPT\_Q\_STATS\_KERNEL*

  *Type to get Inline Inbound queue which is attached to kernel device statistics.*

- *RTE\_PMD\_CNXK\_CPT\_Q\_STATS\_ETHDEV*

  *Type to get CPT queue which is attached to ethdev statistics*

*Definition at line* **51** *of file* **rte\_pmd\_cnxk.h***.*

## Function Documentation

### \_\_rte\_experimental int rte\_pmd\_cnxk\_hw\_sa\_read (uint16\_t portid, void \* sess, union rte\_pmd\_cnxk\_ipsec\_hw\_sa \* data, uint32\_t len, bool inb)

*Read HW SA context from session.*

**Parameters**

*portid Port identifier of Ethernet device.* \
 *sess Handle of the security session as void \*.* \
 *data Destination pointer to copy SA context for application.* \
 *len Length of SA context to copy into data parameter.* \
 *inb Determines the type of specified SA.*

**Returns**

*0 on success, a negative errno value otherwise.*

### \_\_rte\_experimental int rte\_pmd\_cnxk\_hw\_sa\_write (uint16\_t portid, void \* sess, union rte\_pmd\_cnxk\_ipsec\_hw\_sa \* data, uint32\_t len, bool inb)

*Write HW SA context to session.*

**Parameters**

*portid Port identifier of Ethernet device.* \
 *sess Handle of the security session as void \*.* \
 *data Source data pointer from application to copy SA context into session.* \
 *len Length of SA context to copy from data parameter.* \
 *inb Determines the type of specified SA.*

**Returns**

*0 on success, a negative errno value otherwise.*

### \_\_rte\_experimental union rte\_pmd\_cnxk\_cpt\_res\_s \* rte\_pmd\_cnxk\_inl\_ipsec\_res (struct rte\_mbuf \* mbuf)

*Get pointer to CPT result info for inline inbound processed pkt.*

*It is recommended to use this API only when mbuf indicates packet was processed with inline IPsec and there was a failure with the same i.e mbuf-\>ol\_flags indicates (RTE\_MBUF\_F\_RX\_SEC\_OFFLOAD \| RTE\_MBUF\_F\_RX\_SEC\_OFFLOAD\_FAILED).*

**Parameters**

*mbuf Pointer to packet that was just received and was processed with Inline IPsec.*

**Returns**

- •

  *Pointer to mbuf location where* `union `**rte\_pmd\_cnxk\_cpt\_res\_s is stored on success.**

- •

  **NULL on failure.**

### \_\_rte\_experimental union rte\_pmd\_cnxk\_ipsec\_hw\_sa \* rte\_pmd\_cnxk\_hw\_session\_base\_get (uint16\_t portid, bool inb)

**Get pointer to the Inline Inbound or Outbound SA table base.**

**Parameters**

*portid* **Port identifier of Ethernet device.** \
 *inb* **Determines the type of SA base to be returned. When inb is true, the method returns the Inbound SA base. When inb is false, the method returns the Outbound SA base.**

**Returns**

**Pointer to Inbound or Outbound SA base.**

### \_\_rte\_experimental int rte\_pmd\_cnxk\_sa\_flush (uint16\_t portid, union rte\_pmd\_cnxk\_ipsec\_hw\_sa \* sess, bool inb)

**Executes a CPT flush on the specified session.**

**Parameters**

*portid* **Port identifier of Ethernet device.** \
 *sess* **Handle of the session on which the CPT flush will be executed.** \
 *inb* **Determines the type of SA to be flushed, Inbound or Outbound.**

**Returns**

**0 Upon success, a negative errno value otherwise.**

### \_\_rte\_experimental struct rte\_pmd\_cnxk\_inl\_dev\_q \* rte\_pmd\_cnxk\_inl\_dev\_qptr\_get (void)

**Get queue pointer of Inline Device.**

**Returns**

- •

  **Pointer to queue structure that would be the input to submit API.**

- •

  **NULL upon failure.**

### \_\_rte\_experimental uint16\_t rte\_pmd\_cnxk\_inl\_dev\_submit (struct rte\_pmd\_cnxk\_inl\_dev\_q \* qptr, void \* inst, uint16\_t nb\_inst)

**Submit CPT instruction(s) (cpt\_inst\_s) to Inline Device.**

**Parameters**

*qptr* **Pointer obtained with** `rte_pmd_cnxk_inl_dev_qptr_get`**.** \
 *inst* **Pointer to an array of** `cpt_inst_s` **prapared by application.** \
 *nb\_inst* **Number of instructions to be processed.**

**Returns**

**Number of instructions processed.**

### \_\_rte\_experimental int rte\_pmd\_cnxk\_cpt\_q\_stats\_get (uint16\_t portid, enum rte\_pmd\_cnxk\_cpt\_q\_stats\_type type, struct rte\_pmd\_cnxk\_cpt\_q\_stats \* stats, uint16\_t idx)

**Retrieves the hardware statistics of a given port and stats type.**

**Parameters**

*portid* **Port identifier of Ethernet device.** \
 *type* **The type of hardware statistics to retrieve, as defined in the** `enum rte_pmd_cnxk_cpt_q_stats_type`**.** \
 *stats* **Pointer where the retrieved statistics will be stored.** \
 *idx* **The index of the queue of a given type.**

**Returns**

**0 Upon success, a negative errno value otherwise.**

### \_\_rte\_experimental void rte\_pmd\_cnxk\_hw\_inline\_inb\_cfg\_set (uint16\_t portid, struct rte\_pmd\_cnxk\_ipsec\_inb\_cfg \* cfg)

**Set the configuration for hardware inline inbound IPsec processing. This API must be called before calling the** `rte_eth_dev_configure` **API.**

**Parameters**

*portid* **Port identifier of Ethernet device.** \
 *cfg* **Pointer to the IPsec inbound configuration structure.**

### \_\_rte\_experimental const char \* rte\_pmd\_cnxk\_model\_str\_get (void)

**Retrieves model name on which it is running as a string.**

**Returns**

**Returns model string, ex.'cn10ka\_a1'**

## Author

**Generated automatically by Doxygen for DPDK from the source code.**
