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)
Sun, Aug 24, 11:30 PM
Unknown Object (File)
Sun, Aug 24, 6:45 PM
Unknown Object (File)
Sat, Aug 23, 5:26 AM
Unknown Object (File)
Fri, Aug 22, 4:18 AM
Unknown Object (File)
Thu, Aug 21, 1:36 PM
Unknown Object (File)
Tue, Aug 19, 8:24 PM
Unknown Object (File)
Wed, Aug 13, 6:25 PM
Unknown Object (File)
Fri, Aug 8, 8:41 PM

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 Skipped
Unit
Tests Skipped

Event Timeline

sys/netinet/tcp_input.c
2624–2625

Can wrap these two lines into a single line now.

2698–2699

Can wrap these two lines into a single line now.

2736–2738

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

2824

* 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
2815–2816

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__));
2845–2846

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

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

Follow the last two suggestions from cc.

This revision now requires review to proceed.Wed, Aug 13, 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.Sun, Aug 24, 11:30 PM
This revision was automatically updated to reflect the committed changes.