Skip to content

Commit 740238d

Browse files
authored
UCT/IB/MLX5: Fix DEVX for not WC-supported UAR (#11310)
* UCT/IB/MLX5: Fix DEVX for not WC-supported UAR Fix two separate bugs related to UCX assuming UAR pages of HCA always supporting WC (write combining) and not checking UCT_IB_MLX5_MD_FLAG_UAR_USE_WC flag : - Doorbell path hardcoded bf_size=256, forcing BF mode even if UAR is NC-mapped - Device memory was allocated and copied data via MMIO writes even if it was not supported (because it requires WC) * UCT/IB/MLX5: PR fix - code convention
1 parent 4cb9dbb commit 740238d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/uct/ib/mlx5/dv/ib_mlx5_dv.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ ucs_status_t uct_ib_mlx5_devx_create_qp_common(uct_ib_iface_t *iface,
133133
{
134134
uct_ib_mlx5_md_t *md = ucs_derived_of(iface->super.md, uct_ib_mlx5_md_t);
135135
uct_ib_device_t *dev = &md->super.dev;
136+
uint64_t bf_size = 0;
136137
char in[UCT_IB_MLX5DV_ST_SZ_BYTES(create_qp_in)] = {};
137138
char out[UCT_IB_MLX5DV_ST_SZ_BYTES(create_qp_out)] = {};
138139
char in_2init[UCT_IB_MLX5DV_ST_SZ_BYTES(rst2init_qp_in)] = {};
@@ -144,8 +145,12 @@ ucs_status_t uct_ib_mlx5_devx_create_qp_common(uct_ib_iface_t *iface,
144145

145146
uct_ib_iface_fill_attr(iface, &attr->super);
146147

148+
if (md->flags & UCT_IB_MLX5_MD_FLAG_UAR_USE_WC) {
149+
bf_size = UCT_IB_MLX5_BF_REG_SIZE;
150+
}
151+
147152
status = uct_ib_mlx5_get_mmio_mode(iface->super.worker, attr->mmio_mode, 0,
148-
UCT_IB_MLX5_BF_REG_SIZE, &mmio_mode);
153+
bf_size, &mmio_mode);
149154
if (status != UCS_OK) {
150155
goto err;
151156
}

src/uct/ib/mlx5/rc/rc_mlx5_common.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,11 @@ uct_rc_mlx5_iface_common_dm_init(uct_rc_mlx5_iface_common_t *iface,
10461046
goto fallback;
10471047
}
10481048

1049+
if (!(uct_ib_mlx5_iface_md(&rc_iface->super)->flags &
1050+
UCT_IB_MLX5_MD_FLAG_UAR_USE_WC)) {
1051+
goto fallback;
1052+
}
1053+
10491054
iface->dm.dm = uct_worker_tl_data_get(iface->super.super.super.worker,
10501055
UCT_IB_MLX5_WORKER_DM_KEY,
10511056
uct_mlx5_dm_data_t,

0 commit comments

Comments
 (0)