Skip to content

Commit

Permalink
tlp: initialize tlp_permitted to false, and do not use packets alread…
Browse files Browse the repository at this point in the history
…y marked lost for probe (#205)

Co-authored-by: James Thomas <jthomas>
  • Loading branch information
jthomas43 authored Sep 24, 2024
1 parent 1b8b523 commit 92777aa
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/udx.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,22 +836,12 @@ udx__shift_packet (udx_socket_t *socket) {

debug_printf("tlp: retransmitting old data");

if (!pkt) {
if (!pkt || pkt->lost) {
debug_printf("... not available\n");
continue;
}
debug_printf("\n");

// we selected the packet with the highest sequence number to retransmit
// it may be in-flight already or it may be marked 'lost' (in the retransmit queue)
// if not inflight already, mark it inflight and adjust counters:

if (pkt->lost) {
udx__fifo_remove(&stream->retransmit_queue, pkt, pkt->fifo_gc);
stream->inflight += pkt->size;
stream->pkts_inflight++;
}

stream->tlp_is_retrans = true;
pkt->is_tlp = true;
return pkt;
Expand Down Expand Up @@ -1069,12 +1059,7 @@ udx__unshift_packet (udx_packet_t *pkt, udx_socket_t *socket) {

// packet came from retransmit queue, return it.
if (pkt->lost) {
if (!pkt->is_tlp) {
udx__fifo_undo(&stream->retransmit_queue);
} else {
// a tlp packet is not necessarily from the start of the retransmit queue
pkt->fifo_gc = udx__fifo_push(&stream->retransmit_queue, pkt);
}
udx__fifo_undo(&stream->retransmit_queue);
} else {
assert(pkt->transmits == 0);
// if the packet was the one that shifted a write, undo it
Expand Down Expand Up @@ -2241,6 +2226,7 @@ udx_stream_init (udx_t *udx, udx_stream_t *stream, uint32_t local_id, udx_stream
stream->tlp_in_flight = false;
stream->tlp_end_seq = 0;
stream->tlp_is_retrans = false;
stream->tlp_permitted = false;

memset(&stream->rack_reo_timer, 0, sizeof(uv_timer_t));
uv_timer_init(udx->loop, &stream->rack_reo_timer);
Expand Down

0 comments on commit 92777aa

Please sign in to comment.