From nobody Thu Sep 18 08:14:48 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a17:907:7811:b0:6d8:2910:9a8 with SMTP id la17csp297512ejc; Wed, 15 Jun 2022 02:17:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v2Cq5ZcSkVeC0eC6reblZtB2SoV5YEL0y7277nVN3QjqTPVLYpZBKSp0eU3DzUZrWI7bnd X-Received: by 2002:a17:90b:341:b0:1e0:cf43:df4f with SMTP id fh1-20020a17090b034100b001e0cf43df4fmr9218194pjb.126.1655284630295; Wed, 15 Jun 2022 02:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655284630; cv=none; d=google.com; s=arc-20160816; b=ZVNEs/MlPoHH0Bt57Nkw2FqasMcalHKODnqcAhQVHOuz9kUXZVSjXhWZH3azB9QZVM t+YhLWnrkNzGl9qP1CJULp29tce/BciGUMAxEyIyc3S6NxS3O1ZmySEQZihAkWTPqBqg MdWu5gbd/H+OtOYYsObjCdtmQEbpGVC3ZDldaqCdcfRS4D1zjfjw0whn3u6YUDw4sSK8 MJfEmypL0zs86Oz58jky2fHFOo2Y7kyEusLq4Rn5ifxeODaw22RzlOb+7do+6VKkhXGk T0OgTzqq7pRPnaCMmNLkrpAowYZdZhD/Ss5RAFjF01/kqxk0RfN1kqRux33G8st7ZRV5 Vpog== 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=xd+iQ2M+TQ8qniPs9pIpL6klOSywMlSfoLyF6VpJMWtKM17l+VIB6K/5sQavm43qM3 /mPf/W4G2sfbc1PT8SVa7JpERHJaIyOXgNRQm+KJGPM7s8XukvawD19BSyEBE9KFSogy 1Xrwoe1nVwJrUR2Sna7NBIbM+pdFSLguW5maWuieHkDWBladp3IDzvvSbXv3U1QRpAUK 94FaVuGKww/tEegZL5y406WaKG3Y68l28Ro/RMNrWAJz5tthgTuBVj9zikpGWuM5Qmsl dFmtw19kooXnFnb0VD5EHs6OjAqTr5yHm4BPQvzLoLkXFCmvDclG0CC96TR6XI3Efy/5 PzoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cXGXnDnw; spf=pass (google.com: domain of mptcp+bounces-5651-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5651-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 p16-20020a170902a41000b00168d7df7949si12648095plq.447.2022.06.15.02.17.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jun 2022 02:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-5651-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=cXGXnDnw; spf=pass (google.com: domain of mptcp+bounces-5651-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="mptcp+bounces-5651-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 B2B09280A79 for ; Wed, 15 Jun 2022 09:17:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C62023BF; Wed, 15 Jun 2022 09:17:08 +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 0BCC923B9 for ; Wed, 15 Jun 2022 09:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655284625; 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=cXGXnDnwO6wwJv3ab2qYz0htP5FfNZOWFrnHft4JcJYp0bWJ3/+GlApYgEzbtTg7aUlIsv wxFnzDerqqa2Qyx6Zs29edYO9swU+poxQIO6JIaPUuiPWaSGVERxa5yfiu46ziEhtzWXlV BQMbLQ8nOyrOTOZPjIGiwcPr2+JvEeg= 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-112-a1DORQrYPAKqhwFPeNlwtA-1; Wed, 15 Jun 2022 05:17:04 -0400 X-MC-Unique: a1DORQrYPAKqhwFPeNlwtA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C75F85A582 for ; Wed, 15 Jun 2022 09:17:04 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.193.220]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0B2EC23DBF for ; Wed, 15 Jun 2022 09:17:03 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net 2/5] mptcp: introduce MAPPING_BAD_CSUM Date: Wed, 15 Jun 2022 11:16:13 +0200 Message-Id: <3f105d23adf857e4cb6d9df08ea92d9104072eb3.1655283387.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.8 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