mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
UPSTREAM: tcp: bpf: Add TCP_BPF_DELACK_MAX setsockopt
This change is mostly from an internal patch and adapts it from sysctl config to the bpf_setsockopt setup. The bpf_prog can set the max delay ack by using bpf_setsockopt(TCP_BPF_DELACK_MAX). This max delay ack can be communicated to its peer through bpf header option. The receiving peer can then use this max delay ack and set a potentially lower rto by using bpf_setsockopt(TCP_BPF_RTO_MIN) which will be introduced in the next patch. Another later selftest patch will also use it like the above to show how to write and parse bpf tcp header option. Change-Id: Ia2591a16e948ced059df4b1e1447360e7aab9e0f Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Acked-by: John Fastabend <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
This commit is contained in:
parent
65c272f187
commit
9768c9f10c
6 changed files with 15 additions and 0 deletions
|
|
@ -422,6 +422,7 @@ void tcp_init_sock(struct sock *sk)
|
|||
INIT_LIST_HEAD(&tp->tsorted_sent_queue);
|
||||
|
||||
icsk->icsk_rto = TCP_TIMEOUT_INIT;
|
||||
icsk->icsk_delack_max = TCP_DELACK_MAX;
|
||||
tp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT);
|
||||
minmax_reset(&tp->rtt_min, tcp_jiffies32, ~0U);
|
||||
|
||||
|
|
@ -2656,6 +2657,7 @@ int tcp_disconnect(struct sock *sk, int flags)
|
|||
icsk->icsk_probes_out = 0;
|
||||
icsk->icsk_probes_tstamp = 0;
|
||||
icsk->icsk_rto = TCP_TIMEOUT_INIT;
|
||||
icsk->icsk_delack_max = TCP_DELACK_MAX;
|
||||
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
|
||||
tp->snd_cwnd = TCP_INIT_CWND;
|
||||
tp->snd_cwnd_cnt = 0;
|
||||
|
|
|
|||
|
|
@ -3721,6 +3721,8 @@ void tcp_send_delayed_ack(struct sock *sk)
|
|||
ato = min(ato, max_ato);
|
||||
}
|
||||
|
||||
ato = min_t(u32, ato, inet_csk(sk)->icsk_delack_max);
|
||||
|
||||
/* Stay within the limit we were given */
|
||||
timeout = jiffies + ato;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue