---
name: "RTE_PMD_MLX5_FLOW_ENGINE_FLAG_STANDBY_DUP_INGRESS"
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_mlx5.h"
---

# RTE\_PMD\_MLX5\_FLOW\_ENGINE\_FLAG\_STANDBY\_DUP\_INGRESS(3)

Part of [rte\_pmd\_mlx5.h(3)](/rte_pmd_mlx5.h/3.md).

## NAME

rte\_pmd\_mlx5.h

## SYNOPSIS

`#include <rte_compat.h>`\

### Data Structures

struct **rte\_pmd\_mlx5\_geneve\_tlv**\

### Macros

\#define **RTE\_PMD\_MLX5\_DOMAIN\_BIT\_NIC\_RX**   (1 \<\< 0)\
 \#define **RTE\_PMD\_MLX5\_DOMAIN\_BIT\_NIC\_TX**   (1 \<\< 1)\
 \#define **RTE\_PMD\_MLX5\_DOMAIN\_BIT\_FDB**   (1 \<\< 2)\
 \#define **RTE\_PMD\_MLX5\_EXTERNAL\_RX\_QUEUE\_ID\_MIN**   (UINT16\_MAX - 1000 + 1)\
 \#define **MLX5\_EXTERNAL\_TX\_QUEUE\_ID\_MIN**   (UINT16\_MAX - 1000 + 1)\
 \#define **RTE\_PMD\_MLX5\_LINEAR\_HASH\_TAG\_INDEX**   255\
 \#define **RTE\_PMD\_MLX5\_HOST\_SHAPER\_FLAG\_AVAIL\_THRESH\_TRIGGERED**   0\
 \#define **RTE\_PMD\_MLX5\_FLOW\_ENGINE\_FLAG\_STANDBY\_DUP\_INGRESS**   **RTE\_BIT32**(0)\

### Functions

\_\_rte\_experimental int **rte\_pmd\_mlx5\_get\_dyn\_flag\_names** (char \*names\[\], unsigned int n)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_sync\_flow** (uint16\_t port\_id, uint32\_t domains)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_external\_rx\_queue\_id\_map** (uint16\_t port\_id, uint16\_t dpdk\_idx, uint32\_t hw\_idx)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_external\_rx\_queue\_id\_unmap** (uint16\_t port\_id, uint16\_t dpdk\_idx)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_external\_tx\_queue\_id\_map** (uint16\_t port\_id, uint16\_t dpdk\_idx, uint32\_t hw\_idx)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_external\_tx\_queue\_id\_unmap** (uint16\_t port\_id, uint16\_t dpdk\_idx)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_host\_shaper\_config** (int port\_id, uint8\_t rate, uint32\_t flags)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_external\_sq\_enable** (uint16\_t port\_id, uint32\_t sq\_num)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_flow\_engine\_set\_mode** (enum rte\_pmd\_mlx5\_flow\_engine\_mode mode, uint32\_t flags)\
 \_\_rte\_experimental void \* **rte\_pmd\_mlx5\_create\_geneve\_tlv\_parser** (uint16\_t port\_id, const struct **rte\_pmd\_mlx5\_geneve\_tlv** tlv\_list\[\], uint8\_t nb\_options)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_destroy\_geneve\_tlv\_parser** (void \*handle)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_rxq\_dump\_contexts** (uint16\_t port\_id, uint16\_t queue\_id, const char \*filename)\
 \_\_rte\_experimental int **rte\_pmd\_mlx5\_txq\_dump\_contexts** (uint16\_t port\_id, uint16\_t queue\_id, const char \*filename)\

## Detailed Description

MLX5 public header.

This interface provides the ability to support private PMD dynamic flags.

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

## Macro Definition Documentation

### #define RTE\_PMD\_MLX5\_DOMAIN\_BIT\_NIC\_RX (1 \<\< 0)

NIC RX domain bit mask.

Definition at line **41** of file **rte\_pmd\_mlx5.h**.

### #define RTE\_PMD\_MLX5\_DOMAIN\_BIT\_NIC\_TX (1 \<\< 1)

NIC TX domain bit mask.

Definition at line **42** of file **rte\_pmd\_mlx5.h**.

### #define RTE\_PMD\_MLX5\_DOMAIN\_BIT\_FDB (1 \<\< 2)

FDB (TX + RX) domain bit mask.

Definition at line **43** of file **rte\_pmd\_mlx5.h**.

### #define RTE\_PMD\_MLX5\_EXTERNAL\_RX\_QUEUE\_ID\_MIN (UINT16\_MAX - 1000 + 1)

External Rx queue rte\_flow index minimal value.

Definition at line **69** of file **rte\_pmd\_mlx5.h**.

### #define MLX5\_EXTERNAL\_TX\_QUEUE\_ID\_MIN (UINT16\_MAX - 1000 + 1)

External Tx queue rte\_flow index minimal value.

Definition at line **74** of file **rte\_pmd\_mlx5.h**.

### #define RTE\_PMD\_MLX5\_LINEAR\_HASH\_TAG\_INDEX 255

