summaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorLawrence Brakmo2017-07-01 05:02:44 +0200
committerDavid S. Miller2017-07-02 01:15:13 +0200
commit13d3b1ebe28762c79e981931a41914fae5d04386 (patch)
tree2ba5e7acc2245ff6296bc8b51e10d49559cdb928 /include/net/tcp.h
parentbpf: Sample bpf program to set SYN/SYN-ACK RTOs (diff)
downloadkernel-qcow2-linux-13d3b1ebe28762c79e981931a41914fae5d04386.tar.gz
kernel-qcow2-linux-13d3b1ebe28762c79e981931a41914fae5d04386.tar.xz
kernel-qcow2-linux-13d3b1ebe28762c79e981931a41914fae5d04386.zip
bpf: Support for setting initial receive window
This patch adds suppport for setting the initial advertized window from within a BPF_SOCK_OPS program. This can be used to support larger initial cwnd values in environments where it is known to be safe. Signed-off-by: Lawrence Brakmo <brakmo@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 564af2dee236..d6bb3948203d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -2068,4 +2068,14 @@ static inline u32 tcp_timeout_init(struct sock *sk)
return timeout;
}
+static inline u32 tcp_rwnd_init_bpf(struct sock *sk)
+{
+ int rwnd;
+
+ rwnd = tcp_call_bpf(sk, BPF_SOCK_OPS_RWND_INIT);
+
+ if (rwnd < 0)
+ rwnd = 0;
+ return rwnd;
+}
#endif /* _TCP_H */