Skip to contentSkip to conversation

net/mlx5: fix send skew settings when using wait on time

PATCH In review Viacheslav Ovsiienko 3 participants 3 messages Mar 20 – Mar 24 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix send skew settings when using wait on time

There are two modes to support tx send scheduling in mlx5 drivers, using the Clock Queue and tx_pp parameter, and using the wait_on_time hardware capability. The tx_skew devarg is applicable for both, but in case of tx_pp=0 (that supposes wait_on_time mode is engaged on ConnectX-7 and above), the tx_skew setting was missed (as mlx5_txpp_create was not invoked).

Fixes 2f5122dfc41f ("net/mlx5: configure Tx queue with send on time offload")
---
 drivers/net/mlx5/mlx5.c      | 2 ++
 drivers/net/mlx5/mlx5_txpp.c | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5.c +2 -0
index f5784761f9..b70792d77c 100644
@@ -1906,6 +1906,8 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
 			strerror(rte_errno));
 		goto error;
 	}
+	/* Used on Tx send scheduling (tx_pp=1 or wait-on-time). */
+	sh->txpp.skew = sh->config.tx_skew;
 	sh->refcnt = 1;
 	sh->max_port = spawn->max_port;
 	strncpy(sh->ibdev_name, mlx5_os_get_ctx_device_name(sh->cdev->ctx),
drivers/net/mlx5/mlx5_txpp.c +0 -3
index 756a772cc5..a8cfe233d6 100644
@@ -908,7 +908,6 @@ mlx5_txpp_create(struct mlx5_dev_ctx_shared *sh)
 	/* Store the requested pacing parameters. */
 	sh->txpp.tick = tx_pp >= 0 ? tx_pp : -tx_pp;
 	sh->txpp.test = !!(tx_pp < 0);
-	sh->txpp.skew = sh->config.tx_skew;
 	sh->txpp.freq = sh->cdev->config.hca_attr.dev_freq_khz;
 	ret = mlx5_txpp_create_event_channel(sh);
 	if (ret)
@@ -934,7 +933,6 @@ mlx5_txpp_create(struct mlx5_dev_ctx_shared *sh)
 		mlx5_txpp_destroy_event_channel(sh);
 		sh->txpp.tick = 0;
 		sh->txpp.test = 0;
-		sh->txpp.skew = 0;
 	}
 	return ret;
 }
@@ -956,7 +954,6 @@ mlx5_txpp_destroy(struct mlx5_dev_ctx_shared *sh)
 	mlx5_txpp_destroy_event_channel(sh);
 	sh->txpp.tick = 0;
 	sh->txpp.test = 0;
-	sh->txpp.skew = 0;
 }
 
 /**
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Viacheslav Ovsiienko

There are two modes to support tx send scheduling in mlx5 drivers, using the Clock Queue and tx_pp parameter, and using the wait_on_time hardware capability. The tx_skew devarg is applicable for both, but in case of tx_pp=0 (that supposes wait_on_time mode is engaged on ConnectX-7 and above), the tx_skew setting was missed (as mlx5_txpp_create was not invoked).

Fixes 2f5122dfc41f ("net/mlx5: configure Tx queue with send on time offload")

Best regards,
Dariusz Sosnowski

#2 lore raw
In reply to Viacheslav Ovsiienko

Hi,

Quoted 11 lines · Viacheslav Ovsiienko

There are two modes to support tx send scheduling in mlx5 drivers, using the Clock Queue and tx_pp parameter, and using the wait_on_time hardware capability. The tx_skew devarg is applicable for both, but in case of tx_pp=0 (that supposes wait_on_time mode is engaged on ConnectX-7 and above), the tx_skew setting was missed (as mlx5_txpp_create was not invoked).

Fixes 2f5122dfc41f ("net/mlx5: configure Tx queue with send on time offload")

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh