Page MenuHomeFreeBSD

tcp: improve the condition for detecting duplicate ACKs
ClosedPublic

Authored by tuexen on Jul 19 2025, 6:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 12:52 AM
Unknown Object (File)
Mon, Oct 13, 12:52 AM
Unknown Object (File)
Mon, Oct 13, 12:52 AM
Unknown Object (File)
Mon, Oct 13, 12:52 AM
Unknown Object (File)
Mon, Oct 13, 12:52 AM
Unknown Object (File)
Mon, Oct 13, 12:52 AM
Unknown Object (File)
Sun, Oct 12, 1:17 PM
Unknown Object (File)
Wed, Sep 17, 7:09 AM

Details

Summary

Take the condition of RFC 6675 into account. While there, remove stale comments.

Test Plan

Will provide some packetdrill tests.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netinet/tcp_input.c
2611–2612

Can wrap these two lines into a single line now.

2685–2686

Can wrap these two lines into a single line now.

2723–2725

Looks like dead code to me, as here should be "th->th_ack == tp->snd_una".

2806

* counter as per RFC 6675. The variable <== one extra space

I think a better read can be:
* t_dupacks as per RFC 6675. The variable

Address comments from cc@ and add a condition as discussed with rscheff@.

tuexen marked an inline comment as done.

Thanks for the following improvements:

  1. put the checks of "non-DUP-ACK" first
  2. remove one tab indent
  3. remove some dead code and the resume_partialack label
  4. clear comments between line# [2597, 2633]
  5. make sure advancing ACKs are counted as DUP-ACKs under the V_tcp_do_newsack toggle

Some minor clean-ups remain. I am good with this change.

sys/netinet/tcp_input.c
2797–2798

Do you mean this minor change for readability?

KASSERT(SEQ_GT(th->th_ack, tp->snd_una),
    ("%s: SEQ_LEQ(th_ack, snd_una)", __func__));
2802–2803

Can remove this extra KASSERT() now, as we have removed the resume_partialack label.

This revision is now accepted and ready to land.Aug 8 2025, 9:35 PM

Follow the last two suggestions from cc.

This revision now requires review to proceed.Aug 13 2025, 6:33 PM

Use the condition of RFC 6675 only if V_tcp_do_newsack is true.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 24 2025, 11:30 PM
This revision was automatically updated to reflect the committed changes.