Page MenuHomeFreeBSD

tcp: remove IS_FASTOPEN() macro
ClosedPublic

Authored by glebius on Mar 14 2024, 7:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 11:19 PM
Unknown Object (File)
Sat, Apr 27, 5:31 AM
Unknown Object (File)
Tue, Apr 23, 2:50 AM
Unknown Object (File)
Apr 6 2024, 4:14 AM
Unknown Object (File)
Apr 6 2024, 1:53 AM
Unknown Object (File)
Mar 24 2024, 11:40 PM
Unknown Object (File)
Mar 24 2024, 11:40 PM
Unknown Object (File)
Mar 24 2024, 11:40 PM
Subscribers

Details

Summary

The macro is more obfuscating than helping as it just checks a single flag
of t_flags. All other t_flags bits are checked without a macro.

A bigger problem was that declaration of the macro in tcp_var.h depended
on a kernel option. It is a bad practice to create such definitions in
installable headers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56612
Build 53500: arc lint + arc unit

Event Timeline

rscheff added a subscriber: rscheff.

only minor whitespace nits. i'm ok with removing this macro mechanistically.

sys/netinet/tcp_output.c
244–245

why remove the newline here? I'd leave the individual check one per line, or concatenate the deeper bracketed OR together to a single line.
(minor nit-pick).

sys/netinet/tcp_stacks/rack.c
21952–21953

same.

22079

same.

This revision is now accepted and ready to land.Mar 14 2024, 8:15 PM

Add back new lines as Richard suggests.

This revision now requires review to proceed.Mar 14 2024, 8:41 PM
This revision is now accepted and ready to land.Mar 14 2024, 8:50 PM

I do not understand the change. You re-wrote the code as if the TCP_RFC7413 option is always set. This is not true, at least from the fast grepping of the sources.

In D44362#1011765, @kib wrote:

I do not understand the change. You re-wrote the code as if the TCP_RFC7413 option is always set. This is not true, at least from the fast grepping of the sources.

If kernel is compiled w/o the option, then t_flags & TF_FASTOPEN will always be false.

In D44362#1011765, @kib wrote:

I do not understand the change. You re-wrote the code as if the TCP_RFC7413 option is always set. This is not true, at least from the fast grepping of the sources.

But the t_flag will be zeroed in all instances where FASTOPEN is not used or compiled in, thus functionally equivalent to returning false (as the old macro returned for userspace, and when TCP_RFC7413 was not set...