Skip to content

Commit

Permalink
Merge pull request #8603 from shamisp/topic/fix_8595
Browse files Browse the repository at this point in the history
IB/BASE: Fixes #8595
  • Loading branch information
yosefe authored Oct 19, 2022
2 parents 204d06c + b3252f0 commit f848eea
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/uct/ib/base/ib_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,6 @@ static unsigned long 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 @@ -775,12 +770,6 @@ 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
38 changes: 37 additions & 1 deletion src/uct/ib/base/ib_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,42 @@ static uct_md_ops_t UCS_V_UNUSED uct_ib_md_global_odp_ops = {
.detect_memory_type = ucs_empty_function_return_unsupported,
};

static const char *uct_ib_device_transport_type_name(struct ibv_device *device)
{
switch (device->transport_type) {
case IBV_TRANSPORT_IB:
return "InfiniBand";
case IBV_TRANSPORT_IWARP:
return "iWARP";
#if HAVE_DECL_IBV_TRANSPORT_USNIC
case IBV_TRANSPORT_USNIC:
return "usNIC";
#endif
#if HAVE_DECL_IBV_TRANSPORT_USNIC_UDP
case IBV_TRANSPORT_USNIC_UDP:
return "usNIC UDP";
#endif
#if HAVE_DECL_IBV_TRANSPORT_UNSPECIFIED
case IBV_TRANSPORT_UNSPECIFIED:
return "Unspecified";
#endif
default:
return "Unknown";
}
}

static int uct_ib_device_is_supported(struct ibv_device *device)
{
/* TODO: enable additional transport types when ready */
int ret = device->transport_type == IBV_TRANSPORT_IB;
if (!ret) {
ucs_debug("device %s of type %s is not supported",
device->dev_name, uct_ib_device_transport_type_name(device));
}

return ret;
}

int uct_ib_device_is_accessible(struct ibv_device *device)
{
/* Enough place to hold the full path */
Expand All @@ -1302,7 +1338,7 @@ int uct_ib_device_is_accessible(struct ibv_device *device)
return 0;
}

return 1;
return uct_ib_device_is_supported(device);
}

static ucs_status_t uct_ib_query_md_resources(uct_component_t *component,
Expand Down
3 changes: 3 additions & 0 deletions src/uct/ib/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ AS_IF([test "x$with_ib" = "xyes"],
AC_CHECK_DECLS([IBV_LINK_LAYER_INFINIBAND,
IBV_LINK_LAYER_ETHERNET,
IBV_EVENT_GID_CHANGE,
IBV_TRANSPORT_USNIC,
IBV_TRANSPORT_USNIC_UDP,
IBV_TRANSPORT_UNSPECIFIED,
ibv_create_qp_ex,
ibv_create_cq_ex,
ibv_create_srq_ex,
Expand Down

0 comments on commit f848eea

Please sign in to comment.