net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported
PATCH 1/1 net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported
From: Banoth Saikumar <[email protected]>
Previously, the mlx5 PMD attempted to allocate consecutive Tx memory using DevX without checking whether the NIC actually supported DevX. This led to allocation failures on legacy or unsupported NICs.
This patch adds a fallback mechanism: if DevX is not available, the PMD skips DevX-based allocation and allows the verbs path to handle memory allocation and registration. This improves compatibility with older NICs and ensures Tx queue setup proceeds correctly.
resources for Tx queues")
Cc: [email protected]
--- drivers/net/mlx5/mlx5_trigger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_trigger.c +1 -1
@@ -1161,7 +1161,7 @@ static int mlx5_dev_allocate_consec_tx_mem(struct rte_eth_dev *dev)void *umem_buf =NULL ;/* Legacy per queue allocation, do nothing here. */ -if (priv->sh->config.txq_mem_algn ==0 ) +if (priv->sh->config.txq_mem_algn ==0 || !priv->sh->cdev->config.devx)return 0 ; alignment = (size_t )1 << priv->sh->config.txq_mem_algn; total_size = priv->consec_tx_mem.sq_total_size + priv->consec_tx_mem.cq_total_size;
Signature · 1 line
1.8.3.1
Hi,
Thank you for the contribution. Please see below.
Quoted 25 lines · On Mon, Mar 23, 2026 at 05:04:02PM +0530, [email protected] wrote:
From: Banoth Saikumar <[email protected]>
Previously, the mlx5 PMD attempted to allocate consecutive Tx memory using DevX without checking whether the NIC actually supported DevX. This led to allocation failures on legacy or unsupported NICs.
This patch adds a fallback mechanism: if DevX is not available, the PMD skips DevX-based allocation and allows the verbs path to handle memory allocation and registration. This improves compatibility with older NICs and ensures Tx queue setup proceeds correctly.
Fixes bbfab2eb2528 ("net/mlx5: allocate and release uniqueresources for Tx queues")
Cc: [email protected]Signed-off-by Banoth Saikumar <[email protected]>--- drivers/net/mlx5/mlx5_trigger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/mlx5/mlx5_trigger.c +0
-0
drivers/net/mlx5/mlx5_trigger.c static int mlx5_dev_allocate_consec_tx_mem(struct rte_eth_dev *dev) · line 1164
Quoted 5 lines
drivers/net/mlx5/mlx5_trigger.c +1
-1@@ -1161,7 +1161,7 @@ static int mlx5_dev_allocate_consec_tx_mem(struct rte_eth_dev *dev)void *umem_buf =NULL ;/* Legacy per queue allocation, do nothing here. */ -if (priv->sh->config.txq_mem_algn ==0 ) +if (priv->sh->config.txq_mem_algn ==0 || !priv->sh->cdev->config.devx)
Please use mlx5_devx_obj_ops_en() function instead of directly checking priv->sh->cdev->config.devx field.
drivers/net/mlx5/mlx5_trigger.c static int mlx5_dev_allocate_consec_tx_mem(struct rte_eth_dev *dev) · line 1167
Quoted 3 lines
drivers/net/mlx5/mlx5_trigger.c +0
-0return 0 ; alignment = (size_t )1 << priv->sh->config.txq_mem_algn; total_size = priv->consec_tx_mem.sq_total_size + priv->consec_tx_mem.cq_total_size;
Best regards,
Dariusz Sosnowski