From nobody Thu Sep 18 08:19:17 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:35eb:0:0:0:0:0 with SMTP id w11csp1347325uau; Mon, 20 Jun 2022 04:26:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sv1TgNiq6NhFDBr01OBOPQecd/oFpnmziis7ghMefr1u2iI16bJ6SSZc8Mmq8auFwOpOf/ X-Received: by 2002:a05:6a00:170b:b0:51b:d1fd:5335 with SMTP id h11-20020a056a00170b00b0051bd1fd5335mr23974600pfc.28.1655724412699; Mon, 20 Jun 2022 04:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655724412; cv=none; d=google.com; s=arc-20160816; b=bCf/hyVPZ3VMJcalQtV+mFeDulUSF3lPGEELlO9ANzna9UxTyX9MX6gkupDBg66ATS M/biUS7hK6HkD21Lf66K8aFeJjfXoe2NhiJ6iyQl/Mtzk4itNCP1mhErgzuP8I9At0Es 8BLdixejh11gTjbxZZW5V1kbmzlDZps9dNhDzm0QSHdq/YB8qOFCf+RdNH8po3YJvgr4 n4ChhYQZ/KsEo4BnP3FnJeVSwM2HUAOwzV1eAEocU3v1d/OuuQfvOgvQ7QMZNwSsreUl VCrTLwtZHFD8Yx/NIDPbzSdrhr6iHYkIAPDZn0DafxTZIYsWuTXZ6Dgqr2GSprbaLwzW LiTg== 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=nQKOkYWxL38gArICRY4Ni7rMw5ro75vYSqhNpNat6FA1w27fxFmNacki1BOsaGQiGu Usb9/9CGA9j+OlDrMISCF2A3X9Gd0qWJH5bJgWyTBqGCOwgkm9VnvNaYLdfK4J46p/f8 t/i28qREACnM5j1eRIob77sg7KHL1bAT9xd+zKcvrtkbfDEZoLKwfP+HmI64aUC7H1jm ERgJh0qbiA9R6y5ou1h9pI6XCFJ8Y7BGLWieZJDrwqPA8pjFYREWznxVQWr+9rs/2BGq pVyT6/AeNCRhmUAXe3sco6I5YCSWJ5POLXRa4sWKYn1PuTAUvY4NMkhbhXPwCWxqO/+M GEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SDr++V9F; spf=pass (google.com: domain of mptcp+bounces-5708-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5708-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 r69-20020a632b48000000b004088e9a1b81si14308921pgr.541.2022.06.20.04.26.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2022 04:26:52 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-5708-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=SDr++V9F; spf=pass (google.com: domain of mptcp+bounces-5708-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5708-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 6E145280ABC for ; Mon, 20 Jun 2022 11:26:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 339DF810; Mon, 20 Jun 2022 11:26:51 +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 EC84180F for ; Mon, 20 Jun 2022 11:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655724408; 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=SDr++V9Fyrf467zn94kTu2MYA5+0jyEicP5WbJVIMkLHwbikB9j+LVfvfzxD+RhN3OtL4F ir2Lef0I3wBoDYa3vmb+qk/n0GIU7ArD+LLl03QWkgS37nfpWfaEEi74GxRmn+UroGQsOm JhBLDK5EEuAo6jEjxXCwjL0+CpofVBo= 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-581-zj5HxCBLPeWZ4FheSGiPGg-1; Mon, 20 Jun 2022 07:26:47 -0400 X-MC-Unique: zj5HxCBLPeWZ4FheSGiPGg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F6C685A580 for ; Mon, 20 Jun 2022 11:26:47 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.195.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id E37AA40314B for ; Mon, 20 Jun 2022 11:26:46 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v4 2/6] mptcp: introduce MAPPING_BAD_CSUM Date: Mon, 20 Jun 2022 13:26:32 +0200 Message-Id: <79cfd1117a2697a6376f98913224fd9601e23780.1655723410.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.10 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