Skip to content

Commit

Permalink
prov/efa: Delegate iovec offset calc to utility function
Browse files Browse the repository at this point in the history
This should correctly point the IOV base pointer to the start of the
data buffer in prefix mode. This accommodates non-contiguous iovec
entries where iov[0] is the prefix and iov[1] points the data buffer, as
well as the previously-supported behavior of a single iovec entry where
the buffer has ample space for the prefix and user data.

Signed-off-by: Darryl Abbate <[email protected]>
  • Loading branch information
darrylabbate authored and shijin-aws committed Apr 15, 2024
1 parent 0bb72fd commit 14aa24e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions prov/efa/src/rdm/efa_rdm_ope.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ void efa_rdm_txe_construct(struct efa_rdm_ope *txe,
txe->cq_entry.len = ofi_total_iov_len(txe->iov, txe->iov_count);
txe->cq_entry.buf = OFI_LIKELY(txe->cq_entry.len > 0) ? txe->iov[0].iov_base : NULL;

if (ep->msg_prefix_size > 0) {
assert(txe->iov[0].iov_len >= ep->msg_prefix_size);
txe->iov[0].iov_base = (char *)txe->iov[0].iov_base + ep->msg_prefix_size;
txe->iov[0].iov_len -= ep->msg_prefix_size;
if (ep->user_info->mode & FI_MSG_PREFIX) {
ofi_consume_iov(txe->iov, &txe->iov_count, ep->msg_prefix_size);
}
txe->total_len = ofi_total_iov_len(txe->iov, txe->iov_count);

Expand Down

0 comments on commit 14aa24e

Please sign in to comment.