Skip to content

Commit a712778

Browse files
committed
UCT/DEVICE: add db index
1 parent 01a58e0 commit a712778

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
@@ -273,20 +273,12 @@ UCS_F_DEVICE void uct_rc_mlx5_gda_db(uct_rc_gdaki_dev_ep_t *ep,
273273
wqe_base = wqe_base_orig;
274274
}
275275

276-
if (no_delay) {
276+
if ((no_delay && READ_ONCE(ep->sq_ready_index) == wqe_next) ||
277+
(!no_delay && ((wqe_base ^ wqe_next) & 128))) {
277278
uct_rc_mlx5_gda_lock(&ep->sq_lock);
278279
const uint64_t ready_index = ep->sq_ready_index;
279-
uct_rc_mlx5_gda_ring_db(ep, ready_index);
280-
uct_rc_mlx5_gda_update_dbr(ep, ready_index);
281-
uct_rc_mlx5_gda_ring_db(ep, ready_index);
282-
uct_rc_mlx5_gda_unlock(&ep->sq_lock);
283-
return;
284-
}
285-
286-
if (READ_ONCE(ep->sq_ready_index) == wqe_next) {
287-
uct_rc_mlx5_gda_lock(&ep->sq_lock);
288-
const uint64_t ready_index = ep->sq_ready_index;
289-
if (ready_index == wqe_next) {
280+
if (ep->sq_db_index != ready_index) {
281+
ep->sq_db_index = ready_index;
290282
uct_rc_mlx5_gda_ring_db(ep, ready_index);
291283
uct_rc_mlx5_gda_update_dbr(ep, ready_index);
292284
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)