| 7751a6b5 | 07-Jul-2021 |
Andrew Gallatin <[email protected]> |
tcp: fix alternate stack build with LINT-NO{INET,INET6,IP}
When fixing another bug, I noticed that the alternate TCP stacks do not build when various combinations of ipv4 and ipv6 are disabled.
Rev
tcp: fix alternate stack build with LINT-NO{INET,INET6,IP}
When fixing another bug, I noticed that the alternate TCP stacks do not build when various combinations of ipv4 and ipv6 are disabled.
Reviewed by: rrs, tuexen Differential Revision: https://reviews.freebsd.org/D31094 Sponsored by: Netflix
(cherry picked from commit b1e806c0ed960e1eb9ee889c7d0df3c168290c4f)
show more ...
|
| deb3c279 | 06-Jul-2021 |
Randall Stewart <[email protected]> |
tcp: HPTS performance enhancements
HPTS drives both rack and bbr, and yet there have been many complaints about performance. This bit of work restructures hpts to help reduce CPU overhead. It does t
tcp: HPTS performance enhancements
HPTS drives both rack and bbr, and yet there have been many complaints about performance. This bit of work restructures hpts to help reduce CPU overhead. It does this by now instead of relying on the timer/callout to drive it instead use user return from a system call as well as lro flushes to drive hpts. The timer becomes a backstop that dynamically adjusts based on how "late" we are.
Reviewed by: tuexen, glebius Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D31083
(cherry picked from commit d7955cc0ffdf9fb58013245a6f181c757574ea0a)
show more ...
|
| 3b2aeae7 | 06-Jul-2021 |
Randall Stewart <[email protected]> |
tcp: Address goodput and TLP edge cases.
There are several cases where we make a goodput measurement and we are running out of data when we decide to make the measurement. In reality we should not m
tcp: Address goodput and TLP edge cases.
There are several cases where we make a goodput measurement and we are running out of data when we decide to make the measurement. In reality we should not make such a measurement if there is no chance we can have "enough" data. There is also some corner case TLP's that end up not registering as a TLP like they should, we fix this by pushing the doing_tlp setup to the actual timeout that knows it did a TLP. This makes it so we always have the appropriate flag on the sendmap indicating a TLP being done as well as count correctly so we make no more that two TLP's.
In addressing the goodput lets also add a "quality" metric that can be viewed via blackbox logs so that a casual observer does not have to figure out how good of a measurement it is. This is needed due to the fact that we may still make a measurement that is of a poorer quality as we run out of data but still have a minimal amount of data to make a measurement.
Reviewed by: tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D31076
(cherry picked from commit e834f9a44acc577e658f40023d9465e887c94920)
show more ...
|
| 2e1fdc72 | 25-Jun-2021 |
Randall Stewart <[email protected]> |
tcp: Preparation for allowing hardware TLS to be able to kick a tcp connection that is retransmitting too much out of hardware and back to software.
Hardware TLS is now supported in some interface c
tcp: Preparation for allowing hardware TLS to be able to kick a tcp connection that is retransmitting too much out of hardware and back to software.
Hardware TLS is now supported in some interface cards and it works well. Except that when we have connections that retransmit a lot we get into trouble with all the retransmits. This prep step makes way for change that Drew will be making so that we can "kick out" a session from hardware TLS.
Reviewed by: tuexen, gallatin Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30895
(cherry picked from commit 9e4d9e4c4d79db58740a05d67645351e640aa32c)
show more ...
|
| d0eaf95e | 11-Jun-2021 |
Randall Stewart <[email protected]> |
tcp: Missing mfree in rack and bbr
Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and then not including a timestamp. This involved in the input path doing a got
tcp: Missing mfree in rack and bbr
Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and then not including a timestamp. This involved in the input path doing a goto done_with_input label. Now I suspect the code was cribbed from one in Rack that has to do with the SYN. This had a bug, i.e. it should have a m_freem(m) before going to the label (bbr had this missing m_freem() but rack did not). This then caused the missing m_freem to show up in both BBR and Rack. Also looking at the code referencing m->m_pkthdr.lro_nsegs later (after processing) is not a good idea, even though its only for logging. Best to copy that off before any frees can take place.
Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30727
(cherry picked from commit ba1b3e48f5be320f0590bc357ea53fdc3e4edc65)
show more ...
|
| fce16041 | 11-Jun-2021 |
Michael Tuexen <[email protected]> |
tcp: remove debug output from RACK
Reported by: [email protected], Marek Zarychta Reviewed by: rrs PR: 256538 Differential Revision: https://reviews.freebsd.org/D30723 Sponsored by: Netflix,
tcp: remove debug output from RACK
Reported by: [email protected], Marek Zarychta Reviewed by: rrs PR: 256538 Differential Revision: https://reviews.freebsd.org/D30723 Sponsored by: Netflix, Inc.
(cherry picked from commit f1536bb53898b12e2d19938f8fe2d04b5e5d12a6)
show more ...
|
| 71b88ee3 | 24-May-2021 |
Michael Tuexen <[email protected]> |
tcp: fix a RACK socket buffer lock issue
Fix a missing socket buffer unlocking of the socket receive buffer.
Reviewed by: gallatin, rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential
tcp: fix a RACK socket buffer lock issue
Fix a missing socket buffer unlocking of the socket receive buffer.
Reviewed by: gallatin, rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30402
(cherry picked from commit 9bbd1a8fcb13928cd4b6cfddf0a8359d5dc97451)
show more ...
|
| 0230e6cf | 21-May-2021 |
Richard Scheffenegger <[email protected]> |
rack: honor prior socket buffer lock when doing the upcall
While partially reverting D24237 with D29690, due to introducing some unintended effects for in-kernel TCP consumers, the preexisting lock
rack: honor prior socket buffer lock when doing the upcall
While partially reverting D24237 with D29690, due to introducing some unintended effects for in-kernel TCP consumers, the preexisting lock on the socket send buffer was not considered properly.
Found by: markj MFC after: 2 weeks Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D30390
(cherry picked from commit 39756885633fd9d9649b4cb0f0abf594bfeb8dbb)
show more ...
|
| 55cc0a47 | 21-May-2021 |
Richard Scheffenegger <[email protected]> |
[tcp] Keep socket buffer locked until upcall
r367492 would unlock the socket buffer before eventually calling the upcall. This leads to problematic interaction with NFS kernel server/client componen
[tcp] Keep socket buffer locked until upcall
r367492 would unlock the socket buffer before eventually calling the upcall. This leads to problematic interaction with NFS kernel server/client components (MP threads) accessing the socket buffer with potentially not correctly updated state.
Reported by: rmacklem Reviewed By: tuexen, #transport Tested by: rmacklem, otis MFC after: 2 weeks Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29690
(cherry picked from commit 032bf749fd44ac5ff20aab2c3d8e3c05491778ea)
show more ...
|
| fc53b726 | 04-Jun-2021 |
Randall Stewart <[email protected]> |
tcp: A better fix for the previously attempted fix of the ack-war issue with tcp.
So it turns out that my fix before was not correct. It ended with us failing some of the "improved" SYN tests, since
tcp: A better fix for the previously attempted fix of the ack-war issue with tcp.
So it turns out that my fix before was not correct. It ended with us failing some of the "improved" SYN tests, since we are not in the correct states. With more digging I have figured out the root of the problem is that when we receive a SYN|FIN the reassembly code made it so we create a segq entry to hold the FIN. In the established state where we were not in order this would be correct i.e. a 0 len with a FIN would need to be accepted. But if you are in a front state we need to strip the FIN so we correctly handle the ACK but ignore the FIN. This gets us into the proper states and avoids the previous ack war.
I back out some of the previous changes but then add a new change here in tcp_reass() that fixes the root cause of the issue. We still leave the rack panic fixes in place however.
Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30627
(cherry picked from commit 4747500deaaa7765ba1c0413197c23ddba4faf49)
show more ...
|
| eb91abb4 | 27-May-2021 |
Randall Stewart <[email protected]> |
tcp: When we have an out-of-order FIN we do want to strip off the FIN bit.
The last set of commits fixed both a panic (in rack) and an ACK-war (in freebsd and bbr). However there was a missing case,
tcp: When we have an out-of-order FIN we do want to strip off the FIN bit.
The last set of commits fixed both a panic (in rack) and an ACK-war (in freebsd and bbr). However there was a missing case, i.e. where we get an out-of-order FIN by itself. In such a case we don't want to leave the FIN bit set, otherwise we will do the wrong thing and ack the FIN incorrectly. Instead we need to go through the tcp_reasm() code and that way the FIN will be stripped and all will be well.
Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30497
(cherry picked from commit 8c69d988a8d32e53310c7b73ec8721b04b7249e6)
show more ...
|
| 362f95f5 | 26-May-2021 |
Randall Stewart <[email protected]> |
tcp: Add a socket option to rack so we can test various changes to the slop value in timers.
Timer_slop, in TCP, has been 200ms for a long time. This value dates back a long time when delayed ack ti
tcp: Add a socket option to rack so we can test various changes to the slop value in timers.
Timer_slop, in TCP, has been 200ms for a long time. This value dates back a long time when delayed ack timers were longer and links were slower. A 200ms timer slop allows 1 MSS to be sent over a 60kbps link. Its possible that lowering this value to something more in line with todays delayed ack values (40ms) might improve TCP. This bit of code makes it so rack can, via a socket option, adjust the timer slop.
Reviewed by: mtuexen Sponsered by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30249
(cherry picked from commit 4f3addd94be5e02e6e425f6119f5409972ab5d14)
show more ...
|
| 12e181b6 | 25-May-2021 |
Randall Stewart <[email protected]> |
tcp: Fix bugs related to the PUSH bit and rack and an ack war
Michaels testing with UDP tunneling found an issue with the push bit, which was only partly fixed in the last commit. The problem is the
tcp: Fix bugs related to the PUSH bit and rack and an ack war
Michaels testing with UDP tunneling found an issue with the push bit, which was only partly fixed in the last commit. The problem is the left edge gets transmitted before the adjustments are done to the send_map, this means that right edge bits must be considered to be added only if the entire RSM is being retransmitted.
Now syzkaller also continued to find a crash, which Michael sent me the reproducer for. Turns out that the reproducer on default (freebsd) stack made the stack get into an ack-war with itself. After fixing the reference issues in rack the same ack-war was found in rack (and bbr). Basically what happens is we go into the reassembly code and lose the FIN bit. The trick here is we should not be going into the reassembly code if tlen == 0 i.e. the peer never sent you anything. That then gets the proper action on the FIN bit but then you end up in LAST_ACK with no timers running. This is because the usrclosed function gets called and the FIN's and such have already been exchanged. So when we should be entering FIN_WAIT2 (or even FIN_WAIT1) we get stuck in LAST_ACK. Fixing this means tweaking the usrclosed function so that we properly recognize the condition and drop into FIN_WAIT2 where a timer will allow at least TP_MAXIDLE before closing (to allow time for the peer to retransmit its FIN if the ack is lost). Setting the fast_finwait2 timer can speed this up in testing.
Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30451
(cherry picked from commit 13c0e198ca275447f9a60a03f730c38c98f19009)
show more ...
|
| e99fa57b | 24-May-2021 |
Randall Stewart <[email protected]> |
tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's
The push bit itself was also not actually being properly moved to the right edge. The FIN bit was incorrectly
tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's
The push bit itself was also not actually being properly moved to the right edge. The FIN bit was incorrectly on the left edge. We fix these two issues as well as plumb in the mtu_change for alternate stacks.
Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30413
(cherry picked from commit 631449d5d03506295eaa6947c1b0e8a168a2f6b7)
show more ...
|
| 6264ff9b | 22-May-2021 |
Michael Tuexen <[email protected]> |
tcp: Handle stack switch while processing socket options
Handle the case where during socket option processing, the user switches a stack such that processing the stack specific socket option does n
tcp: Handle stack switch while processing socket options
Handle the case where during socket option processing, the user switches a stack such that processing the stack specific socket option does not make sense anymore. Return an error in this case.
Reviewed by: markj Reported by: [email protected] Sponsored by: Netflix, Inc. Differential revision: https://reviews.freebsd.org/D30395
(cherry picked from commit 8923ce630492d21ec57c2637757bcc44da9970f8)
show more ...
|
| 56aeedd2 | 21-May-2021 |
Michael Tuexen <[email protected]> |
tcp: Fix sending of TCP segments with IP level options
When bringing in TCP over UDP support in https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605, the length of IP lev
tcp: Fix sending of TCP segments with IP level options
When bringing in TCP over UDP support in https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605, the length of IP level options was considered when locating the transport header. This was incorrect and is fixed by this patch.
X-MFC with: https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605 Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30358
(cherry picked from commit 500eb6dd80404ea512e31a8f795c73cb802c9c64)
show more ...
|