Skip to content

Commit

Permalink
mlx5: DR, Using sq ts format when RoCE is disabled
Browse files Browse the repository at this point in the history
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: ed504ab ("mlx5: DR, Set QP timestamp mode to default")
Signed-off-by: Itamar Gozlan <[email protected]>
Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
  • Loading branch information
Itamar-Gozlan authored and Yishai Hadas committed Mar 26, 2024
1 parent b51ef55 commit cebd491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions providers/mlx5/dr_devx.c
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion providers/mlx5/mlx5_ifc.h
Expand Up @@ -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];

Expand Down

0 comments on commit cebd491

Please sign in to comment.