Skip to content

Commit

Permalink
prov/efa: Fix efa_rdm_cq_wc_is_unsolicited check
Browse files Browse the repository at this point in the history
efadv_wc_is_unsolicited() can only be called when driver/FW
supports unsolicited write recv, in which we create IBV CQ
with EFADV_DEVICE_ATTR_CAPS_UNSOLICITED_WRITE_RECV. Otherwise
the function pointer will be a NULL and cause segfault.

Signed-off-by: Shi Jin <sjina@amazon.com>
  • Loading branch information
shijin-aws committed Jun 19, 2024
1 parent 79b6733 commit 34fa64b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prov/efa/src/rdm/efa_rdm_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static struct fi_ops efa_rdm_cq_fi_ops = {
static inline
bool efa_rdm_cq_wc_is_unsolicited(struct ibv_cq_ex *ibv_cq_ex)
{
return efadv_wc_is_unsolicited(efadv_cq_from_ibv_cq_ex(ibv_cq_ex));
return efa_device_support_unsolicited_write_recv() ? efadv_wc_is_unsolicited(efadv_cq_from_ibv_cq_ex(ibv_cq_ex)) : false;
}

#else
Expand Down

0 comments on commit 34fa64b

Please sign in to comment.