mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
bpf: Add sock_ops RTO callback
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
This commit is contained in:
parent
b13d880721
commit
f89013f66d
2 changed files with 14 additions and 1 deletions
|
|
@ -213,11 +213,18 @@ static int tcp_write_timeout(struct sock *sk)
|
|||
icsk->icsk_user_timeout);
|
||||
}
|
||||
tcp_fastopen_active_detect_blackhole(sk, expired);
|
||||
|
||||
if (BPF_SOCK_OPS_TEST_FLAG(tp, BPF_SOCK_OPS_RTO_CB_FLAG))
|
||||
tcp_call_bpf_3arg(sk, BPF_SOCK_OPS_RTO_CB,
|
||||
icsk->icsk_retransmits,
|
||||
icsk->icsk_rto, (int)expired);
|
||||
|
||||
if (expired) {
|
||||
/* Has it gone just too far? */
|
||||
tcp_write_err(sk);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue