litespeedtech / litespeedtech/lsquic

Is there a problem with the RTT calculation logic in send_ctl_acked_loss_chain?

Open
#596 1 comment 0 reactions 1 assignee View on GitHub

@dtikhonov is already working on this.

Since Dec 6, 2025.

Dominant language
C
Stars
1.9k
Forks
397
Avg merge
2d 22h
Merged PRs (30d)
8

Description

The origin code:

static void
send_ctl_acked_loss_chain (struct lsquic_send_ctl *ctl,
                        struct lsquic_packet_out *const packet_out,
                        struct lsquic_packet_out **next,
                        lsquic_packno_t largest_acked,
                        signed char *do_rtt)
{
    struct lsquic_packet_out *chain_cur, *chain_next;
    unsigned count;
    count = 0;
    for (chain_cur = packet_out->po_loss_chain; chain_cur != packet_out;
                                                    chain_cur = chain_next)
    {
        chain_next = chain_cur->po_loss_chain;
        if (chain_cur->po_packno == largest_acked)
            *do_rtt = 1;
        send_ctl_process_loss_chain_pkt(ctl, chain_cur, next);
        ++count;
    }
    packet_out->po_loss_chain = packet_out;

    if (count)
        LSQ_DEBUG("destroyed %u packet%.*s in chain of packet #%"PRIu64,
            count, count != 1, "s", packet_out->po_packno);
}

The fix code, when do_rtt, we should set sc_largest_acked_packno and sc_largest_acked_sent_time to the latest value

static void
send_ctl_acked_loss_chain (struct lsquic_send_ctl *ctl,
                        struct lsquic_packet_out *const packet_out,
                        struct lsquic_packet_out **next,
                        lsquic_packno_t largest_acked,
                        signed char *do_rtt)
{
    struct lsquic_packet_out *chain_cur, *chain_next;
    unsigned count;
    count = 0;
    for (chain_cur = packet_out->po_loss_chain; chain_cur != packet_out;
                                                    chain_cur = chain_next)
    {
        chain_next = chain_cur->po_loss_chain;
        if (chain_cur->po_packno == largest_acked) {
             // we should set sc_largest_acked_packno and sc_largest_acked_sent_time to the latest value
             ctl->sc_largest_acked_packno = chain_cur->po_packno;
             ctl->sc_largest_acked_sent_time = chain_cur->po_sent;
            *do_rtt = 1;
        }
        send_ctl_process_loss_chain_pkt(ctl, chain_cur, next);
        ++count;
    }
    packet_out->po_loss_chain = packet_out;

    if (count)
        LSQ_DEBUG("destroyed %u packet%.*s in chain of packet #%"PRIu64,
            count, count != 1, "s", packet_out->po_packno);
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.