net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported
A message that is not in the archive (sent off-list or not yet received): '[email protected]'
PATCH v2 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]
---
v2:
- Use mlx5_devx_obj_ops_en() instead of checking config.devx directly.
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 || !mlx5_devx_obj_ops_en (priv->sh))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
2.47.3
Quoted 11 lines · On Tue, Jun 30, 2026 at 03:53:11PM +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.
Quoted 5 lines
Fixes bbfab2eb2528 ("net/mlx5: allocate and release uniqueresources for Tx queues")
Cc: [email protected]Signed-off-by Banoth Saikumar <[email protected]>
Banoth Saikumar
Acked-by Dariusz SosnowskiRe: [External] : Re: [PATCH v2] net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported
Oracle Confidential
Hi Dariusz,
I noticed that this patch was later reverted by:
Quoted 1 line
net/mlx5: revert fallback to Verbs Tx allocation
The revert mentions that on Windows, DevX CQ creation was failing due to a different allocation fallback behavior.
Could you please clarify what specific behavior needs to be addressed for Windows?
Should the original fallback be reworked to handle the Windows case, or should the fallback be avoided entirely when running on Windows?
I would like to understand the expected behavior so I can work on a correct fix.
Thanks,
Banoth Saikumar
Oracle Confidential
________________________________
From: Dariusz Sosnowski <[email protected]>
Sent: 13 July 2026 16:45
To: Banoth Saikumar <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: [External] : Re: [PATCH v2] net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported
Quoted 11 lines · On Tue, Jun 30, 2026 at 03:53:11PM +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.
Quoted 5 lines
Fixes bbfab2eb2528 ("net/mlx5: allocate and release uniqueresources for Tx queues")
Cc: [email protected]Signed-off-by Banoth Saikumar <[email protected]>
Re: [External] : Re: [PATCH v2] net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported
Hi,
I apologize for the late reply.
Quoted 6 lines · Banoth Saikumar
Oracle Confidential
Hi Dariusz,
I noticed that this patch was later reverted by:
Quoted 7 lines
Quoted 1 line
net/mlx5: revert fallback to Verbs Tx allocation
The revert mentions that on Windows, DevX CQ creation was failing due to a different allocation fallback behavior.
Could you please clarify what specific behavior needs to be addressed for Windows?
The problem is that mlx5_devx_obj_ops_en() checks too much for both platforms. Specifically, it returns true if:
- DevX is available (sh->cdev->config.devx) AND
- At least Direct Verbs steering is enabled (sh->config.dv_flow_en) AND
- mlx5dv_dr TIR flow action is available (sh->dev_cap.dest_tir; RSS action can be configured over Direct Rules with rdma-core).
On Windows, the last condition is not satisfied because a different mechanism is used there to create flow rules.
mlx5_devx_obj_ops_en() function and its callers should be refactored to only check the DevX state as the name suggests.
After this is done, the fix can reapplied.
We'll provide the patches which rework the above, so that original fix can be reapplied, in this release cycle.
Quoted 9 lines
Should the original fallback be reworked to handle the Windows case, or should the fallback be avoided entirely when running on Windows?
I would like to understand the expected behavior so I can work on a correct fix.
Thanks,
Banoth Saikumar
[snip]
Best regards,
Dariusz Sosnowski
Re: [PATCH v2] net/mlx5: fall back to Verbs Tx allocation without DevX
In reply to [email protected]Hi Dariusz,
Thanks for the clarification.
Understood. You will reapply the original patch once the mlx5_devx_obj_ops_en() function is refactored.
Thanks,
Banoth Saikumar