Skip to content

Commit

Permalink
prov/verbs: set ip_version and port correctly in RDMA CM header
Browse files Browse the repository at this point in the history
The patch also simplifies a 'if' statement.

Signed-off-by: Sylvain Didelot <sdidelot@ddn.com>
  • Loading branch information
sydidelot committed Jul 23, 2020
1 parent 330d80e commit 523a71f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions prov/verbs/src/fi_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ static int vrb_get_sib_rai(const char *node, const char *service, uint64_t flags
int vrb_get_rdma_rai(const char *node, const char *service, uint64_t flags,
const struct fi_info *hints, struct rdma_addrinfo **rai)
{
if (hints && hints->addr_format == FI_SOCKADDR_IB) {
if (node || hints->src_addr || hints->dest_addr)
return vrb_get_sib_rai(node, service, flags, hints, rai);
/* fallthrough */
if (hints && hints->addr_format == FI_SOCKADDR_IB &&
(node || hints->src_addr || hints->dest_addr)) {
return vrb_get_sib_rai(node, service, flags, hints, rai);
}

return vrb_get_rdmacm_rai(node, service, flags, hints, rai);
}

Expand Down
4 changes: 2 additions & 2 deletions prov/verbs/src/verbs_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ vrb_msg_ep_prepare_rdma_cm_hdr(void *priv_data,
{
struct vrb_rdma_cm_hdr *rdma_cm_hdr = priv_data;

rdma_cm_hdr->ip_version = 0;
rdma_cm_hdr->port = 0;
rdma_cm_hdr->ip_version = 6 << 4; /* IPv6 */
rdma_cm_hdr->port = htons(ofi_addr_get_port(&id->route.addr.src_addr));

/* Record the GIDs */
memcpy(rdma_cm_hdr->src_addr,
Expand Down

0 comments on commit 523a71f

Please sign in to comment.