Skip to content

Commit f8064fa

Browse files
authored
Merge pull request #2443 from alinask/topic/dc_fix_vers_1_3_x
IB/DC: new vendor_part_id for ConnectX-5 and enable dc for a Generic HCA - v1.3.x
2 parents 8bf5730 + ae744b8 commit f8064fa

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

src/uct/ib/base/ib_device.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ static uct_ib_device_spec_t uct_ib_builtin_device_specs[] = {
5454
{0x02c9, 4120, "ConnectX-5",
5555
UCT_IB_DEVICE_FLAG_MELLANOX | UCT_IB_DEVICE_FLAG_MLX5_PRM |
5656
UCT_IB_DEVICE_FLAG_DC_V2, 39},
57+
{0x02c9, 41682, "ConnectX-5",
58+
UCT_IB_DEVICE_FLAG_MELLANOX | UCT_IB_DEVICE_FLAG_MLX5_PRM |
59+
UCT_IB_DEVICE_FLAG_DC_V2, 37},
5760
{0, 0, "Generic HCA", 0, 0}
5861
};
5962

src/uct/ib/dc/base/dc_iface.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,27 +219,24 @@ void uct_dc_iface_set_quota(uct_dc_iface_t *iface, uct_dc_iface_config_t *config
219219
ucs_min(iface->super.config.tx_qp_len, config->quota);
220220
}
221221

222-
static ucs_status_t uct_dc_iface_init_version(uct_dc_iface_t *iface,
223-
uct_md_h md)
222+
static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
224223
{
225224
uct_ib_device_t *dev;
226225
unsigned ver;
227226

228227
dev = &ucs_derived_of(md, uct_ib_md_t)->dev;
229228
ver = uct_ib_device_spec(dev)->flags & UCT_IB_DEVICE_FLAG_DC;
229+
ucs_assert(ver != UCT_IB_DEVICE_FLAG_DC);
230+
231+
iface->version_flag = 0;
230232

231233
if (ver & UCT_IB_DEVICE_FLAG_DC_V2) {
232234
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V2;
233-
return UCS_OK;
234235
}
235236

236237
if (ver & UCT_IB_DEVICE_FLAG_DC_V1) {
237238
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V1;
238-
return UCS_OK;
239239
}
240-
241-
iface->version_flag = 0;
242-
return UCS_ERR_UNSUPPORTED;
243240
}
244241

245242
UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
@@ -265,10 +262,7 @@ UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
265262
return UCS_ERR_INVALID_PARAM;
266263
}
267264

268-
status = uct_dc_iface_init_version(self, md);
269-
if (status != UCS_OK) {
270-
return status;
271-
}
265+
uct_dc_iface_init_version(self, md);
272266

273267
self->tx.ndci = config->ndci;
274268
self->tx.policy = config->tx_policy;
@@ -361,7 +355,7 @@ int uct_dc_iface_is_reachable(const uct_iface_h tl_iface,
361355

362356
ucs_assert_always(iface_addr != NULL);
363357

364-
return (addr->flags & iface->version_flag) &&
358+
return ((addr->flags & UCT_DC_IFACE_ADDR_DC_VERS) == iface->version_flag) &&
365359
(UCT_DC_IFACE_ADDR_TM_ENABLED(addr) ==
366360
UCT_RC_IFACE_TM_ENABLED(&iface->super)) &&
367361
uct_ib_iface_is_reachable(tl_iface, dev_addr, iface_addr);

src/uct/ib/dc/base/dc_iface.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ typedef struct uct_dc_iface uct_dc_iface_t;
2323

2424

2525
typedef enum {
26-
UCT_DC_IFACE_ADDR_HW_TM = UCS_BIT(0),
27-
UCT_DC_IFACE_ADDR_DC_V1 = UCS_BIT(1),
28-
UCT_DC_IFACE_ADDR_DC_V2 = UCS_BIT(2)
26+
UCT_DC_IFACE_ADDR_HW_TM = UCS_BIT(0),
27+
UCT_DC_IFACE_ADDR_DC_V1 = UCS_BIT(1),
28+
UCT_DC_IFACE_ADDR_DC_V2 = UCS_BIT(2),
29+
UCT_DC_IFACE_ADDR_DC_VERS = UCT_DC_IFACE_ADDR_DC_V1 |
30+
UCT_DC_IFACE_ADDR_DC_V2
2931
} uct_dc_iface_addr_flags_t;
3032

3133

0 commit comments

Comments
 (0)