Skip to content

Commit

Permalink
Cut-through: check for Q3 stall before writing to output link.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgiusti committed Oct 18, 2023
1 parent 7aa8077 commit 2e150fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,7 @@ static void qd_message_send_cut_through(qd_message_pvt_t *msg, qd_message_conten
{
const size_t q3_upper = QD_BUFFER_SIZE * QD_QLIMIT_Q3_UPPER;

*q3_stalled = !IS_ATOMIC_FLAG_SET(&content->aborted) && (pn_session_outgoing_bytes(pns) >= q3_upper);
while (!*q3_stalled && (sys_atomic_get(&content->uct_consume_slot) - sys_atomic_get(&content->uct_produce_slot)) % UCT_SLOT_COUNT != 0) {
uint32_t use_slot = sys_atomic_get(&content->uct_consume_slot);

Expand Down

0 comments on commit 2e150fc

Please sign in to comment.