---
name: "rte_pmd_cnxk_crypto_cptr_get"
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_crypto.h"
---

# rte\_pmd\_cnxk\_crypto\_cptr\_get(3)

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

## NAME

rte\_pmd\_cnxk\_crypto.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_crypto.h>`\
 `#include <rte_security.h>`\

### Data Structures

struct **rte\_pmd\_cnxk\_crypto\_qp\_stats**\
 Crypto CNXK queue pair stats.  struct **rte\_pmd\_cnxk\_crypto\_sess**\
 Crypto CNXK PMD session structure.

### Functions

\_\_rte\_experimental struct rte\_pmd\_cnxk\_crypto\_qptr \* **rte\_pmd\_cnxk\_crypto\_qptr\_get** (uint8\_t dev\_id, uint16\_t qp\_id)\
 \_\_rte\_experimental void **rte\_pmd\_cnxk\_crypto\_submit** (struct rte\_pmd\_cnxk\_crypto\_qptr \*qptr, void \*inst, uint16\_t nb\_inst)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_crypto\_cptr\_flush** (struct rte\_pmd\_cnxk\_crypto\_qptr \*qptr, struct rte\_pmd\_cnxk\_crypto\_cptr \*cptr, bool invalidate)\
 \_\_rte\_experimental struct rte\_pmd\_cnxk\_crypto\_cptr \* **rte\_pmd\_cnxk\_crypto\_cptr\_get** (struct **rte\_pmd\_cnxk\_crypto\_sess** \*rte\_sess)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_crypto\_cptr\_read** (struct rte\_pmd\_cnxk\_crypto\_qptr \*qptr, struct rte\_pmd\_cnxk\_crypto\_cptr \*cptr, void \*data, uint32\_t len)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_crypto\_cptr\_write** (struct rte\_pmd\_cnxk\_crypto\_qptr \*qptr, struct rte\_pmd\_cnxk\_crypto\_cptr \*cptr, void \*data, uint32\_t len)\
 \_\_rte\_experimental int **rte\_pmd\_cnxk\_crypto\_qp\_stats\_get** (struct rte\_pmd\_cnxk\_crypto\_qptr \*qptr, struct **rte\_pmd\_cnxk\_crypto\_qp\_stats** \*stats)\

## Detailed Description

Marvell CNXK Crypto PMD specific functions.

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

## Function Documentation

### \_\_rte\_experimental struct rte\_pmd\_cnxk\_crypto\_qptr \* rte\_pmd\_cnxk\_crypto\_qptr\_get (uint8\_t dev\_id, uint16\_t qp\_id)

Get queue pointer of a specific queue in a cryptodev.

**Parameters**

*dev\_id* Device identifier of cryptodev device. \
 *qp\_id* Index of the queue pair.

**Returns**

- •

  On success, pointer to queue pair structure that would be the input to submit APIs.

- •

  NULL on error.

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

Submit CPT instruction (cpt\_inst\_s) to hardware (CPT).

The `qp` is a pointer obtained from `rte_pmd_cnxk_crypto_qp_get`. Application should make sure it doesn't overflow the internal hardware queues. It may do so by making sure the inflight packets are not more than the number of descriptors configured.

This API may be called only after the cryptodev and queue pair is configured and is started.

**Parameters**

*qptr* Pointer obtained with `rte_pmd_cnxk_crypto_qptr_get`. \
 *inst* Pointer to an array of instructions prepared by application. \
 *nb\_inst* Number of instructions.

### \_\_rte\_experimental int rte\_pmd\_cnxk\_crypto\_cptr\_flush (struct rte\_pmd\_cnxk\_crypto\_qptr \* qptr, struct rte\_pmd\_cnxk\_crypto\_cptr \* cptr, bool invalidate)

Flush the CPTR from CPT CTX cache.

This API must be called only after the cryptodev and queue pair is configured and is started.

**Parameters**

*qptr* Pointer obtained with `rte_pmd_cnxk_crypto_qptr_get`. \
 *cptr* Pointer obtained with `rte_pmd_cnxk_crypto_cptr_get` or any valid CPTR address that can be used with CPT CTX cache. \
 *invalidate* If true, invalidate the CTX cache entry. If false, flush the CTX cache entry.

**Returns**

- •

  0 on success.

- •

  Negative value on error.

- •

  \-EINVAL if the input parameters are invalid.

- •

  \-ENOTSUP if the operation is not supported.

- •

  \-EAGAIN if the operation is not successful.

- •

  \-EFAULT if the operation failed.

### \_\_rte\_experimental struct rte\_pmd\_cnxk\_crypto\_cptr \* rte\_pmd\_cnxk\_crypto\_cptr\_get (struct rte\_pmd\_cnxk\_crypto\_sess \* rte\_sess)

Get the HW CPTR pointer from the rte\_crypto/rte\_security session.

**Parameters**

*rte\_sess* Pointer to the structure holding rte\_cryptodev or rte\_security session.

**Returns**

- •

  On success, pointer to the HW CPTR.

- •

  NULL on error.

### \_\_rte\_experimental int rte\_pmd\_cnxk\_crypto\_cptr\_read (struct rte\_pmd\_cnxk\_crypto\_qptr \* qptr, struct rte\_pmd\_cnxk\_crypto\_cptr \* cptr, void \* data, uint32\_t len)

Read HW context (CPTR).

**Parameters**

*qptr* Pointer obtained with `rte_pmd_cnxk_crypto_qptr_get`. \
 *cptr* Pointer obtained with `rte_pmd_cnxk_crypto_cptr_get` or any valid CPTR address that can be used with CPT CTX cache. \
 *data* Destination pointer to copy CPTR context for application. \
 *len* Length of CPTR context to copy into data parameter.

**Returns**

- •

  0 On success.

- •

  Negative value on error.

- •

  \-EINVAL if the input parameters are invalid.

- •

  \-ENOTSUP if the operation is not supported.

- •

  \-EAGAIN if the operation is not successful.

- •

  \-EFAULT if the operation failed.

### \_\_rte\_experimental int rte\_pmd\_cnxk\_crypto\_cptr\_write (struct rte\_pmd\_cnxk\_crypto\_qptr \* qptr, struct rte\_pmd\_cnxk\_crypto\_cptr \* cptr, void \* data, uint32\_t len)

Write HW context (CPTR).

**Parameters**

*qptr* Pointer obtained with `rte_pmd_cnxk_crypto_qptr_get`. \
 *cptr* Pointer obtained with `rte_pmd_cnxk_crypto_cptr_get` or any valid CPTR address that can be used with CPT CTX cache. \
 *data* Source pointer to copy CPTR context from application. \
 *len* Length of CPTR context to copy from data parameter.

**Returns**

- •

  0 On success.

- •

  Negative value on error.

- •

  \-EINVAL if the input parameters are invalid.

- •

  \-ENOTSUP if the operation is not supported.

- •

  \-EAGAIN if the operation is not successful.

- •

  \-EFAULT if the operation failed.

### \_\_rte\_experimental int rte\_pmd\_cnxk\_crypto\_qp\_stats\_get (struct rte\_pmd\_cnxk\_crypto\_qptr \* qptr, struct rte\_pmd\_cnxk\_crypto\_qp\_stats \* stats)

Get the HW Queue Pair (LF) stats.

**Parameters**

*qptr* Pointer obtained with `rte_pmd_cnxk_crypto_qptr_get`. \
 *stats* Pointer to the structure where stats will be copied.

**Returns**

- •

  0 On success.

- •

  Negative value on error.

- •

  \-EINVAL if the input parameters are invalid.

## Author

Generated automatically by Doxygen for DPDK from the source code.
