Skip to content

Commit ae744b8

Browse files
committed
DC: enable dc for a Generic HCA - apply CR comments.
(cherry picked from commit 4bed082)
1 parent 6f0e8d0 commit ae744b8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
226226

227227
dev = &ucs_derived_of(md, uct_ib_md_t)->dev;
228228
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;
229232

230233
if (ver & UCT_IB_DEVICE_FLAG_DC_V2) {
231234
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V2;
@@ -234,8 +237,6 @@ static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
234237
if (ver & UCT_IB_DEVICE_FLAG_DC_V1) {
235238
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V1;
236239
}
237-
238-
iface->version_flag = 0;
239240
}
240241

241242
UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
@@ -351,11 +352,10 @@ int uct_dc_iface_is_reachable(const uct_iface_h tl_iface,
351352
uct_dc_iface_t UCS_V_UNUSED *iface = ucs_derived_of(tl_iface,
352353
uct_dc_iface_t);
353354
uct_dc_iface_addr_t *addr = (uct_dc_iface_addr_t *)iface_addr;
354-
uint8_t dc_ver_mask = UCT_DC_IFACE_ADDR_DC_V1 | UCT_DC_IFACE_ADDR_DC_V2;
355355

356356
ucs_assert_always(iface_addr != NULL);
357357

358-
return ((addr->flags & dc_ver_mask) == (iface->version_flag & dc_ver_mask)) &&
358+
return ((addr->flags & UCT_DC_IFACE_ADDR_DC_VERS) == iface->version_flag) &&
359359
(UCT_DC_IFACE_ADDR_TM_ENABLED(addr) ==
360360
UCT_RC_IFACE_TM_ENABLED(&iface->super)) &&
361361
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)