Skip to content

Commit 199f780

Browse files
dkkranzshijin-aws
authored andcommitted
prov/efa: Verify QP number on CQE process
When accessing the QP table with the masked QP number from the CQE, need to make sure the QP number still matches. Otherwise, the QP for which the work request had been completed was destroyed, and its table entry was subsequently re-occupied by another QP. Signed-off-by: Daniel Kranzdorf <dkkranzd@amazon.com>
1 parent b56ea5b commit 199f780

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prov/efa/src/efa_data_path_direct_entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static inline int efa_data_path_direct_start_poll(struct efa_ibv_cq *ibv_cq,
157157
data_path_direct->cur_qp =
158158
efa_domain->qp_table[qpn & efa_domain->qp_table_sz_m1];
159159

160-
if (!data_path_direct->cur_qp) {
160+
if (!data_path_direct->cur_qp || qpn != data_path_direct->cur_qp->qp_num) {
161161
data_path_direct->cur_wq = NULL;
162162
EFA_DBG(FI_LOG_CQ, "QP[%u] does not exist in QP table\n", qpn);
163163
return EINVAL;

0 commit comments

Comments
 (0)