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, Nov 14, 2:27 AM
Unknown Object (File)
Fri, Nov 8, 7:58 AM
Unknown Object (File)
Tue, Nov 5, 8:06 AM
Unknown Object (File)
Tue, Oct 22, 5:17 AM
Unknown Object (File)
Tue, Oct 22, 5:17 AM
Unknown Object (File)
Tue, Oct 22, 5:04 AM
Unknown Object (File)
Oct 18 2024, 4:12 AM
Unknown Object (File)
Oct 16 2024, 2:49 AM
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...