Message ID | 20221125222958.958636-2-matthieu.baerts@tessares.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4325599wrr; Fri, 25 Nov 2022 14:31:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf50kFbQDOxCPPHOBawjsGtkIv2FF2Wz9UbJTfHX8o+exnisKVGwDsgI+fXWv+LO1/Hy+9Vn X-Received: by 2002:a63:4087:0:b0:477:15c8:ff67 with SMTP id n129-20020a634087000000b0047715c8ff67mr20766404pga.275.1669415493327; Fri, 25 Nov 2022 14:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669415493; cv=none; d=google.com; s=arc-20160816; b=iyvRRehb7omzYjJXVwwNNVVOAvdYFMk8riC7ae+vvDMD6SuXZK3wMq42jjl1jPVvp/ UalNy8XjRwhLlCxUDb62RHyd5gBIgRMUNf0sULX+JuzoWSy82d4xvCJ9SJ6yGK61foLV QpT0IGSzsp9hRj1KNRFk67NsMXiR50hYkCRyt3v68QS5hlSQlWpWXpO2xLkYJ6lOrJ7f cRtgQN3I87akhRy9HXNz3381AbIIWZkynY19J+nAWgTPkC2KPZdQAPDr+mUlRw6Cq4/b x5Mra957P/jxm84+GbHF7OOlQGTuKP6bJNRQn9XjJ9PHtHK7JXJOA3tU89rJxncEic6/ lXhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gBCA9x7cMHFPqIe5fGwepfqiKMVw0+m7IHknfbCdlF0=; b=CWl1ClHyFqpelt1pdhbOSCi7gUVKEZTYTIZ8KhZWULg3H2rWRbaLjsiQi85guPz0ma 6XLLPxwRamPCrff0YSRaqAEuwtfhO9/+jACQW0gkg1uEL797JZMWr44OaKuavaiRLQX+ 4I45dJqfMS5/lplag5UIKVRyC89dgTpGq6kvEDn20WM0F1tU7A3EbmquTLJHzTbJNPHm +2bRXJFQcS0bLMRgaqYrTFcj9DnzIoGn4+9ivLirrjAgPt/r8oNu7jfUEamu4Opzse/E SQeMMHFyhlKpZUQxmH4wWGYJ3pulJRMIp6LsuT4qj82s6PlwptX0SRyls5nzf1xW7+18 Wgtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=c4GJegnF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q140-20020a632a92000000b00476e98ca7d5si5827579pgq.785.2022.11.25.14.31.20; Fri, 25 Nov 2022 14:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=c4GJegnF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiKYWa1 (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Fri, 25 Nov 2022 17:30:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbiKYWaX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 25 Nov 2022 17:30:23 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15BEE2EF2E for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 14:30:22 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id ud5so13074244ejc.4 for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 14:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gBCA9x7cMHFPqIe5fGwepfqiKMVw0+m7IHknfbCdlF0=; b=c4GJegnFhscWlswG9LjL8CSsHpMrKyPlAnk/rkgzodpxvraVmNjjszAdKN3CsoeQP5 cuaWCe1O1vAcNBFyy19bPjx3pU5U7w+es/uQ2+o5o3UY1Fqo3+hMjcG40nS6Zv39REoj g7LLy7n4V5IwL6+fv4UhFuvMlxcyVo7zfFrFQeyGYueuURdJnVG7hOextaFaZUm06L4i hKUkezauVV7SdAy89wIun4w3MnhHqYu8hp23UiAicyvkaYthXTN5feji+m8IBF5VJuUW jNyFdHIQ+gTI6eG8GKPqT4AfdrQTqiipuBvQlTLcvHYoJYc4IIbjiJFWJ7h+qIO8EYGV ALVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gBCA9x7cMHFPqIe5fGwepfqiKMVw0+m7IHknfbCdlF0=; b=FBroz44qLzNcts6tDO6wZN6BYewCl92N9uPa2NMSDW6eu6giKjhMw2nozy+Sfpq7U0 Us5eAkXpwLRhLs8WiSzLY/jrp6BiHy9/ddmzoh9+8rfCjHyd0OL+f6gYestIxEc2ifZV rMDURZcOA9c3asZlBs4DaaxnVF5mXYfaKNp4jEz19BFq4+9+LQiFLX/cBfvKR/GcP6/3 8o37Ix7amk0WJk57pQMwsDo6Ejb64fAjIeZFsQBQTEqVTA3o4oHk0x6s3Rj1sI+3LYgT ed9dobsN1OQwJ/I8lHKBprLX/6EWK368x1WgXTpi/csDKf76KrHqfZYqUlVfTlaW0deS DWIA== X-Gm-Message-State: ANoB5pnaZOFQQyw31Y497EDZrDmrBkJ6V5qKofmM9ag6FcBPY4C1n62u chVIlA729RAa5Ec7bfou3xxYoA== X-Received: by 2002:a17:906:5293:b0:7b9:631c:451a with SMTP id c19-20020a170906529300b007b9631c451amr14565134ejm.283.1669415420533; Fri, 25 Nov 2022 14:30:20 -0800 (PST) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id q1-20020a056402248100b0046267f8150csm2254612eda.19.2022.11.25.14.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 14:30:20 -0800 (PST) From: Matthieu Baerts <matthieu.baerts@tessares.net> To: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Dmytro Shytyi <dmytro@shytyi.net>, Benjamin Hesmans <benjamin.hesmans@tessares.net>, netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/8] mptcp: add MSG_FASTOPEN sendmsg flag support Date: Fri, 25 Nov 2022 23:29:47 +0100 Message-Id: <20221125222958.958636-2-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221125222958.958636-1-matthieu.baerts@tessares.net> References: <20221125222958.958636-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1505; i=matthieu.baerts@tessares.net; h=from:subject; bh=A6FMBCW63WCmAXAOc+ddPtBLco+9STQpRswEd8AeUr0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBjgUHPa4vNEORZStSCr2EV2UfU8z3wnaTzRh2RWb3b PqdgihGJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCY4FBzwAKCRD2t4JPQmmgc8BrD/ wM8u7SAV3orCOwAotH2p43JebnN3OvywrxZXGzPSe3U7xONwt+YTQTVeZrg/gsPdcGGFPGLkgCUljz adJbw8b35ljOseooC0t9ep5Z4UdfnXi27QUde7uu+0BlfdfrIVEavcr/cCk1kiI4MaE8GIXTjV+Q7J SgaE0nnHuLMhHe20uZfcTQLSKOR83V9DAgkmYBPefWfeADEoKJWhdcjgLDAyWcz0+YN00sA72G6OmG m0/59Cvy+0U9lRKlMRefLQweAqKnsyLfmfl8g/+RIHtWn96rijUlIPcK53w8taPmjj7/6TIXYlQFHM jlrD16pqbrDdwqVanTAf85KGSZTAEmHuI7ifJ7755jiMF1HjfHclVxP7AoRuVP1S4oodO9wGW2aOPh +VHUGVKA4Pn/UGnqVzRi0OvqV9bN/uPAwJ5Bn7XaHRvXN8/GURbDZ+Mw9jda+JN5m34dLkf3KEbFdV /vvmKmQKKM2IW819kcfVxcA1LVUlPpf+dXM4MK1KNmFBBCUKgyxHKNSVOIol+uRifFSSWH4k4i+aln KEjV8d8UDY/nz1K94TJdh1E2XRlCIUyqs7i6SSvCdU4WaXixerANvP2+PPB4SAdGcWTL5MTNqXpICa wC8ASt63uAC2Rl8FYcwgEQqqxUbU96dBEjOhz3dX6IO8bTT0X1322A7Ft2Mw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750509020223227692?= X-GMAIL-MSGID: =?utf-8?q?1750509020223227692?= |
Series |
mptcp: MSG_FASTOPEN and TFO listener side support
|
|
Commit Message
Matthieu Baerts
Nov. 25, 2022, 10:29 p.m. UTC
From: Dmytro Shytyi <dmytro@shytyi.net> Since commit 54f1944ed6d2 ("mptcp: factor out mptcp_connect()"), all the infrastructure is now in place to support the MSG_FASTOPEN flag, we just need to call into the fastopen path in mptcp_sendmsg(). Co-developed-by: Benjamin Hesmans <benjamin.hesmans@tessares.net> Signed-off-by: Benjamin Hesmans <benjamin.hesmans@tessares.net> Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Dmytro Shytyi <dmytro@shytyi.net> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> --- net/mptcp/protocol.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 3796d1bfef6b..37876e06d4c4 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1711,17 +1711,14 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) int ret = 0; long timeo; - /* we don't support FASTOPEN yet */ - if (msg->msg_flags & MSG_FASTOPEN) - return -EOPNOTSUPP; - /* silently ignore everything else */ - msg->msg_flags &= MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL; + msg->msg_flags &= MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_FASTOPEN; lock_sock(sk); ssock = __mptcp_nmpc_socket(msk); - if (unlikely(ssock && inet_sk(ssock->sk)->defer_connect)) { + if (unlikely(ssock && (inet_sk(ssock->sk)->defer_connect || + msg->msg_flags & MSG_FASTOPEN))) { int copied_syn = 0; ret = mptcp_sendmsg_fastopen(sk, ssock->sk, msg, len, &copied_syn);