The first step in doing a TCP stack switch is calling the tfb_tcp_handoff_ok() function. If a stack switch is not allowed, an error code is returned, which is then returned to the caller of tcp_ctloutput_set().
In case tcp_ctloutput_set() is called via the sysctl_setsockopt() code path (for example by using tcpsso) and the error code is EAGAIN or EWOULDBLOCK, this results in a loop in userland_sysctl() until the returned error code changes.
To avoid this, don't use EAGAIN or EWOULDBLOCK in the tfb_tcp_handoff_ok() function for the RACK and BBR stack. Also document this tfb_tcp_handoff_ok() should not return EAGAIN or EWOULDBLOCK in the tcp_functions.9 man-page.
Details
Details
- Reviewers
timo.voelker_fh-muenster.de glebius rrs nickbanks_netflix.com lstewart - Group Reviewers
transport
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
An alternative approach would be to change int (*tfb_tcp_handoff_ok)(struct tcpcb *) to bool (*tfb_tcp_handoff_ok)(struct tcpcb *) and let the caller map false to EINVAL. Would that be clearer? That would also allow the compiler to catch the change in TCP stacks other than BBR and RACK.