Skip to content

Commit

Permalink
net-tcp_bbr: v2: introduce is_acking_tlp_retrans_seq into rate_sample
Browse files Browse the repository at this point in the history
Introduce is_acking_tlp_retrans_seq into rate_sample. This bool will
export to the CC module the knowledge of whether the current ACK
matched a TLP retransmit.

Note that when this bool is true, we cannot yet tell (in general) whether
this ACK is for the original or the TLP retransmit.

Effort: net-tcp_bbr
Change-Id: I2e6494332167e75efcbdc99bd5c119034e9c39b4
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
  • Loading branch information
nealcardwell authored and xanmod committed Aug 16, 2023
1 parent 0264509 commit 9bc8bc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/net/tcp.h
Expand Up @@ -1079,6 +1079,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? */
bool is_acking_tlp_retrans_seq; /* ACKed a TLP retransmit sequence? */
bool is_ack_delayed; /* is this (likely) a delayed ACK? */
bool is_ece; /* did this ACK have ECN marked? */
};
Expand Down
12 changes: 9 additions & 3 deletions net/ipv4/tcp_input.c
Expand Up @@ -3703,7 +3703,8 @@ static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq)
/* 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
*/
static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag,
struct rate_sample *rs)
{
struct tcp_sock *tp = tcp_sk(sk);

Expand Down Expand Up @@ -3731,6 +3732,11 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
FLAG_NOT_DUP | FLAG_DATA_SACKED))) {
/* Pure dupack: original and TLP probe arrived; no loss */
tp->tlp_high_seq = 0;
} else {
/* This ACK matches a TLP retransmit. We cannot yet tell if
* this ACK is for the original or the TLP retransmit.
*/
rs->is_acking_tlp_retrans_seq = 1;
}
}

Expand Down Expand Up @@ -3910,7 +3916,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
tcp_rack_update_reo_wnd(sk, &rs);

if (tp->tlp_high_seq)
tcp_process_tlp_ack(sk, ack, flag);
tcp_process_tlp_ack(sk, ack, flag, &rs);

if (tcp_ack_is_dubious(sk, flag)) {
if (!(flag & (FLAG_SND_UNA_ADVANCED |
Expand Down Expand Up @@ -3954,7 +3960,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
tcp_ack_probe(sk);

if (tp->tlp_high_seq)
tcp_process_tlp_ack(sk, ack, flag);
tcp_process_tlp_ack(sk, ack, flag, &rs);
return 1;

old_ack:
Expand Down

0 comments on commit 9bc8bc1

Please sign in to comment.