Skip to content

Commit

Permalink
TL/MLX5: fix port query
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev committed Jan 15, 2024
1 parent 2ab6d07 commit edc8bd4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/tl/mlx5/mcast/tl_mlx5_mcast_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ ucc_status_t ucc_tl_mlx5_mcast_context_init(ucc_tl_mlx5_mcast_context_t *cont

ib = strdup(ctx->devname);
ucc_string_split(ib, ":", 2, &ib_name, &port);
ucc_free(ib);
ctx->ib_port = atoi(port);
ucc_free(ib);

/* Determine MTU */
if (ibv_query_port(ctx->ctx, ctx->ib_port, &port_attr)) {
Expand Down
20 changes: 13 additions & 7 deletions src/components/tl/mlx5/mcast/tl_mlx5_mcast_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,26 @@ ucc_status_t ucc_tl_mlx5_probe_ip_over_ib(char* ib_dev, struct
{
char *ib_name = NULL;
char *port = NULL;
char *ib = NULL;
ucc_status_t status;
struct sockaddr_storage rdma_src_addr;

if (NULL == ib_dev) {
status = UCC_ERR_NO_RESOURCE;
} else {
ucc_string_split(ib_dev, ":", 2, &ib_name, &port);
status = dev2if(ib_name, port, &rdma_src_addr);
if (ib_dev == NULL) {
return UCC_ERR_NO_RESOURCE;
}

ib = strdup(ib_dev);
if (!ib) {
return UCC_ERR_NO_MEMORY;
}

ucc_string_split(ib, ":", 2, &ib_name, &port);
status = dev2if(ib_name, port, &rdma_src_addr);

if (UCC_OK == status) {
*addr = rdma_src_addr;
}
ucc_free(ib);

return status;
}
Expand All @@ -203,7 +210,7 @@ ucc_status_t ucc_tl_mlx5_mcast_join_mcast_post(ucc_tl_mlx5_mcast_coll_context_t
}

tl_debug(ctx->lib, "joining addr: %s is_root %d", buf, is_root);

if (rdma_join_multicast(ctx->id, (struct sockaddr*)net_addr, NULL)) {
tl_error(ctx->lib, "rdma_join_multicast failed errno %d", errno);
return UCC_ERR_NO_RESOURCE;
Expand Down Expand Up @@ -552,4 +559,3 @@ ucc_status_t ucc_tl_mlx5_clean_mcast_ctx(ucc_tl_mlx5_mcast_coll_context_t *ctx)

return UCC_OK;
}

0 comments on commit edc8bd4

Please sign in to comment.