From nobody Thu Sep 18 08:15:34 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:35eb:0:0:0:0:0 with SMTP id w11csp62522uau; Fri, 17 Jun 2022 03:06:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8Ch4zctkdwefKJdn651KxBdwNO5QbPVnDFYWejZbXgFTpS3WD6aTCpX66cBsremNolW5k X-Received: by 2002:aa7:814c:0:b0:51b:b3ee:6be2 with SMTP id d12-20020aa7814c000000b0051bb3ee6be2mr9099948pfn.3.1655460407199; Fri, 17 Jun 2022 03:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655460407; cv=none; d=google.com; s=arc-20160816; b=U0pTBSHl1GOTK5s3bk0W/glD4nRjIW4j056+iRxvmknrQWZm7fBhul1c1nprCs5Go1 vsuVw1yBw/0ai4l7WMdRWq0vRuHtK1uhvHiG86c8OAroR21azWjx8Ol8HgQtNYMUcFMo +YQ+hYvfvNDbcX1HJZoEzFFwpJOD8hVoBJ28IgrWPUi3vVR/V56FwWCeVNyFmb5hZeYw zEXs0FtRxTPf7MvmlUn7NSkxu2MHLVyJ+kXSFUXRn+AAQ/kx+3rXftX0XHUwgjcI2Nhl wTn0tI607/jqpo17qMNpjjtHR9Ca78bBPyL2x0tXOgYr1Wg9JwOUd3fq9Xf1InPLpkH1 OKQA== 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=hk77KEfgHgKPw3EfQ3pSge5zLhlB8DXLkhFlpV5cufnemDs1qOYB+AHrbNMATgI5Hc FXM+WynzkHOl+C0x5+nv+lLPo57PXT0CPMDFqxBaDfvo9+9PVGxhNpU5ZwOsOPlOK756 VXkx6+nHdioN+jLqvbnKNCLjB75goMA7K26OOaENAuMwQs5bhydKyRNISNmEriaUb+AE DXbg3utD8iH4hLPiVChz4/feHmOtk8WSroFRA3TQBjali2Ph1awa2ShTrQssnxMV4YvM gBM3uCzesTaj/xiU9qFhJujSFpz3XYVomWpJMTPHaG3dPu6mRP9Fnmi7OpEbNNUa4mHx nLbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MNWbxLPA; spf=pass (google.com: domain of mptcp+bounces-5686-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5686-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 m9-20020a170902f64900b001620394865asi4680860plg.370.2022.06.17.03.06.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2022 03:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-5686-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=MNWbxLPA; spf=pass (google.com: domain of mptcp+bounces-5686-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5686-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 E58EB280ABA for ; Fri, 17 Jun 2022 10:06:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FC942F35; Fri, 17 Jun 2022 10:06:44 +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 046902F31 for ; Fri, 17 Jun 2022 10:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655460401; 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=MNWbxLPANTC4wVffvyeoN8MWL8U4Dloz82wZfsHWh4ya5ZeUp3/6Q7nmPXrybHLcke9Db9 xGN/AVxq/ttfORuIXb9Stxl/3pjmH/3pp4UHir7OsF7ElxgApGzw5xSwkH098OZnHfyYX8 /Ow1CXS13LPJwosYhRocnSMhTxLRWKY= 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-548-5rHy4HkCOsiCyPG6i7Wp2w-1; Fri, 17 Jun 2022 06:06:40 -0400 X-MC-Unique: 5rHy4HkCOsiCyPG6i7Wp2w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D52B800882 for ; Fri, 17 Jun 2022 10:06:40 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.194.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id F28584010E4D for ; Fri, 17 Jun 2022 10:06:39 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v3 2/6] mptcp: introduce MAPPING_BAD_CSUM Date: Fri, 17 Jun 2022 12:05:16 +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.84 on 10.11.54.2 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