Skip to content

Commit

Permalink
prov/efa: fix efa multi recv setopt segfault
Browse files Browse the repository at this point in the history
efa uses the util srx and sets the minimum multi receive size through
the srx. However, the srx code doesn't get initialized until the endpoint
gets enabled. So if the application calls setopt (before FI_ENABLE), this
will segfault because the srx has not been initialized. Instead, we need
to save the multi recv size in the efa endpoint to be valid during setopt
and then pass that into the util_srx creation to set the multi recv size

Signed-off-by: Alexia Ingerson <[email protected]>
  • Loading branch information
aingerson committed Dec 9, 2024
1 parent 8f6219b commit 7c09a5c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions prov/efa/src/rdm/efa_rdm_ep_fiops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,6 @@ static int efa_rdm_ep_setopt(fid_t fid, int level, int optname,
{
struct efa_rdm_ep *efa_rdm_ep;
int intval, ret;
struct util_srx_ctx *srx;

efa_rdm_ep = container_of(fid, struct efa_rdm_ep, base_ep.util_ep.ep_fid.fid);

Expand All @@ -1663,8 +1662,6 @@ static int efa_rdm_ep_setopt(fid_t fid, int level, int optname,
return -FI_EINVAL;

efa_rdm_ep->min_multi_recv_size = *(size_t *)optval;
srx = util_get_peer_srx(efa_rdm_ep->peer_srx_ep)->ep_fid.fid.context;
srx->min_multi_recv_size = *(size_t *)optval;
break;
case FI_OPT_EFA_RNR_RETRY:
if (optlen != sizeof(size_t))
Expand Down

0 comments on commit 7c09a5c

Please sign in to comment.