Skip to content

Commit

Permalink
prov/efa: Cleanup the queued entry removal procedure.
Browse files Browse the repository at this point in the history
With a single ope_queued_list, we can remove queued_entry
from the list equipotentially by checking if ope has
any queued flags.
  • Loading branch information
shijin-aws committed Jun 26, 2024
1 parent e413982 commit 69c0ec3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
37 changes: 12 additions & 25 deletions prov/efa/src/rdm/efa_rdm_ope.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ void efa_rdm_txe_release(struct efa_rdm_ope *txe)
efa_rdm_pke_release_tx(pkt_entry);
}

if (txe->internal_flags & EFA_RDM_OPE_QUEUED_RNR)
dlist_remove(&txe->queued_entry);

if (txe->internal_flags & EFA_RDM_OPE_QUEUED_CTRL)
if (txe->internal_flags & EFA_RDM_OPE_QUEUED_FLAGS)
dlist_remove(&txe->queued_entry);

#ifdef ENABLE_EFA_POISONING
Expand Down Expand Up @@ -172,16 +169,12 @@ void efa_rdm_rxe_release_internal(struct efa_rdm_ope *rxe)
}
}

if (!dlist_empty(&rxe->queued_pkts)) {
dlist_foreach_container_safe(&rxe->queued_pkts,
struct efa_rdm_pke,
pkt_entry, entry, tmp) {
efa_rdm_pke_release_tx(pkt_entry);
}
dlist_remove(&rxe->queued_entry);
}
dlist_foreach_container_safe(&rxe->queued_pkts,
struct efa_rdm_pke,
pkt_entry, entry, tmp)
efa_rdm_pke_release_tx(pkt_entry);

if (rxe->internal_flags & EFA_RDM_OPE_QUEUED_CTRL)
if (rxe->internal_flags & EFA_RDM_OPE_QUEUED_FLAGS)
dlist_remove(&rxe->queued_entry);

#ifdef ENABLE_EFA_POISONING
Expand Down Expand Up @@ -584,15 +577,12 @@ void efa_rdm_rxe_handle_error(struct efa_rdm_ope *rxe, int err, int prov_errno)
assert(0 && "rxe unknown state");
}

if (rxe->internal_flags & EFA_RDM_OPE_QUEUED_RNR) {
dlist_foreach_container_safe(&rxe->queued_pkts,
struct efa_rdm_pke,
pkt_entry, entry, tmp)
efa_rdm_pke_release_tx(pkt_entry);
dlist_remove(&rxe->queued_entry);
}
dlist_foreach_container_safe(&rxe->queued_pkts,
struct efa_rdm_pke,
pkt_entry, entry, tmp)
efa_rdm_pke_release_tx(pkt_entry);

if (rxe->internal_flags & EFA_RDM_OPE_QUEUED_CTRL)
if (rxe->internal_flags & EFA_RDM_OPE_QUEUED_FLAGS)
dlist_remove(&rxe->queued_entry);

if (rxe->unexp_pkt) {
Expand Down Expand Up @@ -685,10 +675,7 @@ void efa_rdm_txe_handle_error(struct efa_rdm_ope *txe, int err, int prov_errno)
assert(0 && "txe unknown state");
}

if (txe->internal_flags & EFA_RDM_OPE_QUEUED_RNR)
dlist_remove(&txe->queued_entry);

if (txe->internal_flags & EFA_RDM_OPE_QUEUED_CTRL)
if (txe->internal_flags & EFA_RDM_OPE_QUEUED_FLAGS)
dlist_remove(&txe->queued_entry);

dlist_foreach_container_safe(&txe->queued_pkts,
Expand Down
2 changes: 2 additions & 0 deletions prov/efa/src/rdm/efa_rdm_ope.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ void efa_rdm_rxe_release_internal(struct efa_rdm_ope *rxe);
*/
#define EFA_RDM_OPE_QUEUED_BEFORE_HANDSHAKE BIT_ULL(14)

#define EFA_RDM_OPE_QUEUED_FLAGS (EFA_RDM_OPE_QUEUED_RNR | EFA_RDM_OPE_QUEUED_CTRL | EFA_RDM_OPE_QUEUED_READ | EFA_RDM_OPE_QUEUED_BEFORE_HANDSHAKE)

void efa_rdm_ope_try_fill_desc(struct efa_rdm_ope *ope, int mr_iov_start, uint64_t access);

int efa_rdm_txe_prepare_to_be_read(struct efa_rdm_ope *txe,
Expand Down

0 comments on commit 69c0ec3

Please sign in to comment.