1
0

release 6.15.2 (preliminary)

This commit is contained in:
2025-06-18 12:24:58 +03:00
parent 4d2691343a
commit 43dc655d2e
242 changed files with 7729 additions and 32303 deletions

View File

@@ -1,7 +1,7 @@
From 5435b92688a57d175607374d5bbff357e4ba3e71 Mon Sep 17 00:00:00 2001
From 1e164adec73236b05d5b84846a460082d3d211d2 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 11 Jun 2019 12:26:55 -0400
Subject: net-tcp_bbr: broaden app-limited rate sample detection
Subject: [PATCH 01/18] net-tcp_bbr: broaden app-limited rate sample detection
This commit is a bug fix for the Linux TCP app-limited
(application-limited) logic that is used for collecting rate
@@ -32,7 +32,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3983,6 +3983,7 @@ static int tcp_ack(struct sock *sk, cons
@@ -3994,6 +3994,7 @@ static int tcp_ack(struct sock *sk, cons
prior_fack = tcp_is_sack(tp) ? tcp_highest_sack_seq(tp) : tp->snd_una;
rs.prior_in_flight = tcp_packets_in_flight(tp);
@@ -42,10 +42,10 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
* is in window.
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -699,6 +699,7 @@ void tcp_write_timer_handler(struct sock
@@ -702,6 +702,7 @@ void tcp_write_timer_handler(struct sock
icsk_timeout(icsk));
return;
}
+ tcp_rate_check_app_limited(sk);
tcp_mstamp_refresh(tcp_sk(sk));
event = icsk->icsk_pending;

View File

@@ -1,7 +1,7 @@
From 9aa33a35b5b9cbe65c87e6f9438e69ede143d11a Mon Sep 17 00:00:00 2001
From e02830baf6c32aceea6c0dfe8a0a4b96db171418 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Sun, 24 Jun 2018 21:55:59 -0400
Subject: net-tcp_bbr: v2: shrink delivered_mstamp,
Subject: [PATCH 02/18] net-tcp_bbr: v2: shrink delivered_mstamp,
first_tx_mstamp to u32 to free up 8 bytes
Free up some space for tracking inflight and losses for each
@@ -25,7 +25,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -901,6 +901,11 @@ static inline u32 tcp_stamp_us_delta(u64
@@ -945,6 +945,11 @@ static inline u32 tcp_stamp_us_delta(u64
return max_t(s64, t1 - t0, 0);
}
@@ -37,7 +37,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
/* provide the departure time in us unit */
static inline u64 tcp_skb_timestamp_us(const struct sk_buff *skb)
{
@@ -990,9 +995,9 @@ struct tcp_skb_cb {
@@ -1043,9 +1048,9 @@ struct tcp_skb_cb {
/* pkts S/ACKed so far upon tx of skb, incl retrans: */
__u32 delivered;
/* start of send pipeline phase */

View File

@@ -1,7 +1,7 @@
From 63e1d064c4e4355293b9ee7014f4559cdeba4b8b Mon Sep 17 00:00:00 2001
From b39e9e473ed0446e4268cffb09f4a260cea7c341 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Sat, 5 Aug 2017 11:49:50 -0400
Subject: net-tcp_bbr: v2: snapshot packets in flight at transmit
Subject: [PATCH 03/18] net-tcp_bbr: v2: snapshot packets in flight at transmit
time and pass in rate_sample
CC algorithms may want to snapshot the number of packets in flight at
@@ -27,7 +27,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -998,6 +998,10 @@ struct tcp_skb_cb {
@@ -1051,6 +1051,10 @@ struct tcp_skb_cb {
u32 first_tx_mstamp;
/* when we reached the "delivered" count */
u32 delivered_mstamp;
@@ -38,7 +38,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
} tx; /* only used for outgoing skbs */
union {
struct inet_skb_parm h4;
@@ -1154,6 +1158,7 @@ struct rate_sample {
@@ -1207,6 +1211,7 @@ struct rate_sample {
u64 prior_mstamp; /* starting timestamp for interval */
u32 prior_delivered; /* tp->delivered at "prior_mstamp" */
u32 prior_delivered_ce;/* tp->delivered_ce at "prior_mstamp" */
@@ -46,7 +46,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
s32 delivered; /* number of packets delivered over interval */
s32 delivered_ce; /* number of packets delivered w/ CE marks*/
long interval_us; /* time for tp->delivered to incr "delivered" */
@@ -1276,6 +1281,7 @@ static inline void tcp_ca_event(struct s
@@ -1329,6 +1334,7 @@ static inline void tcp_ca_event(struct s
void tcp_set_ca_state(struct sock *sk, const u8 ca_state);
/* From tcp_rate.c */
@@ -56,7 +56,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
struct rate_sample *rs);
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2776,6 +2776,7 @@ static bool tcp_write_xmit(struct sock *
@@ -2777,6 +2777,7 @@ static bool tcp_write_xmit(struct sock *
skb_set_delivery_time(skb, tp->tcp_wstamp_ns, SKB_CLOCK_MONOTONIC);
list_move_tail(&skb->tcp_tsorted_anchor, &tp->tsorted_sent_queue);
tcp_init_tso_segs(skb, mss_now);

View File

@@ -1,7 +1,7 @@
From 4022fb6da58dd67760dc8f3351067945a377df91 Mon Sep 17 00:00:00 2001
From e4c82a08a05eeee9341511f35e922914520dd401 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Thu, 12 Oct 2017 23:44:27 -0400
Subject: net-tcp_bbr: v2: count packets lost over TCP rate
Subject: [PATCH 04/18] net-tcp_bbr: v2: count packets lost over TCP rate
sampling interval
For understanding the relationship between inflight and packet loss
@@ -19,7 +19,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1002,6 +1002,7 @@ struct tcp_skb_cb {
@@ -1055,6 +1055,7 @@ struct tcp_skb_cb {
#define TCPCB_IN_FLIGHT_MAX ((1U << TCPCB_IN_FLIGHT_BITS) - 1)
u32 in_flight:20, /* packets in flight at transmit */
unused2:12;
@@ -27,7 +27,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
} tx; /* only used for outgoing skbs */
union {
struct inet_skb_parm h4;
@@ -1156,11 +1157,13 @@ struct ack_sample {
@@ -1209,11 +1210,13 @@ struct ack_sample {
*/
struct rate_sample {
u64 prior_mstamp; /* starting timestamp for interval */

View File

@@ -1,7 +1,7 @@
From 3ff71ca0a15ebe4e5db9c0089121eafd2efc02ba Mon Sep 17 00:00:00 2001
From 3d3b54d263b6271926e0d9800ca000a529267cfe Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 19 Nov 2018 13:48:36 -0500
Subject: net-tcp_bbr: v2: export FLAG_ECE in rate_sample.is_ece
Subject: [PATCH 05/18] net-tcp_bbr: v2: export FLAG_ECE in rate_sample.is_ece
For understanding the relationship between inflight and ECN signals,
to try to find the highest inflight value that has acceptable levels
@@ -18,7 +18,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1175,6 +1175,7 @@ struct rate_sample {
@@ -1228,6 +1228,7 @@ struct rate_sample {
bool is_app_limited; /* is sample from packet with bubble in pipe? */
bool is_retrans; /* is sample from retransmission? */
bool is_ack_delayed; /* is this (likely) a delayed ACK? */
@@ -28,7 +28,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
struct tcp_congestion_ops {
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4073,6 +4073,7 @@ static int tcp_ack(struct sock *sk, cons
@@ -4084,6 +4084,7 @@ static int tcp_ack(struct sock *sk, cons
delivered = tcp_newly_delivered(sk, delivered, flag);
lost = tp->lost - lost; /* freshly marked lost */
rs.is_ack_delayed = !!(flag & FLAG_ACK_MAYBE_DELAYED);

View File

@@ -1,7 +1,7 @@
From fa9348cbc2b5a0f1f3fc82e51ae6ce956f8cfb1f Mon Sep 17 00:00:00 2001
From 6f3ecfa5c713cacd451b876f4190da6d36c512eb Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 7 Aug 2018 21:52:06 -0400
Subject: net-tcp_bbr: v2: introduce ca_ops->skb_marked_lost() CC
Subject: [PATCH 06/18] net-tcp_bbr: v2: introduce ca_ops->skb_marked_lost() CC
module callback API
For connections experiencing reordering, RACK can mark packets lost
@@ -30,7 +30,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1202,6 +1202,9 @@ struct tcp_congestion_ops {
@@ -1255,6 +1255,9 @@ struct tcp_congestion_ops {
/* override sysctl_tcp_min_tso_segs */
u32 (*min_tso_segs)(struct sock *sk);
@@ -42,7 +42,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
*/
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1140,7 +1140,12 @@ static void tcp_verify_retransmit_hint(s
@@ -1139,7 +1139,12 @@ static void tcp_verify_retransmit_hint(s
*/
static void tcp_notify_skb_loss_event(struct tcp_sock *tp, const struct sk_buff *skb)
{

View File

@@ -1,7 +1,7 @@
From 3add8086d7d76fe240fb341a4e49149ac4332990 Mon Sep 17 00:00:00 2001
From 52b39284416d0d841d4d51db0d3fce1c191a00d7 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Wed, 1 May 2019 20:16:33 -0400
Subject: net-tcp_bbr: v2: adjust skb tx.in_flight upon merge in
Subject: [PATCH 07/18] net-tcp_bbr: v2: adjust skb tx.in_flight upon merge in
tcp_shifted_skb()
When tcp_shifted_skb() updates state as adjacent SACKed skbs are
@@ -39,7 +39,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1517,6 +1517,17 @@ static bool tcp_shifted_skb(struct sock
@@ -1516,6 +1516,17 @@ static bool tcp_shifted_skb(struct sock
WARN_ON_ONCE(tcp_skb_pcount(skb) < pcount);
tcp_skb_pcount_add(skb, -pcount);

View File

@@ -1,7 +1,7 @@
From 6363d43645b3383ba590d0574dc37a215386aacf Mon Sep 17 00:00:00 2001
From 64570028a478a2249356345127bb3a3c75509d57 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Wed, 1 May 2019 20:16:25 -0400
Subject: net-tcp_bbr: v2: adjust skb tx.in_flight upon split in
Subject: [PATCH 08/18] net-tcp_bbr: v2: adjust skb tx.in_flight upon split in
tcp_fragment()
When we fragment an skb that has already been sent, we need to update
@@ -31,7 +31,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1301,6 +1301,21 @@ static inline bool tcp_skb_sent_after(u6
@@ -1354,6 +1354,21 @@ static inline bool tcp_skb_sent_after(u6
return t1 > t2 || (t1 == t2 && after(seq1, seq2));
}
@@ -55,16 +55,16 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
* between different flows.
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1612,7 +1612,7 @@ int tcp_fragment(struct sock *sk, enum t
@@ -1614,7 +1614,7 @@ int tcp_fragment(struct sock *sk, enum t
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *buff;
- int old_factor;
+ int old_factor, inflight_prev;
long limit;
u16 flags;
int nlen;
u8 flags;
@@ -1687,6 +1687,30 @@ int tcp_fragment(struct sock *sk, enum t
@@ -1689,6 +1689,30 @@ int tcp_fragment(struct sock *sk, enum t
if (diff)
tcp_adjust_pcount(sk, skb, diff);

View File

@@ -1,7 +1,7 @@
From 8c1b5bf6012099cba8911e255487bca5d0a2bd02 Mon Sep 17 00:00:00 2001
From fb3f903921be91a91b577d3771e5d5c9e9fe3aa9 Mon Sep 17 00:00:00 2001
From: Yousuk Seung <ysseung@google.com>
Date: Wed, 23 May 2018 17:55:54 -0700
Subject: net-tcp: add new ca opts flag TCP_CONG_WANTS_CE_EVENTS
Subject: [PATCH 09/18] net-tcp: add new ca opts flag TCP_CONG_WANTS_CE_EVENTS
Add a a new ca opts flag TCP_CONG_WANTS_CE_EVENTS that allows a
congestion control module to receive CE events.
@@ -23,20 +23,20 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1137,7 +1137,11 @@ enum tcp_ca_ack_event_flags {
#define TCP_CONG_NON_RESTRICTED 0x1
@@ -1190,7 +1190,11 @@ enum tcp_ca_ack_event_flags {
#define TCP_CONG_NON_RESTRICTED BIT(0)
/* Requires ECN/ECT set on all packets */
#define TCP_CONG_NEEDS_ECN 0x2
#define TCP_CONG_NEEDS_ECN BIT(1)
-#define TCP_CONG_MASK (TCP_CONG_NON_RESTRICTED | TCP_CONG_NEEDS_ECN)
+/* Wants notification of CE events (CA_EVENT_ECN_IS_CE, CA_EVENT_ECN_NO_CE). */
+#define TCP_CONG_WANTS_CE_EVENTS 0x4
+#define TCP_CONG_WANTS_CE_EVENTS BIT(2)
+#define TCP_CONG_MASK (TCP_CONG_NON_RESTRICTED | \
+ TCP_CONG_NEEDS_ECN | \
+ TCP_CONG_WANTS_CE_EVENTS)
union tcp_cc_info;
@@ -1269,6 +1273,14 @@ static inline char *tcp_ca_get_name_by_k
@@ -1322,6 +1326,14 @@ static inline char *tcp_ca_get_name_by_k
}
#endif
@@ -53,7 +53,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
const struct inet_connection_sock *icsk = inet_csk(sk);
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -376,7 +376,7 @@ static void __tcp_ecn_check_ce(struct so
@@ -381,7 +381,7 @@ static void tcp_data_ecn_check(struct so
tcp_enter_quickack_mode(sk, 2);
break;
case INET_ECN_CE:
@@ -62,7 +62,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
tcp_ca_event(sk, CA_EVENT_ECN_IS_CE);
if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
@@ -387,7 +387,7 @@ static void __tcp_ecn_check_ce(struct so
@@ -392,7 +392,7 @@ static void tcp_data_ecn_check(struct so
tp->ecn_flags |= TCP_ECN_SEEN;
break;
default:

View File

@@ -1,7 +1,7 @@
From 15fd38de916127d286bd373903fdfa5215b05aa4 Mon Sep 17 00:00:00 2001
From e0ac041e7e63d138d210fe875120447c11d2d4ba Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Fri, 27 Sep 2019 17:10:26 -0400
Subject: net-tcp: re-generalize TSO sizing in TCP CC module API
Subject: [PATCH 10/18] net-tcp: re-generalize TSO sizing in TCP CC module API
Reorganize the API for CC modules so that the CC module once again
gets complete control of the TSO sizing decision. This is how the API
@@ -28,7 +28,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1203,8 +1203,8 @@ struct tcp_congestion_ops {
@@ -1256,8 +1256,8 @@ struct tcp_congestion_ops {
/* hook for packet ack accounting (optional) */
void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample);
@@ -118,7 +118,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
};
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2068,13 +2068,12 @@ static u32 tcp_tso_autosize(const struct
@@ -2069,13 +2069,12 @@ static u32 tcp_tso_autosize(const struct
static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now)
{
const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;

View File

@@ -1,7 +1,7 @@
From 344af0ac329b2b1ce5f1ce920166e4aeb5e83037 Mon Sep 17 00:00:00 2001
From 323945d608bbef5fd3a444f52442bf0154c4ef0b Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Sat, 16 Nov 2019 13:16:25 -0500
Subject: net-tcp: add fast_ack_mode=1: skip rwin check in
Subject: [PATCH 11/18] net-tcp: add fast_ack_mode=1: skip rwin check in
tcp_fast_ack_mode__tcp_ack_snd_check()
Add logic for an optional TCP connection behavior, enabled with
@@ -22,9 +22,9 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -245,7 +245,8 @@ struct tcp_sock {
/* OOO segments go in this rbtree. Socket lock must be held. */
struct rb_root out_of_order_queue;
@@ -248,7 +248,8 @@ struct tcp_sock {
void (*tcp_clean_acked)(struct sock *sk, u32 acked_seq);
#endif
u32 snd_ssthresh; /* Slow start size threshold */
- u8 recvmsg_inq : 1;/* Indicate # of bytes in queue upon recvmsg */
+ u32 recvmsg_inq : 1,/* Indicate # of bytes in queue upon recvmsg */
@@ -34,7 +34,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
/* TX read-write hotpath cache lines */
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3398,6 +3398,7 @@ int tcp_disconnect(struct sock *sk, int
@@ -3411,6 +3411,7 @@ int tcp_disconnect(struct sock *sk, int
tp->rx_opt.dsack = 0;
tp->rx_opt.num_sacks = 0;
tp->rcv_ooopack = 0;
@@ -54,7 +54,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
if (tcp_ca_needs_ecn(sk))
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5790,13 +5790,14 @@ static void __tcp_ack_snd_check(struct s
@@ -5800,13 +5800,14 @@ static void __tcp_ack_snd_check(struct s
/* More than one full frame received... */
if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss &&

View File

@@ -1,7 +1,7 @@
From 18f564dbe586ab02c48563a9e05e71aa1a421607 Mon Sep 17 00:00:00 2001
From 30fc364b7834b5dce9434dfab4adb49d4924ac03 Mon Sep 17 00:00:00 2001
From: Jianfeng Wang <jfwang@google.com>
Date: Fri, 19 Jun 2020 17:33:45 +0000
Subject: net-tcp_bbr: v2: record app-limited status of
Subject: [PATCH 12/18] net-tcp_bbr: v2: record app-limited status of
TLP-repaired flight
When sending a TLP retransmit, record whether the outstanding flight
@@ -23,7 +23,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -303,7 +303,8 @@ struct tcp_sock {
@@ -306,7 +306,8 @@ struct tcp_sock {
*/
struct tcp_options_received rx_opt;
u8 nonagle : 4,/* Disable Nagle algorithm? */
@@ -35,7 +35,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
/* RX read-write hotpath cache lines */
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -3012,6 +3012,7 @@ void tcp_send_loss_probe(struct sock *sk
@@ -3013,6 +3013,7 @@ void tcp_send_loss_probe(struct sock *sk
if (WARN_ON(!skb || !tcp_skb_pcount(skb)))
goto rearm_timer;

View File

@@ -1,7 +1,7 @@
From 8da6e7d31a73453ce8495f004951069f5ef67c86 Mon Sep 17 00:00:00 2001
From 0c90659bb5c4af502726a0c71cecc096ece1fc95 Mon Sep 17 00:00:00 2001
From: Jianfeng Wang <jfwang@google.com>
Date: Tue, 16 Jun 2020 17:41:19 +0000
Subject: net-tcp_bbr: v2: inform CC module of losses repaired by
Subject: [PATCH 13/18] net-tcp_bbr: v2: inform CC module of losses repaired by
TLP probe
Before this commit, when there is a packet loss that creates a sequence
@@ -25,7 +25,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1115,6 +1115,7 @@ enum tcp_ca_event {
@@ -1168,6 +1168,7 @@ enum tcp_ca_event {
CA_EVENT_LOSS, /* loss timeout */
CA_EVENT_ECN_NO_CE, /* ECT set, but not CE marked */
CA_EVENT_ECN_IS_CE, /* received CE marked IP packet */
@@ -35,7 +35,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
/* Information about inbound ACK, passed to cong_ops->in_ack_event() */
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3870,6 +3870,7 @@ static void tcp_process_tlp_ack(struct s
@@ -3881,6 +3881,7 @@ static void tcp_process_tlp_ack(struct s
/* ACK advances: there was a loss, so reduce cwnd. Reset
* tlp_high_seq in tcp_init_cwnd_reduction()
*/

View File

@@ -1,7 +1,7 @@
From 528d5f9d97954b32db6ae1fe1729c4965886b6df Mon Sep 17 00:00:00 2001
From 0c9501f0d0743b7ab6958e064760b773b3bdf19b Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 21 Sep 2020 14:46:26 -0400
Subject: net-tcp_bbr: v2: introduce is_acking_tlp_retrans_seq
Subject: [PATCH 14/18] net-tcp_bbr: v2: introduce is_acking_tlp_retrans_seq
into rate_sample
Introduce is_acking_tlp_retrans_seq into rate_sample. This bool will
@@ -21,7 +21,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1179,6 +1179,7 @@ struct rate_sample {
@@ -1232,6 +1232,7 @@ struct rate_sample {
u32 last_end_seq; /* end_seq of most recently ACKed packet */
bool is_app_limited; /* is sample from packet with bubble in pipe? */
bool is_retrans; /* is sample from retransmission? */
@@ -31,7 +31,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
};
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3853,7 +3853,8 @@ static void tcp_replace_ts_recent(struct
@@ -3864,7 +3864,8 @@ static int tcp_replace_ts_recent(struct
/* This routine deals with acks during a TLP episode and ends an episode by
* resetting tlp_high_seq. Ref: TLP algorithm in draft-ietf-tcpm-rack
*/
@@ -41,7 +41,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -3881,6 +3882,11 @@ static void tcp_process_tlp_ack(struct s
@@ -3892,6 +3893,11 @@ static void tcp_process_tlp_ack(struct s
FLAG_NOT_DUP | FLAG_DATA_SACKED))) {
/* Pure dupack: original and TLP probe arrived; no loss */
tp->tlp_high_seq = 0;
@@ -53,7 +53,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
}
@@ -4066,7 +4072,7 @@ static int tcp_ack(struct sock *sk, cons
@@ -4077,7 +4083,7 @@ static int tcp_ack(struct sock *sk, cons
tcp_in_ack_event(sk, flag);
if (tp->tlp_high_seq)
@@ -62,7 +62,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
if (tcp_ack_is_dubious(sk, flag)) {
if (!(flag & (FLAG_SND_UNA_ADVANCED |
@@ -4111,7 +4117,7 @@ no_queue:
@@ -4122,7 +4128,7 @@ no_queue:
tcp_ack_probe(sk);
if (tp->tlp_high_seq)

View File

@@ -1,7 +1,7 @@
From a086cf589b0ab974965d88d338c0a373eff5d67c Mon Sep 17 00:00:00 2001
From c70e032f0effa66e1f67ae0a5ed65fac83c6c267 Mon Sep 17 00:00:00 2001
From: David Morley <morleyd@google.com>
Date: Fri, 14 Jul 2023 11:07:56 -0400
Subject: tcp: introduce per-route feature RTAX_FEATURE_ECN_LOW
Subject: [PATCH 15/18] tcp: introduce per-route feature RTAX_FEATURE_ECN_LOW
Define and implement a new per-route feature, RTAX_FEATURE_ECN_LOW.
@@ -33,15 +33,15 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -376,6 +376,7 @@ static inline void tcp_dec_quickack_mode
#define TCP_ECN_QUEUE_CWR 2
#define TCP_ECN_DEMAND_CWR 4
#define TCP_ECN_SEEN 8
+#define TCP_ECN_LOW 16
@@ -379,6 +379,7 @@ static inline void tcp_dec_quickack_mode
#define TCP_ECN_DEMAND_CWR BIT(2)
#define TCP_ECN_SEEN BIT(3)
#define TCP_ECN_MODE_ACCECN BIT(4)
+#define TCP_ECN_LOW BIT(5)
enum tcp_tw_status {
TCP_TW_SUCCESS = 0,
@@ -796,6 +797,15 @@ static inline void tcp_fast_path_check(s
#define TCP_ECN_DISABLED 0
#define TCP_ECN_MODE_PENDING (TCP_ECN_MODE_RFC3168 | TCP_ECN_MODE_ACCECN)
@@ -840,6 +841,15 @@ static inline void tcp_fast_path_check(s
u32 tcp_delack_max(const struct sock *sk);
@@ -59,7 +59,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
{
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -516,12 +516,14 @@ enum {
@@ -517,12 +517,14 @@ enum {
#define RTAX_FEATURE_TIMESTAMP (1 << 2) /* unused */
#define RTAX_FEATURE_ALLFRAG (1 << 3) /* unused */
#define RTAX_FEATURE_TCP_USEC_TS (1 << 4)
@@ -77,7 +77,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
__u8 proto;
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -471,6 +471,8 @@ void tcp_ca_openreq_child(struct sock *s
@@ -472,6 +472,8 @@ void tcp_ca_openreq_child(struct sock *s
u32 ca_key = dst_metric(dst, RTAX_CC_ALGO);
bool ca_got_dst = false;
@@ -101,7 +101,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
use_ecn = true;
}
@@ -354,6 +353,9 @@ static void tcp_ecn_send_syn(struct sock
tp->ecn_flags = TCP_ECN_OK;
tcp_ecn_mode_set(tp, TCP_ECN_MODE_RFC3168);
if (tcp_ca_needs_ecn(sk) || bpf_needs_ecn)
INET_ECN_xmit(sk);
+

View File

@@ -1,7 +1,7 @@
From 3259adaa6771b29fdf023acffe469979cdd1caae Mon Sep 17 00:00:00 2001
From 2e495d77c2494b3ebf22dac97dd5dc025b86ba86 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 11 Jun 2019 12:54:22 -0400
Subject: net-tcp_bbr: v3: update TCP "bbr" congestion control
Subject: [PATCH 16/18] net-tcp_bbr: v3: update TCP "bbr" congestion control
module to BBRv3
BBR v3 is an enhacement to the BBR v1 algorithm. It's designed to aim for lower
@@ -135,12 +135,12 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
include/net/tcp.h | 2 +-
include/uapi/linux/inet_diag.h | 23 +
net/ipv4/Kconfig | 21 +-
net/ipv4/tcp_bbr.c | 2217 +++++++++++++++++++++-------
5 files changed, 1742 insertions(+), 525 deletions(-)
net/ipv4/tcp_bbr.c | 2211 +++++++++++++++++++++-------
5 files changed, 1740 insertions(+), 521 deletions(-)
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -137,8 +137,8 @@ struct inet_connection_sock {
@@ -132,8 +132,8 @@ struct inet_connection_sock {
u32 icsk_probes_tstamp;
u32 icsk_user_timeout;
@@ -153,7 +153,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
#define ICSK_TIME_RETRANS 1 /* Retransmit timer */
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -2491,7 +2491,7 @@ struct tcp_plb_state {
@@ -2546,7 +2546,7 @@ struct tcp_plb_state {
u8 consec_cong_rounds:5, /* consecutive congested rounds */
unused:3;
u32 pause_until; /* jiffies32 when PLB can resume rerouting */
@@ -472,7 +472,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
/* Gain factor for adding extra_acked to target cwnd: */
static const int bbr_extra_acked_gain = BBR_UNIT;
/* Window length of extra_acked window. */
@@ -201,8 +256,121 @@ static const u32 bbr_ack_epoch_acked_res
@@ -201,8 +256,123 @@ static const u32 bbr_ack_epoch_acked_res
/* Time period for clamping cwnd increment due to ack aggregation */
static const u32 bbr_extra_acked_max_us = 100 * 1000;
@@ -587,14 +587,16 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
+ */
+static bool bbr_can_use_ecn(const struct sock *sk)
+{
+ return (tcp_sk(sk)->ecn_flags & TCP_ECN_OK) &&
+ struct tcp_sock *tp = tcp_sk(sk);
+
+ return tcp_ecn_mode_any(tp) &&
+ (tcp_sk(sk)->ecn_flags & TCP_ECN_LOW);
+}
+
/* Do we estimate that STARTUP filled the pipe? */
static bool bbr_full_bw_reached(const struct sock *sk)
{
@@ -214,17 +382,17 @@ static bool bbr_full_bw_reached(const st
@@ -214,17 +384,17 @@ static bool bbr_full_bw_reached(const st
/* Return the windowed max recent bandwidth sample, in pkts/uS << BW_SCALE. */
static u32 bbr_max_bw(const struct sock *sk)
{
@@ -616,7 +618,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
/* Return maximum extra acked in past k-2k round trips,
@@ -241,15 +409,23 @@ static u16 bbr_extra_acked(const struct
@@ -241,15 +411,23 @@ static u16 bbr_extra_acked(const struct
* The order here is chosen carefully to avoid overflow of u64. This should
* work for input rates of up to 2.9Tbit/sec and gain of 2.89x.
*/
@@ -643,7 +645,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
/* Convert a BBR bw and gain factor to a pacing rate in bytes per second. */
@@ -257,12 +433,13 @@ static unsigned long bbr_bw_to_pacing_ra
@@ -257,12 +435,13 @@ static unsigned long bbr_bw_to_pacing_ra
{
u64 rate = bw;
@@ -659,7 +661,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
static void bbr_init_pacing_rate_from_rtt(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -279,7 +456,8 @@ static void bbr_init_pacing_rate_from_rt
@@ -279,7 +458,8 @@ static void bbr_init_pacing_rate_from_rt
bw = (u64)tcp_snd_cwnd(tp) * BW_UNIT;
do_div(bw, rtt_us);
WRITE_ONCE(sk->sk_pacing_rate,
@@ -669,7 +671,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
/* Pace using current bw estimate and a gain factor. */
@@ -295,31 +473,38 @@ static void bbr_set_pacing_rate(struct s
@@ -295,31 +475,38 @@ static void bbr_set_pacing_rate(struct s
WRITE_ONCE(sk->sk_pacing_rate, rate);
}
@@ -719,7 +721,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
{
return bbr_tso_segs_generic(sk, mss_now, sk->sk_gso_max_size);
}
@@ -329,7 +514,7 @@ static u32 bbr_tso_segs_goal(struct sock
@@ -329,7 +516,7 @@ static u32 bbr_tso_segs_goal(struct sock
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -728,7 +730,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
/* Save "last known good" cwnd so we can restore it after losses or PROBE_RTT */
@@ -349,7 +534,9 @@ __bpf_kfunc static void bbr_cwnd_event(s
@@ -349,7 +536,9 @@ __bpf_kfunc static void bbr_cwnd_event(s
struct tcp_sock *tp = tcp_sk(sk);
struct bbr *bbr = inet_csk_ca(sk);
@@ -739,7 +741,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
bbr->idle_restart = 1;
bbr->ack_epoch_mstamp = tp->tcp_mstamp;
bbr->ack_epoch_acked = 0;
@@ -360,6 +547,16 @@ __bpf_kfunc static void bbr_cwnd_event(s
@@ -360,6 +549,16 @@ __bpf_kfunc static void bbr_cwnd_event(s
bbr_set_pacing_rate(sk, bbr_bw(sk), BBR_UNIT);
else if (bbr->mode == BBR_PROBE_RTT)
bbr_check_probe_rtt_done(sk);
@@ -756,7 +758,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
}
@@ -382,10 +579,10 @@ static u32 bbr_bdp(struct sock *sk, u32
@@ -382,10 +581,10 @@ static u32 bbr_bdp(struct sock *sk, u32
* default. This should only happen when the connection is not using TCP
* timestamps and has retransmitted all of the SYN/SYNACK/data packets
* ACKed so far. In this case, an RTO can cut cwnd to 1, in which
@@ -769,7 +771,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
w = (u64)bw * bbr->min_rtt_us;
@@ -402,23 +599,23 @@ static u32 bbr_bdp(struct sock *sk, u32
@@ -402,23 +601,23 @@ static u32 bbr_bdp(struct sock *sk, u32
* - one skb in sending host Qdisc,
* - one skb in sending host TSO/GSO engine
* - one skb being received by receiver host LRO/GRO/delayed-ACK engine
@@ -801,7 +803,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
cwnd += 2;
return cwnd;
@@ -473,10 +670,10 @@ static u32 bbr_ack_aggregation_cwnd(stru
@@ -473,10 +672,10 @@ static u32 bbr_ack_aggregation_cwnd(stru
{
u32 max_aggr_cwnd, aggr_cwnd = 0;
@@ -814,7 +816,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
>> BBR_SCALE;
aggr_cwnd = min(aggr_cwnd, max_aggr_cwnd);
}
@@ -484,66 +681,27 @@ static u32 bbr_ack_aggregation_cwnd(stru
@@ -484,66 +683,27 @@ static u32 bbr_ack_aggregation_cwnd(stru
return aggr_cwnd;
}
@@ -888,7 +890,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
target_cwnd = bbr_bdp(sk, bw, gain);
/* Increment the cwnd to account for excess ACKed data that seems
@@ -552,74 +710,26 @@ static void bbr_set_cwnd(struct sock *sk
@@ -552,74 +712,26 @@ static void bbr_set_cwnd(struct sock *sk
target_cwnd += bbr_ack_aggregation_cwnd(sk);
target_cwnd = bbr_quantization_budget(sk, target_cwnd);
@@ -980,7 +982,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
static void bbr_reset_startup_mode(struct sock *sk)
@@ -629,191 +739,49 @@ static void bbr_reset_startup_mode(struc
@@ -629,191 +741,49 @@ static void bbr_reset_startup_mode(struc
bbr->mode = BBR_STARTUP;
}
@@ -1058,11 +1060,9 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
+ * returns packets delivered since previous round start plus this ACK.
*/
-static void bbr_lt_bw_sampling(struct sock *sk, const struct rate_sample *rs)
+static u32 bbr_update_round_start(struct sock *sk,
+ const struct rate_sample *rs, struct bbr_context *ctx)
{
struct tcp_sock *tp = tcp_sk(sk);
struct bbr *bbr = inet_csk_ca(sk);
-{
- struct tcp_sock *tp = tcp_sk(sk);
- struct bbr *bbr = inet_csk_ca(sk);
- u32 lost, delivered;
- u64 bw;
- u32 t;
@@ -1133,9 +1133,11 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
-
-/* Estimate the bandwidth based on how fast packets are delivered */
-static void bbr_update_bw(struct sock *sk, const struct rate_sample *rs)
-{
- struct tcp_sock *tp = tcp_sk(sk);
- struct bbr *bbr = inet_csk_ca(sk);
+static u32 bbr_update_round_start(struct sock *sk,
+ const struct rate_sample *rs, struct bbr_context *ctx)
{
struct tcp_sock *tp = tcp_sk(sk);
struct bbr *bbr = inet_csk_ca(sk);
- u64 bw;
+ u32 round_delivered = 0;
@@ -1196,7 +1198,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
/* Estimates the windowed max degree of ack aggregation.
@@ -827,7 +795,7 @@ static void bbr_update_bw(struct sock *s
@@ -827,7 +797,7 @@ static void bbr_update_bw(struct sock *s
*
* Max extra_acked is clamped by cwnd and bw * bbr_extra_acked_max_us (100 ms).
* Max filter is an approximate sliding window of 5-10 (packet timed) round
@@ -1205,7 +1207,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
*/
static void bbr_update_ack_aggregation(struct sock *sk,
const struct rate_sample *rs)
@@ -835,15 +803,19 @@ static void bbr_update_ack_aggregation(s
@@ -835,15 +805,19 @@ static void bbr_update_ack_aggregation(s
u32 epoch_us, expected_acked, extra_acked;
struct bbr *bbr = inet_csk_ca(sk);
struct tcp_sock *tp = tcp_sk(sk);
@@ -1227,7 +1229,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
bbr->extra_acked_win_rtts = 0;
bbr->extra_acked_win_idx = bbr->extra_acked_win_idx ?
0 : 1;
@@ -877,49 +849,6 @@ static void bbr_update_ack_aggregation(s
@@ -877,49 +851,6 @@ static void bbr_update_ack_aggregation(s
bbr->extra_acked[bbr->extra_acked_win_idx] = extra_acked;
}
@@ -1277,7 +1279,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
static void bbr_check_probe_rtt_done(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -929,9 +858,9 @@ static void bbr_check_probe_rtt_done(str
@@ -929,9 +860,9 @@ static void bbr_check_probe_rtt_done(str
after(tcp_jiffies32, bbr->probe_rtt_done_stamp)))
return;
@@ -1289,7 +1291,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
/* The goal of PROBE_RTT mode is to have BBR flows cooperatively and
@@ -957,23 +886,35 @@ static void bbr_update_min_rtt(struct so
@@ -957,23 +888,35 @@ static void bbr_update_min_rtt(struct so
{
struct tcp_sock *tp = tcp_sk(sk);
struct bbr *bbr = inet_csk_ca(sk);
@@ -1334,7 +1336,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
if (bbr->mode == BBR_PROBE_RTT) {
@@ -982,9 +923,9 @@ static void bbr_update_min_rtt(struct so
@@ -982,9 +925,9 @@ static void bbr_update_min_rtt(struct so
(tp->delivered + tcp_packets_in_flight(tp)) ? : 1;
/* Maintain min packets in flight for max(200 ms, 1 round). */
if (!bbr->probe_rtt_done_stamp &&
@@ -1346,7 +1348,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
bbr->probe_rtt_round_done = 0;
bbr->next_rtt_delivered = tp->delivered;
} else if (bbr->probe_rtt_done_stamp) {
@@ -1005,18 +946,20 @@ static void bbr_update_gains(struct sock
@@ -1005,18 +948,20 @@ static void bbr_update_gains(struct sock
switch (bbr->mode) {
case BBR_STARTUP:
@@ -1375,7 +1377,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
break;
case BBR_PROBE_RTT:
bbr->pacing_gain = BBR_UNIT;
@@ -1028,27 +971,1108 @@ static void bbr_update_gains(struct sock
@@ -1028,27 +973,1108 @@ static void bbr_update_gains(struct sock
}
}
@@ -1435,7 +1437,8 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
+
+/* Has the given amount of time elapsed since we marked the phase start? */
+static bool bbr_has_elapsed_in_phase(const struct sock *sk, u32 interval_us)
+{
{
- bbr_update_bw(sk, rs);
+ const struct tcp_sock *tp = tcp_sk(sk);
+ const struct bbr *bbr = inet_csk_ca(sk);
+
@@ -1456,8 +1459,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
+
+/* Exit STARTUP upon N consecutive rounds with ECN mark rate > ecn_thresh. */
+static void bbr_check_ecn_too_high_in_startup(struct sock *sk, u32 ce_ratio)
{
- bbr_update_bw(sk, rs);
+{
+ struct bbr *bbr = inet_csk_ca(sk);
+
+ if (bbr_full_bw_reached(sk) || !bbr->ecn_eligible ||
@@ -2494,7 +2496,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
}
__bpf_kfunc static void bbr_init(struct sock *sk)
@@ -1056,20 +2080,21 @@ __bpf_kfunc static void bbr_init(struct
@@ -1056,20 +2082,21 @@ __bpf_kfunc static void bbr_init(struct
struct tcp_sock *tp = tcp_sk(sk);
struct bbr *bbr = inet_csk_ca(sk);
@@ -2521,7 +2523,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
bbr->has_seen_rtt = 0;
bbr_init_pacing_rate_from_rtt(sk);
@@ -1080,7 +2105,7 @@ __bpf_kfunc static void bbr_init(struct
@@ -1080,7 +2107,7 @@ __bpf_kfunc static void bbr_init(struct
bbr->full_bw_cnt = 0;
bbr->cycle_mstamp = 0;
bbr->cycle_idx = 0;
@@ -2530,7 +2532,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
bbr_reset_startup_mode(sk);
bbr->ack_epoch_mstamp = tp->tcp_mstamp;
@@ -1090,78 +2115,236 @@ __bpf_kfunc static void bbr_init(struct
@@ -1090,78 +2117,236 @@ __bpf_kfunc static void bbr_init(struct
bbr->extra_acked[0] = 0;
bbr->extra_acked[1] = 0;
@@ -2795,7 +2797,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
.undo_cwnd = bbr_undo_cwnd,
.cwnd_event = bbr_cwnd_event,
.ssthresh = bbr_ssthresh,
@@ -1174,10 +2357,11 @@ BTF_KFUNCS_START(tcp_bbr_check_kfunc_ids
@@ -1174,10 +2359,11 @@ BTF_KFUNCS_START(tcp_bbr_check_kfunc_ids
BTF_ID_FLAGS(func, bbr_init)
BTF_ID_FLAGS(func, bbr_main)
BTF_ID_FLAGS(func, bbr_sndbuf_expand)
@@ -2808,7 +2810,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
BTF_ID_FLAGS(func, bbr_set_state)
BTF_KFUNCS_END(tcp_bbr_check_kfunc_ids)
@@ -1210,5 +2394,12 @@ MODULE_AUTHOR("Van Jacobson <vanj@google
@@ -1210,5 +2396,12 @@ MODULE_AUTHOR("Van Jacobson <vanj@google
MODULE_AUTHOR("Neal Cardwell <ncardwell@google.com>");
MODULE_AUTHOR("Yuchung Cheng <ycheng@google.com>");
MODULE_AUTHOR("Soheil Hassas Yeganeh <soheil@google.com>");

View File

@@ -1,7 +1,7 @@
From 79dbc43c63d17b05e0b04c6ed68b5e24515cfe2f Mon Sep 17 00:00:00 2001
From 45615e9d62a6b0b688a284dc712c243295df9e65 Mon Sep 17 00:00:00 2001
From: Adithya Abraham Philip <abrahamphilip@google.com>
Date: Fri, 11 Jun 2021 21:56:10 +0000
Subject: net-tcp_bbr: v3: ensure ECN-enabled BBR flows set ECT
Subject: [PATCH 17/18] net-tcp_bbr: v3: ensure ECN-enabled BBR flows set ECT
on retransmits
Adds a new flag TCP_ECN_ECT_PERMANENT that is used by CCAs to
@@ -25,17 +25,17 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -377,6 +377,7 @@ static inline void tcp_dec_quickack_mode
#define TCP_ECN_DEMAND_CWR 4
#define TCP_ECN_SEEN 8
#define TCP_ECN_LOW 16
+#define TCP_ECN_ECT_PERMANENT 32
@@ -380,6 +380,7 @@ static inline void tcp_dec_quickack_mode
#define TCP_ECN_SEEN BIT(3)
#define TCP_ECN_MODE_ACCECN BIT(4)
#define TCP_ECN_LOW BIT(5)
+#define TCP_ECN_ECT_PERMANENT BIT(6)
enum tcp_tw_status {
TCP_TW_SUCCESS = 0,
#define TCP_ECN_DISABLED 0
#define TCP_ECN_MODE_PENDING (TCP_ECN_MODE_RFC3168 | TCP_ECN_MODE_ACCECN)
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -2152,6 +2152,9 @@ __bpf_kfunc static void bbr_init(struct
@@ -2154,6 +2154,9 @@ __bpf_kfunc static void bbr_init(struct
bbr->plb.pause_until = 0;
tp->fast_ack_mode = bbr_fast_ack_mode ? 1 : 0;

View File

@@ -1,7 +1,7 @@
From 74f5a9e717fb41742cf30802e9f9c55c001d2576 Mon Sep 17 00:00:00 2001
From 461bd4bd12039886127019682ba6e7f372d9fa0b Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Sun, 23 Jul 2023 23:25:34 -0400
Subject: tcp: export TCPI_OPT_ECN_LOW in tcp_info tcpi_options
Subject: [PATCH 18/18] tcp: export TCPI_OPT_ECN_LOW in tcp_info tcpi_options
field
Analogous to other important ECN information, export TCPI_OPT_ECN_LOW
@@ -17,7 +17,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -178,6 +178,7 @@ enum tcp_fastopen_client_fail {
@@ -184,6 +184,7 @@ enum tcp_fastopen_client_fail {
#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
#define TCPI_OPT_USEC_TS 64 /* usec timestamps */
@@ -27,7 +27,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
* Sender's congestion state indicating normal or abnormal situations
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4125,6 +4125,8 @@ void tcp_get_info(struct sock *sk, struc
@@ -4159,6 +4159,8 @@ void tcp_get_info(struct sock *sk, struc
info->tcpi_options |= TCPI_OPT_ECN;
if (tp->ecn_flags & TCP_ECN_SEEN)
info->tcpi_options |= TCPI_OPT_ECN_SEEN;