Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IB/DC: new vendor_part_id for ConnectX-5 and enable dc for a Generic HCA - v1.3.x #2443

Merged
merged 2 commits into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/uct/ib/base/ib_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ static uct_ib_device_spec_t uct_ib_builtin_device_specs[] = {
{0x02c9, 4120, "ConnectX-5",
UCT_IB_DEVICE_FLAG_MELLANOX | UCT_IB_DEVICE_FLAG_MLX5_PRM |
UCT_IB_DEVICE_FLAG_DC_V2, 39},
{0x02c9, 41682, "ConnectX-5",
UCT_IB_DEVICE_FLAG_MELLANOX | UCT_IB_DEVICE_FLAG_MLX5_PRM |
UCT_IB_DEVICE_FLAG_DC_V2, 37},
{0, 0, "Generic HCA", 0, 0}
};

Expand Down
18 changes: 6 additions & 12 deletions src/uct/ib/dc/base/dc_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,27 +219,24 @@ void uct_dc_iface_set_quota(uct_dc_iface_t *iface, uct_dc_iface_config_t *config
ucs_min(iface->super.config.tx_qp_len, config->quota);
}

static ucs_status_t uct_dc_iface_init_version(uct_dc_iface_t *iface,
uct_md_h md)
static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
{
uct_ib_device_t *dev;
unsigned ver;

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;
return UCS_OK;
}

if (ver & UCT_IB_DEVICE_FLAG_DC_V1) {
iface->version_flag = UCT_DC_IFACE_ADDR_DC_V1;
return UCS_OK;
}

iface->version_flag = 0;
return UCS_ERR_UNSUPPORTED;
}

UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
Expand All @@ -265,10 +262,7 @@ UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
return UCS_ERR_INVALID_PARAM;
}

status = uct_dc_iface_init_version(self, md);
if (status != UCS_OK) {
return status;
}
uct_dc_iface_init_version(self, md);

self->tx.ndci = config->ndci;
self->tx.policy = config->tx_policy;
Expand Down Expand Up @@ -361,7 +355,7 @@ int uct_dc_iface_is_reachable(const uct_iface_h tl_iface,

ucs_assert_always(iface_addr != NULL);

return (addr->flags & iface->version_flag) &&
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