From nobody Sun Feb 8 21:05:47 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:35eb:0:0:0:0:0 with SMTP id w11csp2036979uau; Tue, 21 Jun 2022 10:23:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uxGF3nD2Q8TpKZxzdimKKbPcJrBHdPOxGd33zPm4TJ29xFzaDd1EMstP3Wdxfl8U0B5SeM X-Received: by 2002:a17:90b:4f43:b0:1ea:4356:51bc with SMTP id pj3-20020a17090b4f4300b001ea435651bcmr33936290pjb.144.1655832221084; Tue, 21 Jun 2022 10:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655832221; cv=none; d=google.com; s=arc-20160816; b=Jh8wYzSULk/hZ8keQI5vOH77roIxmzZqR658nQRliuKKyL+AaHdsZ4HNEvLraI+g4H RV3UyNvniHT6JOMaQdYvSezJhO4QIP+UEjUbQ9ihQ80u6YeRc/wAL5emQWpWSIJI8ngh pWVMdITus6SMWuD3Dggnlb7lvrel9RdvsWCz4VMcP+Vwk0oY7CY1qs/LobhfgqH13tK8 s63MjeKnv5/2uIkkHJQMDeY9+E+t1LBHPX5V6GfRXZZwgmPkouX67ysInxjMSie5rxzB 0AJGWBqKS6d4NnG8O5RxGSgdtci8WJ+Dedn6WtvaVACAJYQ2Y2WTbLhanpT0AanX8n2z kKfA== 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=QyEw0Hxej3KhuemgaxQYg9IJahwM7VHtKclJqGNymzw=; b=R0p8qZZ+DEnvz+uXCuhv61z6N48GydkR8lxeeuA4xpD1m0knAUhhpZF6/oMTjRAeNw 2mPjw1th7ca0LZH3/T0O/N+UmZiO6CAU3W2KKkI0WeLVC0MKT4HIU0p8JVHZF+ifLr1z 10ueyleGdoSd8hJKxVY6SfzLGTc4bagy5Sz58YkgtBeAJUfBiF4NRcRddAma+Calvu0y TgPVsYlpaa5F5KF8S00s/3QunnM/tPjpRcfb75C1tcPL9Rj6a5O6Ipt5JqTjLKnbMV5B y7kvSWZgGuiQ65nKF7auDa2cMWpBt/3nhn3qwiVZcsHNMozY59CoNu/PT0JqJiwE4XMf bvhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cYJjZXfU; spf=pass (google.com: domain of mptcp+bounces-5742-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5742-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t12-20020a056a0021cc00b0051bbdb40149si21940233pfj.122.2022.06.21.10.23.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2022 10:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-5742-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cYJjZXfU; spf=pass (google.com: domain of mptcp+bounces-5742-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5742-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 B268D2809AA for ; Tue, 21 Jun 2022 17:23:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 424FC747E; Tue, 21 Jun 2022 17:23:39 +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 C218B4C94 for ; Tue, 21 Jun 2022 17:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655832216; 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=QyEw0Hxej3KhuemgaxQYg9IJahwM7VHtKclJqGNymzw=; b=cYJjZXfU6HQtMFGphXGjOUL0trkhSIu3GMzqjr5goi/pGlMPVRrGWYgstbSymWgNdeLKKC /YxESsQwTYYxQbeP6j5TlRZU1UDYqU60Ze1Eo53IE6OA9CUiAXBi4fp06aZU88v74+NGxq syiHhAYO7DdzeDYvI7WseAeIFKnW8vY= 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-510-YkQ1kXjPOmihwZAKxdjWag-1; Tue, 21 Jun 2022 13:23:35 -0400 X-MC-Unique: YkQ1kXjPOmihwZAKxdjWag-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55F553804510 for ; Tue, 21 Jun 2022 17:23:35 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.193.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F90940CFD0A for ; Tue, 21 Jun 2022 17:23:34 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH v5 mptcp-net 2/6] mptcp: introduce MAPPING_BAD_CSUM Date: Tue, 21 Jun 2022 19:23:13 +0200 Message-Id: <79cfd1117a2697a6376f98913224fd9601e23780.1655829222.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.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pabeni@redhat.com 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" This allow moving a couple of conditional out of the fast path, making the code more easy to follow and will simplify the next patch. Signed-off-by: Paolo Abeni --- net/mptcp/subflow.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 57d2d8d933d0..98b12a9c4eb5 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -843,7 +843,8 @@ enum mapping_status { MAPPING_INVALID, MAPPING_EMPTY, MAPPING_DATA_FIN, - MAPPING_DUMMY + MAPPING_DUMMY, + MAPPING_BAD_CSUM }; =20 static void dbg_bad_map(struct mptcp_subflow_context *subflow, u32 ssn) @@ -958,9 +959,7 @@ static enum mapping_status validate_data_csum(struct so= ck *ssk, struct sk_buff * subflow->map_data_csum); if (unlikely(csum)) { MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DATACSUMERR); - if (subflow->mp_join || subflow->valid_csum_seen) - subflow->send_mp_fail =3D 1; - return subflow->mp_join ? MAPPING_INVALID : MAPPING_DUMMY; + return MAPPING_BAD_CSUM; } =20 subflow->valid_csum_seen =3D 1; @@ -1178,10 +1177,8 @@ static bool subflow_check_data_avail(struct sock *ss= k) =20 status =3D get_mapping_status(ssk, msk); trace_subflow_check_data_avail(status, skb_peek(&ssk->sk_receive_queue)); - if (unlikely(status =3D=3D MAPPING_INVALID)) - goto fallback; - - if (unlikely(status =3D=3D MAPPING_DUMMY)) + if (unlikely(status =3D=3D MAPPING_INVALID || status =3D=3D MAPPING_DUMM= Y || + status =3D=3D MAPPING_BAD_CSUM)) goto fallback; =20 if (status !=3D MAPPING_OK) @@ -1223,7 +1220,10 @@ static bool subflow_check_data_avail(struct sock *ss= k) fallback: if (!__mptcp_check_fallback(msk)) { /* RFC 8684 section 3.7. */ - if (subflow->send_mp_fail) { + if (status =3D=3D MAPPING_BAD_CSUM && + ((subflow->mp_join || subflow->valid_csum_seen))) { + subflow->send_mp_fail =3D 1; + if (!READ_ONCE(msk->allow_infinite_fallback)) { ssk->sk_err =3D EBADMSG; tcp_set_state(ssk, TCP_CLOSE); --=20 2.35.3