Skip to content

Commit

Permalink
net/tcp: add Rust implementation of CUBIC
Browse files Browse the repository at this point in the history
CUBIC is the default CCA since 2.6.18.

Missing features compared to the C implementation:
- configuration via module parameters,
- exporting callbacks to BPF programs as kfuncs.

Changes compared to the C implementation:
- uses only SI units for time, i.e., no jiffies and `BICTCP_HZ`,

Signed-off-by: Valentin Obst <kernel@valentinobst.de>
  • Loading branch information
Valentin Obst committed Mar 9, 2024
1 parent 67c08f7 commit 2253d8e
Show file tree
Hide file tree
Showing 3 changed files with 524 additions and 0 deletions.
13 changes: 13 additions & 0 deletions net/ipv4/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,15 @@ config TCP_CONG_CUBIC
among other techniques.
See http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/cubic-paper.pdf

config TCP_CONG_CUBIC_RUST
tristate "CUBIC TCP (Rust rewrite)"
depends on RUST_TCP_ABSTRACTIONS
help
Rust rewrite of the original implementation of TCP CUBIC congestion
control.

If unsure, say N.

config TCP_CONG_WESTWOOD
tristate "TCP Westwood+"
default m
Expand Down Expand Up @@ -719,6 +728,9 @@ choice
config DEFAULT_CUBIC
bool "Cubic" if TCP_CONG_CUBIC=y

config DEFAULT_CUBIC_RUST
bool "Cubic (Rust)" if TCP_CONG_CUBIC_RUST=y

config DEFAULT_HTCP
bool "Htcp" if TCP_CONG_HTCP=y

Expand Down Expand Up @@ -759,6 +771,7 @@ config DEFAULT_TCP_CONG
default "bic" if DEFAULT_BIC
default "bic_rust" if DEFAULT_BIC_RUST
default "cubic" if DEFAULT_CUBIC
default "cubic_rust" if DEFAULT_CUBIC_RUST
default "htcp" if DEFAULT_HTCP
default "hybla" if DEFAULT_HYBLA
default "vegas" if DEFAULT_VEGAS
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o
obj-$(CONFIG_TCP_CONG_BIC_RUST) += tcp_bic_rust.o
obj-$(CONFIG_TCP_CONG_CDG) += tcp_cdg.o
obj-$(CONFIG_TCP_CONG_CUBIC) += tcp_cubic.o
obj-$(CONFIG_TCP_CONG_CUBIC_RUST) += tcp_cubic_rust.o
obj-$(CONFIG_TCP_CONG_DCTCP) += tcp_dctcp.o
obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o
obj-$(CONFIG_TCP_CONG_HSTCP) += tcp_highspeed.o
Expand Down
Loading

0 comments on commit 2253d8e

Please sign in to comment.