Skip to content

Commit 3a8e9ba

Browse files
committed
UCT/DEVICE: add db index
1 parent 5c4e8f1 commit 3a8e9ba

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
@@ -268,20 +268,12 @@ UCS_F_DEVICE void uct_rc_mlx5_gda_db(uct_rc_gdaki_dev_ep_t *ep,
268268
wqe_base = wqe_base_orig;
269269
}
270270

271-
if (no_delay) {
271+
if ((no_delay && READ_ONCE(ep->sq_ready_index) == wqe_next) ||
272+
(!no_delay && ((wqe_base ^ wqe_next) & 128))) {
272273
uct_rc_mlx5_gda_lock(&ep->sq_lock);
273274
const uint64_t ready_index = ep->sq_ready_index;
274-
uct_rc_mlx5_gda_ring_db(ep, ready_index);
275-
uct_rc_mlx5_gda_update_dbr(ep, ready_index);
276-
uct_rc_mlx5_gda_ring_db(ep, ready_index);
277-
uct_rc_mlx5_gda_unlock(&ep->sq_lock);
278-
return;
279-
}
280-
281-
if (READ_ONCE(ep->sq_ready_index) == wqe_next) {
282-
uct_rc_mlx5_gda_lock(&ep->sq_lock);
283-
const uint64_t ready_index = ep->sq_ready_index;
284-
if (ready_index == wqe_next) {
275+
if (ep->sq_db_index != ready_index) {
276+
ep->sq_db_index = ready_index;
285277
uct_rc_mlx5_gda_ring_db(ep, ready_index);
286278
uct_rc_mlx5_gda_update_dbr(ep, ready_index);
287279
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
int sq_lock;
2324

2425
uint8_t *sq_wqe_daddr;

0 commit comments

Comments
 (0)