Skip to content

Commit

Permalink
Add FI_TAG_RPC to discard unexpected tagged messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jxiong committed Feb 13, 2025
1 parent f434d1e commit 1e6d785
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/rdma/fabric.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ enum {
FI_TAG_BITS,
FI_TAG_MPI,
FI_TAG_CCL,
FI_TAG_RPC,
FI_TAG_MAX_FORMAT = (1ULL << 16),
};

Expand Down
1 change: 1 addition & 0 deletions prov/tcp/src/xnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ struct xnet_ep {
void (*hdr_bswap)(struct xnet_ep *ep, struct xnet_base_hdr *hdr);

short pollflags;
bool tagged_rpc;

xnet_profile_t *profile;
};
Expand Down
1 change: 1 addition & 0 deletions prov/tcp/src/xnet_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ xnet_ep_accept(struct fid_ep *ep_fid, const void *param, size_t paramlen)
(paramlen > XNET_MAX_CM_DATA_SIZE))
return -FI_EINVAL;

ep->tagged_rpc = conn->pep->info->ep_attr->mem_tag_format == FI_TAG_RPC;
ep->conn = NULL;

assert(ep->cm_msg);
Expand Down
12 changes: 8 additions & 4 deletions prov/tcp/src/xnet_progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,16 +860,20 @@ static int xnet_handle_tag(struct xnet_ep *ep)
if (rx_entry)
return xnet_start_recv(ep, rx_entry);
}

if (ep->tagged_rpc) {
/* receive and discard this unexpected message for tagged rpc */
rx_entry = xnet_get_unexp_rx(ep, tag);
if (rx_entry)
return xnet_start_recv(ep, rx_entry);
}

if (dlist_empty(&ep->unexp_entry)) {
dlist_insert_tail(&ep->unexp_entry,
&xnet_ep2_progress(ep)->unexp_tag_list);
ret = xnet_update_pollflag(ep, POLLIN, false);
if (ret)
return ret;

rx_entry = xnet_get_unexp_rx(ep, tag);
if (rx_entry)
return xnet_start_recv(ep, rx_entry);
}
return -FI_EAGAIN;
}
Expand Down
2 changes: 2 additions & 0 deletions prov/tcp/src/xnet_rdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,8 @@ static int xnet_init_rdm(struct xnet_rdm *rdm, struct fi_info *info)
msg_info->tx_attr->op_flags = info->tx_attr->op_flags;
msg_info->rx_attr->caps &= info->rx_attr->caps;
msg_info->rx_attr->op_flags = info->rx_attr->op_flags;
if (info->ep_attr)
msg_info->ep_attr->mem_tag_format = info->ep_attr->mem_tag_format;

ret = fi_srx_context(&rdm->util_ep.domain->domain_fid, info->rx_attr,
&srx, rdm);
Expand Down

0 comments on commit 1e6d785

Please sign in to comment.