Tag level to set the linear hash index.

Definition at line **79** of file **rte\_pmd\_mlx5.h**.

### #define RTE\_PMD\_MLX5\_HOST\_SHAPER\_FLAG\_AVAIL\_THRESH\_TRIGGERED 0

The rate of the host port shaper will be updated directly at the next available descriptor threshold event to the rate that comes with this flag set; set rate 0 to disable this rate update. Unset this flag to update the rate of the host port shaper directly in the API call; use rate 0 to disable the current shaper.

Definition at line **174** of file **rte\_pmd\_mlx5.h**.

### #define RTE\_PMD\_MLX5\_FLOW\_ENGINE\_FLAG\_STANDBY\_DUP\_INGRESS RTE\_BIT32(0)

When set on the flow engine of a standby process, ingress flow rules will be effective in active and standby processes, so the ingress traffic may be duplicated.

Definition at line **224** of file **rte\_pmd\_mlx5.h**.

## Function Documentation

### \_\_rte\_experimental int rte\_pmd\_mlx5\_get\_dyn\_flag\_names (char \* names\[\], unsigned int n)

Returns the dynamic flags name, that are supported.

**Parameters**

*names* Array that is used to return the supported dynamic flags names. \
 *n* The number of elements in the names array.

**Returns**

The number of dynamic flags that were copied if not negative. Otherwise:

- •

  ENOMEM - not enough entries in the array

- •

  EINVAL - invalid array entry

### \_\_rte\_experimental int rte\_pmd\_mlx5\_sync\_flow (uint16\_t port\_id, uint32\_t domains)

Synchronize the flows to make them take effort on hardware. It only supports DR flows now. For DV and Verbs flows, there is no need to call this function, and a success will return directly in case of Verbs.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *domains* Refer to '/usr/include/infiniband/mlx5dv.h'. Bitmask of domains in which the synchronization will be done. RTE\_PMD\_MLX5\_DOMAIN\_BIT\_\* macros are used to specify the domains. An ADD or OR operation could be used to synchronize flows in more than one domain per call.

**Returns**

- •

  (0) if successful.

- •

  Negative value if an error.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_external\_rx\_queue\_id\_map (uint16\_t port\_id, uint16\_t dpdk\_idx, uint32\_t hw\_idx)

Update mapping between rte\_flow queue index (16 bits) and HW queue index (32 bits) for RxQs which is created outside the PMD.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *dpdk\_idx* Queue index in rte\_flow. \
 *hw\_idx* Queue index in hardware.

**Returns**

0 on success, a negative errno value otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  EEXIST - a mapping with the same rte\_flow index already exists.

- •

  EINVAL - invalid rte\_flow index, out of range.

- •

  ENODEV - there is no Ethernet device for this port id.

- •

  ENOTSUP - the port doesn't support external RxQ.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_external\_rx\_queue\_id\_unmap (uint16\_t port\_id, uint16\_t dpdk\_idx)

Remove mapping between rte\_flow queue index (16 bits) and HW queue index (32 bits) for RxQs which is created outside the PMD.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *dpdk\_idx* Queue index in rte\_flow.

**Returns**

0 on success, a negative errno value otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  EINVAL - invalid index, out of range, still referenced or doesn't exist.

- •

  ENODEV - there is no Ethernet device for this port id.

- •

  ENOTSUP - the port doesn't support external RxQ.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_external\_tx\_queue\_id\_map (uint16\_t port\_id, uint16\_t dpdk\_idx, uint32\_t hw\_idx)

Update mapping between rte\_flow Tx queue index (16 bits) and HW queue index (32 bits) for TxQs which is created outside the PMD.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *dpdk\_idx* Queue index in rte\_flow. \
 *hw\_idx* Queue index in hardware.

**Returns**

0 on success, a negative errno value otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  EEXIST - a mapping with the same rte\_flow index already exists.

- •

  EINVAL - invalid rte\_flow index, out of range.

- •

  ENODEV - there is no Ethernet device for this port id.

- •

  ENOTSUP - the port doesn't support external TxQ.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_external\_tx\_queue\_id\_unmap (uint16\_t port\_id, uint16\_t dpdk\_idx)

Remove mapping between rte\_flow Tx queue index (16 bits) and HW queue index (32 bits) for TxQs which is created outside the PMD.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *dpdk\_idx* Queue index in rte\_flow.

**Returns**

0 on success, a negative errno value otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  EINVAL - invalid index, out of range, still referenced or doesn't exist.

- •

  ENODEV - there is no Ethernet device for this port id.

- •

  ENOTSUP - the port doesn't support external TxQ.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_host\_shaper\_config (int port\_id, uint8\_t rate, uint32\_t flags)

Configure a HW shaper to limit Tx rate for a host port. The configuration will affect all the ethdev ports belonging to the same rte\_device.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *rate* Unit is 100Mbps, setting the rate to 0 disables the shaper. \
 *flags* Host shaper flags (see RTE\_PMD\_MLX5\_HOST\_SHAPER\_FLAG\_\*).

**Returns**

