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/BASE: Fixes #8595 #8603

Merged
merged 1 commit into from
Oct 19, 2022
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
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 @@ -743,11 +743,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 @@ -774,12 +769,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 @@ -1230,6 +1230,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is small and used once, IMO we can move its code to uct_ib_device_is_accessible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO stand alone static functions look cleaner and makes code easier to read.

{
/* 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 @@ -1248,7 +1284,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 @@ -195,6 +195,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