Skip to content

Commit abd798f

Browse files
committed
UCT/DEVICE: add db index
1 parent 2fe74a4 commit abd798f

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/uct/ib/mlx5/gdaki/gdaki.cuh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,12 @@ UCS_F_DEVICE void uct_rc_mlx5_gda_db(uct_rc_gdaki_dev_ep_t *ep,
198198
wqe_base = wqe_base_orig;
199199
}
200200

201-
if (no_delay) {
201+
if ((no_delay && READ_ONCE(ep->sq_ready_index) == wqe_next) ||
202+
(!no_delay && ((wqe_base ^ wqe_next) & 128))) {
202203
uct_rc_mlx5_gda_lock(&ep->sq_lock);
203204
const uint64_t ready_index = ep->sq_ready_index;
204-
uct_rc_mlx5_gda_ring_db(ep, ready_index);
205-
uct_rc_mlx5_gda_update_dbr(ep, ready_index);
206-
uct_rc_mlx5_gda_ring_db(ep, ready_index);
207-
uct_rc_mlx5_gda_unlock(&ep->sq_lock);
208-
return;
209-
}
210-
211-
if (READ_ONCE(ep->sq_ready_index) == wqe_next) {
212-
uct_rc_mlx5_gda_lock(&ep->sq_lock);
213-
const uint64_t ready_index = ep->sq_ready_index;
214-
if (ready_index == wqe_next) {
205+
if (ep->sq_db_index != ready_index) {
206+
ep->sq_db_index = ready_index;
215207
uct_rc_mlx5_gda_ring_db(ep, ready_index);
216208
uct_rc_mlx5_gda_update_dbr(ep, ready_index);
217209
uct_rc_mlx5_gda_ring_db(ep, ready_index);

src/uct/ib/mlx5/gdaki/gdaki_dev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ typedef struct {
1919

2020
uint64_t sq_rsvd_index;
2121
uint64_t sq_ready_index;
22+
uint64_t sq_db_index;
2223
uint64_t sq_wqe_pi;
2324
uint64_t cqe_ci;
2425
int sq_lock;

0 commit comments

Comments
 (0)