0 : operation success. Otherwise:

- •

  ENOENT - no ibdev interface.

- •

  EBUSY - the register access unit is busy.

- •

  EIO - the register access command meets IO error.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_external\_sq\_enable (uint16\_t port\_id, uint32\_t sq\_num)

Enable traffic for external SQ.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *sq\_num* SQ HW number.

**Returns**

0 on success, a negative errno value otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  EINVAL - invalid sq\_number or port type.

- •

  ENODEV - there is no Ethernet device for this port id.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_flow\_engine\_set\_mode (enum rte\_pmd\_mlx5\_flow\_engine\_mode mode, uint32\_t flags)

**Warning**

**EXPERIMENTAL:** this API may change without prior notice

Set the flow engine mode of the process to active or standby, affecting network traffic handling.

If one device does not support this operation or fails, the whole operation is failed and rolled back.

It is forbidden to have multiple flow engines with the same mode unless only one of them is configured to handle the traffic.

The application's flow engine is active by default. The configuration from the active flow engine is effective immediately while the configuration from the standby flow engine is queued by hardware. When configuring the device from a standby flow engine, it has no effect except for below situations:

- •

  traffic not handled by the active flow engine configuration

- •

  no active flow engine

When flow engine of a process is changed from a standby to an active mode, all preceding configurations that are queued by hardware should become effective immediately. Before mode transition, all the traffic handling configurations set by the active flow engine should be flushed first.

In summary, the operations are expected to happen in this order in 'old' and 'new' applications: device: already configured by the old application new: start as active new: probe the same device new: set as standby new: configure the device device: has configurations from old and new applications old: clear its device configuration device: has only 1 configuration from new application new: set as active device: downtime for connecting all to the new application old: shutdown

**Parameters**

*mode* The desired mode (see rte\_pmd\_mlx5\_flow\_engine\_mode). \
 *flags* Mode specific flags (see RTE\_PMD\_MLX5\_FLOW\_ENGINE\_FLAG\_\*).

**Returns**

Positive value on success, -rte\_errno value on error:

- •

  (\> 0) Number of switched devices.

- •

  (-EINVAL) if error happen and rollback internally.

- •

  (-EPERM) if operation failed and can't recover.

### \_\_rte\_experimental void \* rte\_pmd\_mlx5\_create\_geneve\_tlv\_parser (uint16\_t port\_id, const struct rte\_pmd\_mlx5\_geneve\_tlv tlv\_list\[\], uint8\_t nb\_options)

Creates GENEVE TLV parser for the selected port. This function must be called before first use of GENEVE option.

This API is port oriented, but the configuration is done once for all ports under the same physical device. Each port should call this API before using GENEVE OPT item, but it must use the same options in the same order inside the list.

Each physical device has 7 DWs for GENEVE TLV options. Each nonzero element in 'match\_data\_mask' array consumes one DW, and choosing matchable mode for class consumes additional one. Calling this API for second port under same physical device doesn't consume more DW, it uses same configuration.

**Parameters**

*port\_id* The port identifier of the Ethernet device. \
 *tlv\_list* A list of GENEVE TLV options to create parser for them. \
 *nb\_options* The number of options in TLV list.

**Returns**

A pointer to TLV handle on success, NULL otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  ENOMEM - not enough memory to create GENEVE TLV parser.

- •

  EEXIST - this port already has GENEVE TLV parser or another port under same physical device has already prepared a different parser.

- •

  EINVAL - invalid GENEVE TLV requested.

- •

  ENODEV - there is no Ethernet device for this port id.

- •

  ENOTSUP - the port doesn't support GENEVE TLV parsing.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_destroy\_geneve\_tlv\_parser (void \* handle)

Destroy GENEVE TLV parser for the selected port. This function must be called after last use of GENEVE option and before port closing.

**Parameters**

*handle* Handle for the GENEVE TLV parser object to be destroyed.

**Returns**

0 on success, a negative errno value otherwise and rte\_errno is set. Possible values for rte\_errno:

- •

  EINVAL - invalid handle.

- •

  ENOENT - there is no valid GENEVE TLV parser in this handle.

- •

  EBUSY - one of options is in used by template table.

### \_\_rte\_experimental int rte\_pmd\_mlx5\_rxq\_dump\_contexts (uint16\_t port\_id, uint16\_t queue\_id, const char \* filename)

Dump Rx Queue Context for a given port/queue

**Parameters**

*port\_id* Port ID \
 *queue\_id* Queue ID \
 *filename* Name of file to dump the Rx Queue Context

**Returns**

0 for success, non-zero value depending on failure type

### \_\_rte\_experimental int rte\_pmd\_mlx5\_txq\_dump\_contexts (uint16\_t port\_id, uint16\_t queue\_id, const char \* filename)

Dump Tx Queue Context for a given port/queue

**Parameters**

*port\_id* Port ID \
 *queue\_id* Queue ID \
 *filename* Name of file to dump the Tx Queue Context

**Returns**

0 for success, non-zero value depending on failure type

## Author

Generated automatically by Doxygen for DPDK from the source code.
