Skip to contentSkip to conversation

net/mlx5: fallback to verbs for Tx memory allocation if devx unsupported

PATCH In review [email protected] 2 participants 5 messages Jun 30 – Sep 25 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): '[email protected]'

#1 lore raw

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.

Fixes bbfab2eb2528 ("net/mlx5: allocate and release unique

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
index 6c6f228afd..721fa5e2c8 100644
@@ -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
Acked-by on v2 1/1
#2 lore raw
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 unique

resources for Tx queues")
Cc: [email protected]

author Acked-by Dariusz Sosnowski
#3 lore raw

Re: [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 unique

resources for Tx queues")
Cc: [email protected]

#4 lore raw

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

#5 lore raw

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