From nobody Fri May 3 12:52:58 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a9f:3ec7:0:0:0:0:0 with SMTP id n7csp2365811uaj; Wed, 24 Aug 2022 04:18:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR49h0lU6NI2kjxl03PYoAcEbRvcEx9u5EMuSf8XtE8q3kQwjfgjgOgXokxf5VTKHh1NgRXw X-Received: by 2002:a63:6909:0:b0:41c:9f4f:a63c with SMTP id e9-20020a636909000000b0041c9f4fa63cmr24834712pgc.76.1661339909988; Wed, 24 Aug 2022 04:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661339909; cv=none; d=google.com; s=arc-20160816; b=muqV+J7TY+kJevO3z+aWtaisueYyO/B0cZea3NH4vPdOKjc8jwjnSQwu6VOZty95LZ UhIUB4pNYG0evlCZ3aPXoUMf8xudyFPCsPVpqt7UzKiGEYNpaL3sFolFe/zMVLv0pvQr Sc15eek2UZSkoCpiJa+i+qX34n74Sv4Qag84l3JNOYOzrXEsu/7lScLiGBeRDB3nei4w kjHdfyLYkITAZiaRGf3wjChQyueJdwF0yq0/K/PpHWF1sVatjDPX4sEj4UJcwcwwJ0Kp 4wgz0uUESsh5wsLe3tzQpgy10wWCMGHZ9Y5vGGeYmMMzGnGLniNsBdUmCgJDu7aF18ny wbcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=4K/ilaNjHULF35m8WGbIYb9Dt50PAoquRCu6phEih4E=; b=r375uO59BD7PgRlYZ66PcbC1Gs27TQ+sdR9BrJp7ZGsJeH/GBQAZcIySdKSRdXekmw GSEACg/yzYfChPAdVTMAhZw/3pi9bp5Q6ETfh+nxrG5lZ4PpM4oxBY1I6cv5zX5znhy0 jFTfVQ3DKPIpC6c9lrWyG8CdUZzLv0cp9aXEZSrQEHwbe9UxT2H2Bp8STpSBvWh+aOfh Bi7u8QtZEshC7tVvMTAocWeeAWUv0csbPQkn66wA8ab8H2OMHryt0glgv3jqai01Zsjq tvkn3pY1qUnULX6CyHj2qRfgLd6r7TukCgSBm1eGr+Uk1enqgAG87MrTOv2evavD1det VonA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZjkVPw0R; spf=pass (google.com: domain of mptcp+bounces-6156-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) smtp.mailfrom="mptcp+bounces-6156-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a4-20020a170902ecc400b00172ccb0862fsi15578878plh.88.2022.08.24.04.18.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Aug 2022 04:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-6156-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZjkVPw0R; spf=pass (google.com: domain of mptcp+bounces-6156-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) smtp.mailfrom="mptcp+bounces-6156-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B2B75280C55 for ; Wed, 24 Aug 2022 11:18:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95AA3139B; Wed, 24 Aug 2022 11:18:27 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 322AC139C for ; Wed, 24 Aug 2022 11:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661339904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4K/ilaNjHULF35m8WGbIYb9Dt50PAoquRCu6phEih4E=; b=ZjkVPw0R4CyhKGdV/4/20iMmdSNrLC5p9TMjorunQGdcBXONG4VaPvLrB8NRlcfVUlX/Xi p9Tq0sa0/qwn+PKrGoU+Tnw9pFgIf9qu3kcnsqO7/CFt2U5CBhaLQuqIEqZ40cT8inX/0n ZW3AZp0tAr1lqBq04rBlvrl8BIxxD54= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-Vv3TppSSMMq-u9lKHTSAyw-1; Wed, 24 Aug 2022 07:18:23 -0400 X-MC-Unique: Vv3TppSSMMq-u9lKHTSAyw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 847BC101A54E for ; Wed, 24 Aug 2022 11:18:23 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.194.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14F73492C3B for ; Wed, 24 Aug 2022 11:18:22 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-next 1/2] Squash-to: "mptcp: move msk input path under full msk socket lock" Date: Wed, 24 Aug 2022 13:18:13 +0200 Message-Id: <30ec171851daca06e3c3a60a1d3e41ff5887eae2.1661339834.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" whoops, I forgot to really test for pending data at release_cb time. The above causes several recurring failures in the self-tests. Note that this could affect badly the mptcp performance (as we now really move relevant CPU time from the subflow rx path/ksoftirqd to the user-space process), even if I haven't performed perf-tests yet on top of this change. Signed-off-by: Paolo Abeni --- This should be placed just before: "mptcp: move RCVPRUNE event later"/ the last rx path refactor --- net/mptcp/protocol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 74699bd47edf..d47c19494023 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3008,7 +3008,8 @@ void __mptcp_check_push(struct sock *sk, struct sock = *ssk) =20 #define MPTCP_FLAGS_PROCESS_CTX_NEED (BIT(MPTCP_PUSH_PENDING) | \ BIT(MPTCP_RETRANSMIT) | \ - BIT(MPTCP_FLUSH_JOIN_LIST)) + BIT(MPTCP_FLUSH_JOIN_LIST) | \ + BIT(MPTCP_DEQUEUE)) =20 /* processes deferred events and flush wmem */ static void mptcp_release_cb(struct sock *sk) --=20 2.37.1 From nobody Fri May 3 12:52:58 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a9f:3ec7:0:0:0:0:0 with SMTP id n7csp2365820uaj; Wed, 24 Aug 2022 04:18:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Bug9vDT+2gHLDtAxIui3ynhZVMB31QVGkoSoafDwuM2R59isgM/I8qBTxhnUrYASXFzdv X-Received: by 2002:a65:6a49:0:b0:429:88a0:4c04 with SMTP id o9-20020a656a49000000b0042988a04c04mr23472738pgu.566.1661339911421; Wed, 24 Aug 2022 04:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661339911; cv=none; d=google.com; s=arc-20160816; b=gdRoBVWCJ1CQ6GidsninDeK+BpuqQZ+nxuIYk3zqPIWYS4miESIFv0GXiR0ibwpPut nkZW/FP4Au3Fe+GUUE5pRj28o+3tVeFiLGfXqdUTMiXLXurkrffXOOH9RwqE5UAP9ZCd TB5T6bafhgZ86ERO6232H/2rTvwEy5mzkyWTo+P9sqdjlQbjf9uSzhcmi1mKDsAUympr LiISuWMb2zWcQr5s0p0tEdDozGDj7Gjga8rvpTK/6KnveEKl7adp5vY2zMPnHLSJhJKs DeNuB9GER3opMv6zBHKMrNUDLAmQxflg1kFh5TQWDjZOcL+MbkNPdexlRDUwcUahlCzh UH6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=sA4NgqFVtLhtuschY9R88Cjx4hfhiSukNOUqbDcNRhI=; b=Y69ZookKMfi05nsFvgUZt1tVjUGRHMYD3NNkA/TWrHYnxBbg1OHuRchYfur7DNxhRc Iar7EDbkMiZr3Dll0R6Yj51GpVSlAfJ7Xsi3vb1XNueBdoLeX6i+uW3EzHPVLwVcDit5 IcO2p4EUZIwPH1E6OMTcdvtL57Jevz1iTISgqc0xws8SJFHPU9gIbe/51KKu3YfnI4Uc OKTDVO3RmA56vFxf09oevsOIWWrzAJt4ieCca+4VY2arVx0JUNm3TfPnBNfhbujsX/2K 6yDevJrv/Kc2yHildE1073WAh7+A4sTUJ3pG6y+y9IewkVCJLYNXzl3MwLiR/7eQzBNi JB8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TWYwGYbQ; spf=pass (google.com: domain of mptcp+bounces-6157-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) smtp.mailfrom="mptcp+bounces-6157-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z14-20020a170902d54e00b00172e6c66fa9si9045649plf.555.2022.08.24.04.18.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Aug 2022 04:18:31 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-6157-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TWYwGYbQ; spf=pass (google.com: domain of mptcp+bounces-6157-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) smtp.mailfrom="mptcp+bounces-6157-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D3400280C87 for ; Wed, 24 Aug 2022 11:18:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1EDD139C; Wed, 24 Aug 2022 11:18:28 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4692139F for ; Wed, 24 Aug 2022 11:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661339905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sA4NgqFVtLhtuschY9R88Cjx4hfhiSukNOUqbDcNRhI=; b=TWYwGYbQnPjdrg6oV48kYKw/tfgJFnpJfT6Rk9lWOFhCmgENeHhVtsarJm3wJ1FDRrzij9 bhrAgeWBanzQeW6/0Uoi2+lQA+YkUwQSw9lenm4zyZm8b22/ata44Q0YVuk8KO+KpPTYK7 O/UyxNQVdi2RfEtQYqB79v+mH/yXua4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-AtzR4Xi1MXa3630lbZIJCQ-1; Wed, 24 Aug 2022 07:18:24 -0400 X-MC-Unique: AtzR4Xi1MXa3630lbZIJCQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 476233C0ED55 for ; Wed, 24 Aug 2022 11:18:24 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.194.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB784492C3B for ; Wed, 24 Aug 2022 11:18:23 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-next 2/2] mptcp: never re-inject data on a single subflow Date: Wed, 24 Aug 2022 13:18:14 +0200 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" If the MPTCP-level data ack is delayed WRT to the TCP-level ack, there is a single subflow and the user-space stops pushing data, the MPTCP-level retransmit may trigger in, fooling (disallowing) infinite mapping fallback. All the above is triggered quite reliably by the self-tests, once we move the MPTCP receive path under the msk socket lock - delaying the MPTCP-level acks. Plain TCP is good enough to handle retransmissions as needed. Signed-off-by: Paolo Abeni --- Note that there are a couple of sad untold stories here. The first one is as follow: with the delayed mptcp-level ack, at MPC handshake time we ha= ve: MPC + SYN -> <- MPC + SYN_ACK(1) MPC + ACK(1) -> <- DSS(n bytes) + ACK(1) DSS_ACK(1) + ACK(n+1) and no more acks from the client side, even after reading the incoming n bytes data. So a possible alternative solution would be to tweek mptcp_cleanup_rbuf() to properly handle this scenario. Additionally, possibly, still due to the mptcp-level delyated ack, we could need to tweek mptcp_cleanup_rbuf() more - e.g. do we need to force mptcp-level ack when there is a large enough amount of newly "ackable" data due to __mptcp_move_skbs() action? I don't know. I guess/hope that the condition on mptcp-level window update already implemented in mptcp_cleanup_rbuf() should also cover for the above, but I'm not sure. The other point is that I can't recall the previous discussion about avoiding re-injection with a single subflow. I now think that is bad, at least with delayed mptcp-level ack, and I don't see a need for that, but possibly/likely I'm forgetting something?!? --- net/mptcp/sched.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index 044c5ec8bbfb..409e832085c2 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -162,6 +162,10 @@ struct sock *mptcp_sched_get_retrans(struct mptcp_sock= *msk) if (__mptcp_check_fallback(msk)) return NULL; =20 + /* never retransmit when there is a single subflow */ + if (list_is_singular(&msk->conn_list) && list_empty(&msk->join_list)) + return NULL; + if (!msk->sched) return mptcp_subflow_get_retrans(msk); =20 --=20 2.37.1