|
DPDK 25.11.0-rc1
|
Go to the source code of this file.
Data Structures | |
| struct | rte_pmd_mlx5_geneve_tlv |
| struct | rte_pmd_mlx5_driver_event_cb_queue_info |
| struct | rte_pmd_mlx5_driver_event_cb_info |
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) |
Typedefs | |
| typedef void(* | rte_pmd_mlx5_driver_event_callback_t) (uint16_t port_id, const struct rte_pmd_mlx5_driver_event_cb_info *info, const void *opaque) |
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) |
| __rte_experimental int | rte_pmd_mlx5_driver_event_cb_register (rte_pmd_mlx5_driver_event_callback_t cb, void *opaque) |
| __rte_experimental int | rte_pmd_mlx5_driver_event_cb_unregister (rte_pmd_mlx5_driver_event_callback_t cb) |
| __rte_experimental void | rte_pmd_mlx5_disable_steering (void) |
| __rte_experimental int | rte_pmd_mlx5_enable_steering (void) |
MLX5 public header.
This interface provides the ability to support private PMD dynamic flags.
Definition in file rte_pmd_mlx5.h.
| #define RTE_PMD_MLX5_DOMAIN_BIT_NIC_RX (1 << 0) |
NIC RX domain bit mask.
Definition at line 45 of file rte_pmd_mlx5.h.
| #define RTE_PMD_MLX5_DOMAIN_BIT_NIC_TX (1 << 1) |
NIC TX domain bit mask.
Definition at line 46 of file rte_pmd_mlx5.h.
| #define RTE_PMD_MLX5_DOMAIN_BIT_FDB (1 << 2) |
FDB (TX + RX) domain bit mask.
Definition at line 47 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 73 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 78 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 83 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 178 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 228 of file rte_pmd_mlx5.h.
| typedef void(* rte_pmd_mlx5_driver_event_callback_t) (uint16_t port_id, const struct rte_pmd_mlx5_driver_event_cb_info *info, const void *opaque) |
Prototype of the callback called on mlx5 driver events.
Definition at line 482 of file rte_pmd_mlx5.h.
Type of mlx5 driver event for which custom callback is called.
Definition at line 423 of file rte_pmd_mlx5.h.
| __rte_experimental int rte_pmd_mlx5_get_dyn_flag_names | ( | char * | names[], |
| unsigned int | n | ||
| ) |
Returns the dynamic flags name, that are supported.
| [out] | names | Array that is used to return the supported dynamic flags names. |
| [in] | n | The number of elements in the names array. |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | 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. |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | dpdk_idx | Queue index in rte_flow. |
| [in] | hw_idx | Queue index in hardware. |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | dpdk_idx | Queue index in rte_flow. |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | dpdk_idx | Queue index in rte_flow. |
| [in] | hw_idx | Queue index in hardware. |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | dpdk_idx | Queue index in rte_flow. |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | rate | Unit is 100Mbps, setting the rate to 0 disables the shaper. |
| [in] | flags | Host shaper flags (see RTE_PMD_MLX5_HOST_SHAPER_FLAG_*). |
| __rte_experimental int rte_pmd_mlx5_external_sq_enable | ( | uint16_t | port_id, |
| uint32_t | sq_num | ||
| ) |
Enable traffic for external SQ.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | sq_num | SQ HW number. |
| __rte_experimental int rte_pmd_mlx5_flow_engine_set_mode | ( | enum rte_pmd_mlx5_flow_engine_mode | mode, |
| uint32_t | flags | ||
| ) |
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:
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
| mode | The desired mode (see rte_pmd_mlx5_flow_engine_mode). |
| flags | Mode specific flags (see RTE_PMD_MLX5_FLOW_ENGINE_FLAG_*). |
| __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.
| [in] | port_id | The port identifier of the Ethernet device. |
| [in] | tlv_list | A list of GENEVE TLV options to create parser for them. |
| [in] | nb_options | The number of options in TLV list. |
| __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.
| [in] | handle | Handle for the GENEVE TLV parser object to be destroyed. |
| __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
| [in] | port_id | Port ID |
| [in] | queue_id | Queue ID |
| [in] | filename | Name of file to dump the Rx Queue Context |
| __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
| [in] | port_id | Port ID |
| [in] | queue_id | Queue ID |
| [in] | filename | Name of file to dump the Tx Queue Context |
| __rte_experimental int rte_pmd_mlx5_driver_event_cb_register | ( | rte_pmd_mlx5_driver_event_callback_t | cb, |
| void * | opaque | ||
| ) |
Register mlx5 driver event callback.
mlx5 PMD configures HW through interfaces exposed by rdma-core and mlx5 kernel driver. Any HW object created this way may be used by other libraries or applications. This function allows application to register a custom callback which will be called whenever mlx5 PMD performs some operation (driver event) on a managed HW objects. rte_pmd_mlx5_driver_event_cb_type defines exposed driver events.
This function can be called multiple times with different callbacks. mlx5 PMD will register all of them and all of them will be called for triggered driver events.
This function can be called:
If this function is called when mlx5 ports (at least one) exist, then provided callback will be immediately called for all applicable driver events, for all existing mlx5 ports.
This function is lock-free and it is assumed that it won't be called concurrently with other functions from ethdev API used to configure any of the mlx5 ports. It is the responsibility of the application to enforce this.
Registered callbacks might be called during control path configuration triggered by DPDK API. It is the user's responsibility to prevent calling more configurations by the DPDK API from the callback itself.
mlx5 PMD registers a destructor (through RTE_FINI) which will unregister all known callbacks.
| [in] | cb | Pointer to callback. |
| [in] | opaque | Opaque pointer which will be passed as an argument to cb on each event. |
cb is NULL.cb was already registered.| __rte_experimental int rte_pmd_mlx5_driver_event_cb_unregister | ( | rte_pmd_mlx5_driver_event_callback_t | cb | ) |
Unregister driver event callback.
Unregisters a mlx5 driver event callback which was previously registered through rte_pmd_mlx5_driver_event_cb_unregister.
This function is lock-free and it is assumed that it won't be called concurrently with other functions from ethdev API used to configure any of the mlx5 ports. It is the responsibility of the application to enforce this.
| [in] | cb | Pointer to callback. |
cb is NULL. | __rte_experimental void rte_pmd_mlx5_disable_steering | ( | void | ) |
Disable flow steering for all mlx5 ports.
In mlx5 PMD, HW flow rules are generally used in 2 ways:
In mlx5 PMD language, configuring flow rules is known as configuring flow steering.
If an application wants to use any other library compatible with NVIDIA hardware to configure flow steering or delegate flow steering to another process, the application can call this function to disable flow steering globally for all mlx5 ports.
Information required to configure flow steering in such a way that externally created flow rules would forward/match traffic to DPDK-managed Rx/Tx queues can be extracted through rte_pmd_mlx5_driver_event_cb_register API.
This function can be called:
If this function is called when mlx5 ports (at least one) exist, then steering will be disabled for all existing mlx5 port. This will invalidate ALL handles to objects return from flow API for these ports (for example handles to flow rules, indirect actions, template tables).
This function is lock-free and it is assumed that it won't be called concurrently with other functions from ethdev API used to configure any of the mlx5 ports. It is the responsibility of the application to enforce this.
| __rte_experimental int rte_pmd_mlx5_enable_steering | ( | void | ) |
Enable flow steering for mlx5 ports.
This function reverses the effects of rte_pmd_mlx5_disable_steering.
It can be called if and only if there are no mlx5 ports known by DPDK, so in case if rte_pmd_mlx5_disable_steering was previously called the application has to remove mlx5 devices, call this function and re-probe the mlx5 devices.