-
Notifications
You must be signed in to change notification settings - Fork 593
UCT/IB/MLX5: support in progress error handler #11829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b27def8
0a8d5c3
38e997a
4107de3
6e05659
e428402
41e17cd
9c4afd0
a34966e
b01ffa0
a80d584
529fceb
220b9e0
95d6161
04896be
1232be4
1ba4778
7ae7ad8
55b6fd9
c4be7ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1931,31 +1931,36 @@ uct_rc_mlx5_iface_common_atomic_data(unsigned opcode, unsigned size, uint64_t va | |
| } | ||
|
|
||
| static UCS_F_ALWAYS_INLINE void | ||
| uct_rc_mlx5_iface_update_tx_res(uct_rc_iface_t *rc_iface, | ||
| uct_rc_mlx5_base_ep_t *rc_mlx5_base_ep, | ||
| uint16_t hw_ci) | ||
| uct_rc_mlx5_iface_update_tx_cq_res(uct_rc_iface_t *rc_iface, | ||
| uct_rc_mlx5_base_ep_t *ep, uint16_t hw_ci) | ||
| { | ||
| uct_ib_mlx5_txwq_t *txwq = &rc_mlx5_base_ep->tx.wq; | ||
| uct_rc_txqp_t *txqp = &rc_mlx5_base_ep->super.txqp; | ||
| uint16_t bb_num; | ||
|
|
||
| bb_num = uct_ib_mlx5_txwq_update_bb(txwq, hw_ci) - | ||
| uct_rc_txqp_available(txqp); | ||
|
|
||
| /* Must always have positive number of released resources. The first | ||
| * completion will report bb_num=1 (because prev_sw_pi is initialized to -1) | ||
| * and all the rest report the amount of BBs the previous WQE has consumed. | ||
| */ | ||
| ucs_assertv(bb_num > 0, "hw_ci=%d prev_sw_pi=%d available=%d bb_num=%d", | ||
| hw_ci, txwq->prev_sw_pi, txqp->available, bb_num); | ||
| uct_ib_mlx5_txwq_t *txwq = &ep->tx.wq; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switch from the uint16_t bb_num = hw_ci - prev_hw_ci;
ucs_assertv(bb_num > 0, ...);
txwq->hw_ci = hw_ci;The previous
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's strict monotonicity. HW should not generates 2 cqes for 1 wqe. |
||
| uint16_t prev_hw_ci = txwq->hw_ci; | ||
| uint16_t bb_num = hw_ci - prev_hw_ci; | ||
|
|
||
| uct_rc_txqp_available_add(txqp, bb_num); | ||
| ucs_assert(uct_rc_txqp_available(txqp) <= txwq->bb_max); | ||
| ucs_assertv(bb_num > 0, "hw_ci=%d prev_hw_ci=%d ft_ci=%d bb_num=%d", hw_ci, | ||
| prev_hw_ci, txwq->ft_ci, bb_num); | ||
|
|
||
| txwq->hw_ci = hw_ci; | ||
| uct_rc_iface_update_reads(rc_iface); | ||
| uct_rc_iface_add_cq_credits(rc_iface, bb_num); | ||
| } | ||
|
|
||
| static UCS_F_ALWAYS_INLINE void | ||
| uct_rc_mlx5_ep_update_tx_qp_res(uct_rc_mlx5_base_ep_t *ep, uint16_t sw_ci) | ||
| { | ||
| uct_ib_mlx5_txwq_t *txwq = &ep->tx.wq; | ||
| uct_rc_txqp_t *txqp = &ep->super.txqp; | ||
| int16_t prev_available = uct_rc_txqp_available(txqp); | ||
| uint16_t available = txwq->bb_max - | ||
| (txwq->prev_sw_pi - sw_ci); | ||
|
|
||
| ucs_assert(available >= prev_available); | ||
| uct_rc_txqp_available_add(txqp, available - prev_available); | ||
|
|
||
| ucs_assert(uct_rc_txqp_available(txqp) <= txwq->bb_max); | ||
| } | ||
|
|
||
| static UCS_F_ALWAYS_INLINE unsigned | ||
| uct_rc_mlx5_iface_poll_tx(uct_rc_mlx5_iface_common_t *iface, int poll_flags) | ||
| { | ||
|
|
@@ -1986,7 +1991,8 @@ uct_rc_mlx5_iface_poll_tx(uct_rc_mlx5_iface_common_t *iface, int poll_flags) | |
|
|
||
| uct_rc_mlx5_txqp_process_tx_cqe(&ep->super.txqp, cqe, hw_ci); | ||
| ucs_arbiter_group_schedule(&iface->super.tx.arbiter, &ep->super.arb_group); | ||
| uct_rc_mlx5_iface_update_tx_res(&iface->super, ep, hw_ci); | ||
| uct_rc_mlx5_ep_update_tx_qp_res(ep, hw_ci); | ||
| uct_rc_mlx5_iface_update_tx_cq_res(&iface->super, ep, hw_ci); | ||
| uct_rc_iface_arbiter_dispatch(&iface->super); | ||
| uct_ib_mlx5_update_db_cq_ci(&iface->cq[UCT_IB_DIR_TX]); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using
uint8_t err_handler_inprogress;instead ofbool.boolis not used elsewhere in the IB ep/iface structs, and the initializerself->err_handler_inprogress = 0;assigns an integer rather thanfalse;uint8_tmatches the existing convention (e.g.uct_rc_ep_t::flags). Not blocking.