Skip to content

Commit

Permalink
Merge pull request #10439 from yosefe/topic/uct-ib-fix-uct-ib-address…
Browse files Browse the repository at this point in the history
…-str

UCT/IB: Fix uct_ib_address_str(), used for UD CREQ/CREP log.
  • Loading branch information
yosefe authored Jan 22, 2025
2 parents 3e97108 + d861ebb commit 798c4b0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/uct/ib/base/ib_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,15 @@ const char *uct_ib_address_str(const uct_ib_address_t *ib_addr, char *buf,
p += strlen(p);
}

uct_ib_gid_str(&params.gid, p, endp - p);
p += strlen(p);
if (params.flags & (UCT_IB_ADDRESS_PACK_FLAG_ETH |
UCT_IB_ADDRESS_PACK_FLAG_SUBNET_PREFIX |
UCT_IB_ADDRESS_PACK_FLAG_INTERFACE_ID)) {
uct_ib_gid_str(&params.gid, p, endp - p);
p += strlen(p);

snprintf(p, endp - p, " ");
p += strlen(p);
}

if (params.flags & UCT_IB_ADDRESS_PACK_FLAG_GID_INDEX) {
ucs_assert(params.gid_index != UCT_IB_ADDRESS_INVALID_GID_INDEX);
Expand All @@ -605,7 +612,7 @@ const char *uct_ib_address_str(const uct_ib_address_t *ib_addr, char *buf,

ucs_assert((params.flags & UCT_IB_ADDRESS_PACK_FLAG_PKEY) &&
(params.flags != UCT_IB_ADDRESS_INVALID_PKEY));
snprintf(p, endp - p, "pkey 0x%x ", params.pkey);
snprintf(p, endp - p, "pkey 0x%x", params.pkey);

return buf;
}
Expand Down

0 comments on commit 798c4b0

Please sign in to comment.