Skip to content

Commit

Permalink
efa: Use mmio_memcpy_x64 when copying WQEs to the LLQ
Browse files Browse the repository at this point in the history
The send LLQ is backed up by MMIO memory, hence mmio_memcpy_x64 should
be used instead of memcpy to guarantee the order of the TLPs.

Signed-off-by: Gal Pressman <galpress@amazon.com>
  • Loading branch information
gal-pressman committed Aug 2, 2020
1 parent 4aafa3e commit b9ffd6e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions providers/efa/verbs.c
Expand Up @@ -1256,7 +1256,8 @@ int efa_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
/* Copy descriptor */
sq_desc_offset = (qp->sq.wq.pc & qp->sq.wq.desc_mask) *
sizeof(tx_wqe);
memcpy(qp->sq.desc + sq_desc_offset, &tx_wqe, sizeof(tx_wqe));
mmio_memcpy_x64(qp->sq.desc + sq_desc_offset, &tx_wqe,
sizeof(tx_wqe));

/* advance index and change phase */
efa_sq_advance_post_idx(qp);
Expand Down Expand Up @@ -1520,9 +1521,11 @@ static int efa_send_wr_complete(struct ibv_qp_ex *ibvqpx)
while (qp->sq.num_wqe_pending) {
num_wqe_to_copy = min(qp->sq.num_wqe_pending,
qp->sq.wq.wqe_cnt - sq_desc_idx);
memcpy((struct efa_io_tx_wqe *)qp->sq.desc + sq_desc_idx,
(struct efa_io_tx_wqe *)qp->sq.local_queue + local_idx,
num_wqe_to_copy * sizeof(struct efa_io_tx_wqe));
mmio_memcpy_x64((struct efa_io_tx_wqe *)qp->sq.desc +
sq_desc_idx,
(struct efa_io_tx_wqe *)qp->sq.local_queue +
local_idx,
num_wqe_to_copy * sizeof(struct efa_io_tx_wqe));

qp->sq.num_wqe_pending -= num_wqe_to_copy;
local_idx += num_wqe_to_copy;
Expand Down

0 comments on commit b9ffd6e

Please sign in to comment.