[PATCH v2 09/10] net/mlx5: share pacing rate table entries across queues

Vincent Jardin vjardin at free.fr
Wed Mar 11 00:26:52 CET 2026


Allocating PP contexts with MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX
forces one HW rate table entry per TX queue. On ConnectX-6 Dx the
rate table is small (typically 128 entries), so setting the same rate
on many queues exhausts it quickly and returns ENOSPC.

Without the dedicated flag, the kernel mlx5 driver shares a single
rate table entry across all PP contexts with identical parameters
(rate, burst, packet size) using internal refcounting. Each queue
still gets its own PP handle for proper cleanup, but the underlying
HW index is shared.

Signed-off-by: Vincent Jardin <vjardin at free.fr>
---
 drivers/net/mlx5/mlx5_txpp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c
index b87565778e..a377406e66 100644
--- a/drivers/net/mlx5/mlx5_txpp.c
+++ b/drivers/net/mlx5/mlx5_txpp.c
@@ -185,8 +185,7 @@ mlx5_txq_alloc_pp_rate_limit(struct mlx5_dev_ctx_shared *sh,
 		MLX5_SET(set_pp_rate_limit_context, &pp,
 			 typical_packet_size, sh->config.tx_typical_pkt_sz);
 	rl->pp = mlx5_glue->dv_alloc_pp
-				(sh->cdev->ctx, sizeof(pp), &pp,
-				 MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX);
+				(sh->cdev->ctx, sizeof(pp), &pp, 0);
 	if (rl->pp == NULL) {
 		DRV_LOG(ERR, "Failed to allocate PP index for rate %u Mbps.",
 			rate_mbps);
-- 
2.43.0



More information about the dev mailing list