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

tcp: Pass flags to __tcp_send_ack

Accurate ECN needs to send custom flags to handle IP-ECN
field reflection during handshake.

Signed-off-by: Ilpo Järvinen <ij@kernel.org>
Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ilpo Järvinen and committed by
David S. Miller
9866884c 4618e195

+6 -6
+1 -1
include/net/tcp.h
··· 707 707 enum sk_rst_reason reason); 708 708 int tcp_send_synack(struct sock *); 709 709 void tcp_push_one(struct sock *, unsigned int mss_now); 710 - void __tcp_send_ack(struct sock *sk, u32 rcv_nxt); 710 + void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags); 711 711 void tcp_send_ack(struct sock *sk); 712 712 void tcp_send_delayed_ack(struct sock *sk); 713 713 void tcp_send_loss_probe(struct sock *sk);
+1 -1
net/ipv4/bpf_tcp_ca.c
··· 121 121 BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt) 122 122 { 123 123 /* bpf_tcp_ca prog cannot have NULL tp */ 124 - __tcp_send_ack((struct sock *)tp, rcv_nxt); 124 + __tcp_send_ack((struct sock *)tp, rcv_nxt, 0); 125 125 return 0; 126 126 } 127 127
+1 -1
net/ipv4/tcp_dctcp.h
··· 28 28 */ 29 29 if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) { 30 30 dctcp_ece_ack_cwr(sk, *ce_state); 31 - __tcp_send_ack(sk, *prior_rcv_nxt); 31 + __tcp_send_ack(sk, *prior_rcv_nxt, 0); 32 32 } 33 33 inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW; 34 34 }
+3 -3
net/ipv4/tcp_output.c
··· 4240 4240 } 4241 4241 4242 4242 /* This routine sends an ack and also updates the window. */ 4243 - void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) 4243 + void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags) 4244 4244 { 4245 4245 struct sk_buff *buff; 4246 4246 ··· 4269 4269 4270 4270 /* Reserve space for headers and prepare control bits. */ 4271 4271 skb_reserve(buff, MAX_TCP_HEADER); 4272 - tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK); 4272 + tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK | flags); 4273 4273 4274 4274 /* We do not want pure acks influencing TCP Small Queues or fq/pacing 4275 4275 * too much. ··· 4284 4284 4285 4285 void tcp_send_ack(struct sock *sk) 4286 4286 { 4287 - __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); 4287 + __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt, 0); 4288 4288 } 4289 4289 4290 4290 /* This routine sends a packet with an out of date sequence