From cebd491f520fbed90b19b01aad280bc43338ebaa Mon Sep 17 00:00:00 2001 From: Itamar Gozlan Date: Sun, 10 Mar 2024 19:00:36 +0200 Subject: [PATCH] mlx5: DR, Using sq ts format when RoCE is disabled When creating a QP in SW steering, one of the attributes is TS format (timestamp). In some devices, we have a limitation that all QPs should have the same ts_format. The qp_ts_format cap resides under the RoCE caps table, and the cap is not queried when RoCE is disabled. Consider the case when the system is configured to run with REAL_TIME_TS format (0x2), some QPs are created, and we disable RoCE. When trying to construct a new QP, we can't use the qp_ts_format, that is queried from the RoCE caps table. That leads to passing 0x0 (FREE_RUNNING_TS) as the value of the qp_ts_format, which is different than the ts_format of the previous QPs REAL_TIME_TS format (0x2) and the creation will fail. To resolve this, we will read the sq_ts_format, which also reflect the supported ts format for the QP when RoCE is disabled, and override it with qp_ts_format from the RoCE caps table if RoCE is enabled. Fixes: ed504ab47384 ("mlx5: DR, Set QP timestamp mode to default") Signed-off-by: Itamar Gozlan Signed-off-by: Alex Vesker Signed-off-by: Yishai Hadas --- providers/mlx5/dr_devx.c | 3 +++ providers/mlx5/mlx5_ifc.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/providers/mlx5/dr_devx.c b/providers/mlx5/dr_devx.c index 3fc2c532b..1bcdedd8b 100644 --- a/providers/mlx5/dr_devx.c +++ b/providers/mlx5/dr_devx.c @@ -243,6 +243,9 @@ int dr_devx_query_device(struct ibv_context *ctx, struct dr_devx_caps *caps) caps->roce_caps.fl_rc_qp_when_roce_disabled = DEVX_GET(query_hca_cap_out, out, capability.cmd_hca_cap.fl_rc_qp_when_roce_disabled); + caps->roce_caps.qp_ts_format = DEVX_GET(query_hca_cap_out, out, + capability.cmd_hca_cap.sq_ts_format); + if (caps->support_modify_argument) { caps->log_header_modify_argument_granularity = DEVX_GET(query_hca_cap_out, out, diff --git a/providers/mlx5/mlx5_ifc.h b/providers/mlx5/mlx5_ifc.h index 51000c9f7..532d62ca8 100644 --- a/providers/mlx5/mlx5_ifc.h +++ b/providers/mlx5/mlx5_ifc.h @@ -1183,7 +1183,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 general_obj_types[0x40]; - u8 reserved_at_440[0x4]; + u8 sq_ts_format[0x2]; + u8 rq_ts_format[0x2]; u8 steering_format_version[0x4]; u8 create_qp_start_hint[0x18];