Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcp: Revert "tcp: remove CA_ACK_SLOWPATH"

This change was a followup to the header prediction removal,
so first revert this as a prerequisite to back out hp removal.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Westphal and committed by
David S. Miller
c1d2b4c3 0da93d2e

+50 -23
+3 -2
include/net/tcp.h
··· 910 910 911 911 /* Information about inbound ACK, passed to cong_ops->in_ack_event() */ 912 912 enum tcp_ca_ack_event_flags { 913 - CA_ACK_WIN_UPDATE = (1 << 0), /* ACK updated window */ 914 - CA_ACK_ECE = (1 << 1), /* ECE bit is set on ack */ 913 + CA_ACK_SLOWPATH = (1 << 0), /* In slow path processing */ 914 + CA_ACK_WIN_UPDATE = (1 << 1), /* ACK updated window */ 915 + CA_ACK_ECE = (1 << 2), /* ECE bit is set on ack */ 915 916 }; 916 917 917 918 /*
+20 -17
net/ipv4/tcp_input.c
··· 3552 3552 u32 lost = tp->lost; 3553 3553 int acked = 0; /* Number of packets newly acked */ 3554 3554 int rexmit = REXMIT_NONE; /* Flag to (re)transmit to recover losses */ 3555 - u32 ack_ev_flags = 0; 3556 3555 3557 3556 sack_state.first_sackt = 0; 3558 3557 sack_state.rate = &rs; ··· 3592 3593 if (flag & FLAG_UPDATE_TS_RECENT) 3593 3594 tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); 3594 3595 3595 - if (ack_seq != TCP_SKB_CB(skb)->end_seq) 3596 - flag |= FLAG_DATA; 3597 - else 3598 - NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPPUREACKS); 3596 + { 3597 + u32 ack_ev_flags = CA_ACK_SLOWPATH; 3599 3598 3600 - flag |= tcp_ack_update_window(sk, skb, ack, ack_seq); 3599 + if (ack_seq != TCP_SKB_CB(skb)->end_seq) 3600 + flag |= FLAG_DATA; 3601 + else 3602 + NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPPUREACKS); 3601 3603 3602 - if (TCP_SKB_CB(skb)->sacked) 3603 - flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una, 3604 - &sack_state); 3604 + flag |= tcp_ack_update_window(sk, skb, ack, ack_seq); 3605 3605 3606 - if (tcp_ecn_rcv_ecn_echo(tp, tcp_hdr(skb))) { 3607 - flag |= FLAG_ECE; 3608 - ack_ev_flags = CA_ACK_ECE; 3606 + if (TCP_SKB_CB(skb)->sacked) 3607 + flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una, 3608 + &sack_state); 3609 + 3610 + if (tcp_ecn_rcv_ecn_echo(tp, tcp_hdr(skb))) { 3611 + flag |= FLAG_ECE; 3612 + ack_ev_flags |= CA_ACK_ECE; 3613 + } 3614 + 3615 + if (flag & FLAG_WIN_UPDATE) 3616 + ack_ev_flags |= CA_ACK_WIN_UPDATE; 3617 + 3618 + tcp_in_ack_event(sk, ack_ev_flags); 3609 3619 } 3610 - 3611 - if (flag & FLAG_WIN_UPDATE) 3612 - ack_ev_flags |= CA_ACK_WIN_UPDATE; 3613 - 3614 - tcp_in_ack_event(sk, ack_ev_flags); 3615 3620 3616 3621 /* We passed data and got it acked, remove any soft error 3617 3622 * log. Something worked...
+27 -4
net/ipv4/tcp_westwood.c
··· 154 154 } 155 155 156 156 /* 157 + * @westwood_fast_bw 158 + * It is called when we are in fast path. In particular it is called when 159 + * header prediction is successful. In such case in fact update is 160 + * straight forward and doesn't need any particular care. 161 + */ 162 + static inline void westwood_fast_bw(struct sock *sk) 163 + { 164 + const struct tcp_sock *tp = tcp_sk(sk); 165 + struct westwood *w = inet_csk_ca(sk); 166 + 167 + westwood_update_window(sk); 168 + 169 + w->bk += tp->snd_una - w->snd_una; 170 + w->snd_una = tp->snd_una; 171 + update_rtt_min(w); 172 + } 173 + 174 + /* 157 175 * @westwood_acked_count 158 176 * This function evaluates cumul_ack for evaluating bk in case of 159 177 * delayed or partial acks. ··· 223 205 224 206 static void tcp_westwood_ack(struct sock *sk, u32 ack_flags) 225 207 { 226 - struct westwood *w = inet_csk_ca(sk); 208 + if (ack_flags & CA_ACK_SLOWPATH) { 209 + struct westwood *w = inet_csk_ca(sk); 227 210 228 - westwood_update_window(sk); 229 - w->bk += westwood_acked_count(sk); 211 + westwood_update_window(sk); 212 + w->bk += westwood_acked_count(sk); 230 213 231 - update_rtt_min(w); 214 + update_rtt_min(w); 215 + return; 216 + } 217 + 218 + westwood_fast_bw(sk); 232 219 } 233 220 234 221 static void tcp_westwood_event(struct sock *sk, enum tcp_ca_event event)