Message ID | 20230414-upstream-net-next-20230414-mptcp-refactor-first-subflow-init-v1-5-04d177057eb9@tessares.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp418679vqo; Fri, 14 Apr 2023 07:19:44 -0700 (PDT) X-Google-Smtp-Source: AKy350blRJG3vVEhA0V35WqAYsXJ+FlLd/oiFILbTmFlNVDN3edq3FIT1F5lSK2Vq4agbE/2F+Gs X-Received: by 2002:a05:6a00:cd3:b0:62d:d6ca:5834 with SMTP id b19-20020a056a000cd300b0062dd6ca5834mr9145536pfv.16.1681481983700; Fri, 14 Apr 2023 07:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681481983; cv=none; d=google.com; s=arc-20160816; b=xx59aDXrfHKh52RZ0F6ykMiMYCt9SX/FxYbJIPRFlH6LgjqNbH5b+O5RK6sDzlwpHa pF3eoDaNqzCVMnWOjTCqdg/wlU7DYU5TazZvsfyxckjlEkIqWRTITRCE/mjjTzjqPXPu Ghr4pJxtoXRamxsL/GVaFsets2xOd8pJqPpY39HyPvnDYIUuccKzwKGs5dbSVYp6sLgE f5IVqhmQ8FToUXeyDKM6trPxEWcjRzlS085Yt/ULuR3dtkVoOfZxiAct8ySsNNrtDmRB nFHWPYNXk95wOQn1syMtP2souhm7Wi8by62qjoZaMFYEoIKn94NIiPNFtfjuS1iy4HlR 1sNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ogznRyoPP+056OwMwbae8knri/N8tWTWU74IRb36bJ0=; b=rELGLX8yNUpvcyzDwFlikQSzetVo4AQ+cwiHEcbQAn6hYMCddFj9gfPGDtah0rvjvR V2D3HInmq0jHgCXa3M3D9201+XCrFZS5SN9QuSPBGoyJRDSzwRN0ASjQx3WeobeFatXK We1Us+I+Gu1sLa6gzn7/XN56FvX3lVLl+1CYdCOv0NTUCW/AhLuN5wEAZsQnTLOCOE6i QN69AbMKnhZObyfUAzwQMjoatYDcAeafXutUH1LNFOfAjOOXA11TvYvGUpgwiOG5Hsj6 QDCeB5vhDfux8fQFvGTYG1saBg5DMyFyOoQrB7afOFQMfF08b1mpH8+svyGH8W5KYjnh tHiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="sHfPEz0/"; 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=REJECT sp=REJECT 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 bs189-20020a6328c6000000b005136987a02esi4884543pgb.728.2023.04.14.07.19.31; Fri, 14 Apr 2023 07:19:43 -0700 (PDT) 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="sHfPEz0/"; 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=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbjDNOKH (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Fri, 14 Apr 2023 10:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbjDNOJ3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 14 Apr 2023 10:09:29 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE63AA5C1 for <linux-kernel@vger.kernel.org>; Fri, 14 Apr 2023 07:08:59 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id e16so4367078wra.6 for <linux-kernel@vger.kernel.org>; Fri, 14 Apr 2023 07:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1681481312; x=1684073312; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ogznRyoPP+056OwMwbae8knri/N8tWTWU74IRb36bJ0=; b=sHfPEz0/Z8hOsH0W31okcmmWVW7Jz8Y7MBvd91H6QX/yi0LPkhBmL+QziymNrCD0Dt mmq7WRi0bd8OGuFzfPgUfuxbLGAeVbXCIJsR2ZuBbjY2qIAVYDd/sk/9LQImUGfNbqTk QxantsEkC1yRH8lL3RGX4H44kjQTt43PfaXxA5mo0kageEjTFRjT8q1r+thXNImrWBT/ FL4HhDcjzi26OsnYpP3u4fTndD1BqrwDCg5yFMXwoy1xFTKlcjjiiU8TirGN+HzWm3Cq FA552QzpLqx+qdOrqkI1Oxhl8tesZX1b0LrifRo3q6RFhs5HBOFtaS/UX9k60yPvJVnb 23zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681481312; x=1684073312; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ogznRyoPP+056OwMwbae8knri/N8tWTWU74IRb36bJ0=; b=e6IqCdJkjPxANCMppixg8eJtdKCG67Ya4wrhPy4KLx04npb9+zIx3Qrx79cMuX2qb0 M4MS97Fuq4TB2xQX8VGjbdYHz3Rr3gNwc2xPYoykN4TeCPjd/cIghPnV/0h6PHrACVHs ReTmENiwJ3GGgd5NA7bT9Y6AGeW1j8HLBL0TNGa7Ot9GwmFyz6kk4FABiI2swDjdVw64 jKA8tFucMS2paao/rVHW8BsCjjqsLRR659z3MWvuL57Aj7wUbP8oOsrPNH9KVT1j8UGa T2uf1OxgoQZcPpsKsssVAKeIf1i9P7ldJ+A0+hvVqxFTmU/AZf1qCB44OuIyByi7pzex JJfA== X-Gm-Message-State: AAQBX9ez0MAhma2IvqzWklRJc0SsdC/Ln0bPgZ/T3ma52bBjhvOLOr3n 3NMMH/lbwk/zf38kpAr5//BLWA== X-Received: by 2002:adf:e48a:0:b0:2ef:4c83:b78e with SMTP id i10-20020adfe48a000000b002ef4c83b78emr7119539wrm.4.1681481312552; Fri, 14 Apr 2023 07:08:32 -0700 (PDT) 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 o5-20020a5d58c5000000b002f47ae62fe0sm3648185wrf.115.2023.04.14.07.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 07:08:32 -0700 (PDT) From: Matthieu Baerts <matthieu.baerts@tessares.net> Date: Fri, 14 Apr 2023 16:08:04 +0200 Subject: [PATCH net-next 5/5] mptcp: fastclose msk when cleaning unaccepted sockets MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230414-upstream-net-next-20230414-mptcp-refactor-first-subflow-init-v1-5-04d177057eb9@tessares.net> References: <20230414-upstream-net-next-20230414-mptcp-refactor-first-subflow-init-v1-0-04d177057eb9@tessares.net> In-Reply-To: <20230414-upstream-net-next-20230414-mptcp-refactor-first-subflow-init-v1-0-04d177057eb9@tessares.net> To: mptcp@lists.linux.dev, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Ondrej Mosnacek <omosnace@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts <matthieu.baerts@tessares.net> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1319; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=94Du3tPB/bRAi77YjNm1E+sPGspDF2pImjBzRfpMGgM=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkOV5ZnxzUZCmm4W6LKU/y/OGltXEBtKUntbAZd abPqNuiHgSJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZDleWQAKCRD2t4JPQmmg czK4EADZTlZwhMw4sDQxk2HQKSNWPPTDQDBWBEvEiAkSXa3HW4mCAEz4MCW+znvv05+henG8DmV AdtFcbeuVrgZiWzPShQUkR/No1m8On2aoEHYPf52GbRXqzBktNWiYE1idnDqOUcYVDz1urBLM51 /YqcPuSmHszvVNWpG2ZHBZ3nMLwHxVtxFuJA4N1tX4Y+aLijYnJqkpnfolwMM0NjJHJUuIrTntA 9Zc/qb4+qu1mtdvW++RBSz7GRqoypv4bGaDLJ0u/nzwLk7YcAbntRyeXioCO1MSKQh9MqKwZ9t+ L0xSkLFbl5f3owh1qCfaSEmCM60i9hZ2BsX7KeXCnOO/O68um2AkTz5BgJlO5O1Pr9vOXNpX4B/ lEYBLj2SzSrb4M+PKY16/TWlFVxS+0tsw3ddWthsmQgFArcHZwjIVcCt8GVGVxYJRftKy+RgAg0 n2Dt0XgSdSXNs4TTIFLl5y4ATXPyuJxSJm7uUspkjHTgwKS9Sf9vOuhjFGtVv3fdAcxSqDYuiuW pgc3zBfMqoB4IFfAnugo90UpjP8jVCYLvyJ4Y5BoeZG5ryWYpc5DN2kjnpD+NR/JD42SEgbciZW oaRda3KsOXarak9Cq8Muz/YginE+PES5quDFIJiYBsrP2GlUtQdh1N6wwo/pBpJGhZWzOBRWmBx eYzbMat2s5xk2Ow== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 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,T_SCC_BODY_TEXT_LINE 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?1763161652358413799?= X-GMAIL-MSGID: =?utf-8?q?1763161652358413799?= |
Series |
mptcp: refactor first subflow init
|
|
Commit Message
Matthieu Baerts
April 14, 2023, 2:08 p.m. UTC
From: Paolo Abeni <pabeni@redhat.com> When cleaning up unaccepted mptcp socket still laying inside the listener queue at listener close time, such sockets will go through a regular close, waiting for a timeout before shutting down the subflows. There is no need to keep the kernel resources in use for such a possibly long time: short-circuit to fast-close. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> --- net/mptcp/protocol.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index a676ac1bb9f1..1926b81a9538 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2953,10 +2953,13 @@ bool __mptcp_close(struct sock *sk, long timeout) goto cleanup; } - if (mptcp_check_readable(msk)) { - /* the msk has read data, do the MPTCP equivalent of TCP reset */ + if (mptcp_check_readable(msk) || timeout < 0) { + /* If the msk has read data, or the caller explicitly ask it, + * do the MPTCP equivalent of TCP reset, aka MPTCP fastclose + */ inet_sk_state_store(sk, TCP_CLOSE); mptcp_do_fastclose(sk); + timeout = 0; } else if (mptcp_close_state(sk)) { __mptcp_wr_shutdown(sk); }