Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/uct/ib/mlx5/rc/rc_mlx5_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ uct_rc_mlx5_base_ep_put_sgl_zcopy(uct_ep_h tl_ep, void * const *buffers,
struct mlx5_wqe_data_seg *dptr;
size_t wqe_size, i;
uint8_t fm_ce_se, fence_flag;
uint16_t sn, pi, res_count;
uint16_t pi, res_count;
uint64_t addr;
uct_rkey_t rkey;
void *curr;
Expand Down Expand Up @@ -283,12 +283,11 @@ uct_rc_mlx5_base_ep_put_sgl_zcopy(uct_ep_h tl_ep, void * const *buffers,
UCS_ERR_NO_RESOURCE, count - 1);

wqe_size = sizeof(*ctrl) + sizeof(*raddr) + sizeof(*dptr);
sn = txwq->sw_pi;
pi = txwq->sw_pi;

ucs_assert(!(txwq->flags & UCT_IB_MLX5_TXWQ_FLAG_FAILED));
ucs_assert(ucs_div_round_up(wqe_size, MLX5_SEND_WQE_BB) == 1);

pi = sn;
curr = txwq->curr;

fence = uct_rc_ep_fm(&iface->super, &txwq->fi, 1);
Expand Down Expand Up @@ -335,8 +334,9 @@ uct_rc_mlx5_base_ep_put_sgl_zcopy(uct_ep_h tl_ep, void * const *buffers,
uct_rc_mlx5_txwq_add_psn(txwq, IBV_QPT_RC, num_packets);

uct_rc_txqp_add_send_comp(&iface->super, &ep->super.txqp,
uct_rc_ep_send_op_completion_handler, comp, sn,
UCT_RC_IFACE_SEND_OP_FLAG_ZCOPY, NULL, 0, total);
uct_rc_ep_send_op_completion_handler, comp,
txwq->sig_pi, UCT_RC_IFACE_SEND_OP_FLAG_ZCOPY,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change 1 — sn → txwq->sig_pi in uct_rc_txqp_add_send_comp: Correct and an improvement. Only the last WQE in the batch carries MLX5_WQE_CTRL_CQ_UPDATE, and its completion reports hw_ci = ntohs(cqe->wqe_counter) equal to that WQE's first BB index (prev_sw_pi after the loop). txwq->sig_pi is set to exactly txwq->prev_sw_pi, so UCS_CIRCULAR_COMPARE16(sig_pi, <=, hw_ci) matches on the right CQE. This aligns the SGL path with the signaled-PI convention used by uct_rc_mlx5_common_post_send, _flush, and _post_check. Removing the now-unused sn local is clean.

NULL, 0, total);

UCT_TL_EP_STAT_OP(&ep->super.super, PUT, ZCOPY, total);
uct_rc_ep_enable_flush_remote(&ep->super);
Expand Down