From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuchung Cheng Subject: [PATCH bpf] bpf: correctly set initial window on active Fast Open sender Date: Tue, 8 Jan 2019 18:12:24 -0800 Message-ID: <20190109021224.6244-1-ycheng@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, brakmo@fb.com, ncardwell@google.com, edumazet@google.com, Yuchung Cheng To: ast@kernel.org, daniel@iogearbox.net Return-path: Received: from mail-pf1-f195.google.com ([209.85.210.195]:41369 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbfAICMq (ORCPT ); Tue, 8 Jan 2019 21:12:46 -0500 Received: by mail-pf1-f195.google.com with SMTP id b7so2857277pfi.8 for ; Tue, 08 Jan 2019 18:12:45 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: The existing BPF TCP initial congestion window (TCP_BPF_IW) does not to work on (active) Fast Open sender. This is because it changes the (initial) window only if data_segs_out is zero -- but data_segs_out is also incremented on SYN-data. This patch fixes the issue by proerly accounting for SYN-data additionally. Fixes: fc7478103c84 ("bpf: Adds support for setting initial cwnd") Signed-off-by: Yuchung Cheng Reviewed-by: Neal Cardwell --- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/filter.c b/net/core/filter.c index 447dd1bad31f..2b3b436ef545 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4203,7 +4203,7 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, /* Only some options are supported */ switch (optname) { case TCP_BPF_IW: - if (val <= 0 || tp->data_segs_out > 0) + if (val <= 0 || tp->data_segs_out > tp->syn_data) ret = -EINVAL; else tp->snd_cwnd = val; -- 2.20.1.97.g81188d93c3-goog