summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorLawrence Brakmo2017-07-01 05:02:49 +0200
committerDavid S. Miller2017-07-02 01:15:14 +0200
commit91b5b21c7c16899abb37f4a9e4388b4e9aae0b9d (patch)
treeff5989374783d9f11e822906a98e94d08a6f135a /net/ipv4/tcp_input.c
parentbpf: Sample BPF program to set buffer sizes (diff)
downloadkernel-qcow2-linux-91b5b21c7c16899abb37f4a9e4388b4e9aae0b9d.tar.gz
kernel-qcow2-linux-91b5b21c7c16899abb37f4a9e4388b4e9aae0b9d.tar.xz
kernel-qcow2-linux-91b5b21c7c16899abb37f4a9e4388b4e9aae0b9d.zip
bpf: Add support for changing congestion control
Added support for changing congestion control for SOCK_OPS bpf programs through the setsockopt bpf helper function. It also adds a new SOCK_OPS op, BPF_SOCK_OPS_NEEDS_ECN, that is needed for congestion controls, like dctcp, that need to enable ECN in the SYN packets. Signed-off-by: Lawrence Brakmo <brakmo@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 664210e5e4a7..2920e0cb09f8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6191,7 +6191,8 @@ static void tcp_ecn_create_request(struct request_sock *req,
ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst;
if ((!ect && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
- (ecn_ok_dst & DST_FEATURE_ECN_CA))
+ (ecn_ok_dst & DST_FEATURE_ECN_CA) ||
+ tcp_bpf_ca_needs_ecn((struct sock *)req))
inet_rsk(req)->ecn_ok = 1;
}