Skip to content

Commit

Permalink
DC: enable dc for a Generic HCA - apply CR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
alinask committed Mar 7, 2018
1 parent b873f3a commit 4bed082
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/uct/ib/dc/base/dc_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)

dev = &ucs_derived_of(md, uct_ib_md_t)->dev;
ver = uct_ib_device_spec(dev)->flags & UCT_IB_DEVICE_FLAG_DC;
ucs_assert(ver != UCT_IB_DEVICE_FLAG_DC);

iface->version_flag = 0;

if (ver & UCT_IB_DEVICE_FLAG_DC_V2) {
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V2;
Expand All @@ -234,8 +237,6 @@ static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
if (ver & UCT_IB_DEVICE_FLAG_DC_V1) {
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V1;
}

iface->version_flag = 0;
}

UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
Expand Down Expand Up @@ -351,11 +352,10 @@ int uct_dc_iface_is_reachable(const uct_iface_h tl_iface,
uct_dc_iface_t UCS_V_UNUSED *iface = ucs_derived_of(tl_iface,
uct_dc_iface_t);
uct_dc_iface_addr_t *addr = (uct_dc_iface_addr_t *)iface_addr;
uint8_t dc_ver_mask = UCT_DC_IFACE_ADDR_DC_V1 | UCT_DC_IFACE_ADDR_DC_V2;

ucs_assert_always(iface_addr != NULL);

return ((addr->flags & dc_ver_mask) == (iface->version_flag & dc_ver_mask)) &&
return ((addr->flags & UCT_DC_IFACE_ADDR_DC_VERS) == iface->version_flag) &&
(UCT_DC_IFACE_ADDR_TM_ENABLED(addr) ==
UCT_RC_IFACE_TM_ENABLED(&iface->super)) &&
uct_ib_iface_is_reachable(tl_iface, dev_addr, iface_addr);
Expand Down
8 changes: 5 additions & 3 deletions src/uct/ib/dc/base/dc_iface.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ typedef struct uct_dc_iface uct_dc_iface_t;


typedef enum {
UCT_DC_IFACE_ADDR_HW_TM = UCS_BIT(0),
UCT_DC_IFACE_ADDR_DC_V1 = UCS_BIT(1),
UCT_DC_IFACE_ADDR_DC_V2 = UCS_BIT(2)
UCT_DC_IFACE_ADDR_HW_TM = UCS_BIT(0),
UCT_DC_IFACE_ADDR_DC_V1 = UCS_BIT(1),
UCT_DC_IFACE_ADDR_DC_V2 = UCS_BIT(2),
UCT_DC_IFACE_ADDR_DC_VERS = UCT_DC_IFACE_ADDR_DC_V1 |
UCT_DC_IFACE_ADDR_DC_V2
} uct_dc_iface_addr_flags_t;


Expand Down

0 comments on commit 4bed082

Please sign in to comment.