Skip to content

Commit

Permalink
IB/iWARP: shifted evaluation to uct_ib_device_port_check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Oblomov committed Feb 4, 2019
1 parent 5b31b6c commit 27f6418
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/uct/ib/base/ib_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ static size_t uct_ib_device_get_ib_gid_index(uct_ib_md_t *md)
}
}

static int uct_ib_device_is_iwarp(uct_ib_device_t *dev)
{
return dev->ibv_context->device->transport_type == IBV_TRANSPORT_IWARP;
}

ucs_status_t uct_ib_device_port_check(uct_ib_device_t *dev, uint8_t port_num,
unsigned flags)
{
Expand All @@ -405,6 +410,12 @@ ucs_status_t uct_ib_device_port_check(uct_ib_device_t *dev, uint8_t port_num,
return UCS_ERR_UNREACHABLE;
}

if (uct_ib_device_is_iwarp(dev)) {
/* TODO: enable it when support is ready */
ucs_debug("iWarp device %s is not supported", uct_ib_device_name(dev));
return UCS_ERR_UNSUPPORTED;
}

if (!uct_ib_device_is_port_ib(dev, port_num) && (flags & UCT_IB_DEVICE_FLAG_LINK_IB)) {
ucs_debug("%s:%d is not IB link layer", uct_ib_device_name(dev),
port_num);
Expand Down
12 changes: 4 additions & 8 deletions src/uct/ib/base/ib_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ static ucs_status_t uct_ib_query_md_resources(uct_md_resource_desc_t **resources
uct_md_resource_desc_t *resources;
struct ibv_device **device_list;
ucs_status_t status;
int i, num_devices, num_resources;
int i, num_devices;

/* Get device list from driver */
device_list = ibv_get_device_list(&num_devices);
Expand All @@ -1177,16 +1177,12 @@ static ucs_status_t uct_ib_query_md_resources(uct_md_resource_desc_t **resources
goto out_free_device_list;
}

for (i = 0, num_resources = 0; i < num_devices; ++i) {
if (device_list[i]->transport_type != IBV_TRANSPORT_IWARP) {
uct_ib_make_md_name(resources[num_resources++].md_name, device_list[i]);
} else {
ucs_debug("iWarp device %s is not supported", ibv_get_device_name(device_list[i]));
}
for (i = 0; i < num_devices; ++i) {
uct_ib_make_md_name(resources[i].md_name, device_list[i]);
}

*resources_p = resources;
*num_resources_p = num_resources;
*num_resources_p = num_devices;
status = UCS_OK;

out_free_device_list:
Expand Down

0 comments on commit 27f6418

Please sign in to comment.