HomeFreeBSD

tcp: TCP output method can request tcp_drop

Description

tcp: TCP output method can request tcp_drop

The advanced TCP stacks (bbr, rack) may decide to drop a TCP connection
when they do output on it. The default stack never does this, thus
existing framework expects tcp_output() always to return locked and
valid tcpcb.

Provide KPI extension to satisfy demands of advanced stacks. If the
output method returns negative error code, it means that caller must
call tcp_drop().

In tcp_var() provide three inline methods to call tcp_output():

  • tcp_output() is a drop-in replacement for the default stack, so that default stack can continue using it internally without modifications. For advanced stacks it would perform tcp_drop() and unlock and report that with negative error code.
  • tcp_output_unlock() handles the negative code and always converts it to positive and always unlocks.
  • tcp_output_nodrop() just calls the method and leaves the responsibility to drop on the caller.

Sweep over the advanced stacks and use new KPI instead of using HPTS
delayed drop queue for that.

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D33370

Details

Provenance
glebiusAuthored on Dec 26 2021, 4:48 PM
Reviewer
rrs
Differential Revision
D33370: tcp: TCP output method can request tcp_drop
Parents
rGdbbcc777de40: rack: rack_do_compressed_ack_processing() can call tcp_drop()
Branches
Unknown
Tags
Unknown