From nobody Thu Sep 18 08:15:35 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:35eb:0:0:0:0:0 with SMTP id w11csp62508uau; Fri, 17 Jun 2022 03:06:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5NheL7JZuGzoKshKF27YnRpOTWkeD2fv/xW2ved3yRIEE++nExvck7erXCoLCuiNoXav4 X-Received: by 2002:a17:90b:48cf:b0:1e8:789c:4a9c with SMTP id li15-20020a17090b48cf00b001e8789c4a9cmr21047115pjb.98.1655460406295; Fri, 17 Jun 2022 03:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655460406; cv=none; d=google.com; s=arc-20160816; b=QF60/xIZcfkDWqlPPAyMgt7mETdKlJ/+X6wRfQqQYnXetVH8SAtNvxqMYK978ODyBR U3+YS57u+6+/csrZDjpneIOWUkCBnnHT2F5mxtsGc7tH3/WSkyIo1DIpwr5zCSY/dn1d KztS3v0+5weH4Eegx1vycr4ydHuhJ4ezp46WkBMCChIybMYCmdcb3MmdA+sEb/+5Pjx0 AbcP86jV/TtKcy6snGgdN7OSIEWas+hXm48g3Q71hjoUmQA5d9q4/0Rgqd96RGvRtmzl AwZtxgC33G7pOr1vOcT/VB7AH1Qg/JyCmykop2eLA2m8ky365/e7/pGqi5S1831hcCx7 fO6g== 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=zduH8uaZcAHo2NbiT8xUZB5EHlogKwIN6MiufFddsms=; b=IfUUGs3h3yGssuzoqz+7k1nmXRXUzTgGxKwuojgIEkR2z1jR95z34KL5lgogsRU8Lv uEiggXFSAU2AnayldGUul4nf0c3HKD0TbUC1StVtvsTdHUhN/iNRqzMBoKUKr1Wb2yAM Myoii4IM8U68kZ+MGGVnJR9ClaJGkhkHhl6cdMV7z+zcLM2NL0vIRfNq21Ug1d9Cw/XS aqvbexgYh4PCkHUbzc64Hb6EAaPHeEpcskIKAtjF9uPhNITCRn+jbx+6HsVaTVLy4GkE Kf4vBktf7KoZqSF2DUKUeE110k5i9/LezkVjRTjq6BpkA6wHGLoSIb2CRPOxl0ULENF8 IYhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GI8ZCLnv; spf=pass (google.com: domain of mptcp+bounces-5685-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) smtp.mailfrom="mptcp+bounces-5685-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 t63-20020a638142000000b00408af01cb44si5477632pgd.124.2022.06.17.03.06.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2022 03:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-5685-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=GI8ZCLnv; spf=pass (google.com: domain of mptcp+bounces-5685-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.88.99 as permitted sender) smtp.mailfrom="mptcp+bounces-5685-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 C772A280A87 for ; Fri, 17 Jun 2022 10:06:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8354F2F34; Fri, 17 Jun 2022 10:06:43 +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 287AB2F2F 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=zduH8uaZcAHo2NbiT8xUZB5EHlogKwIN6MiufFddsms=; b=GI8ZCLnvX253NxPb1Hy0a0vJtKGa+f65/j6lttXBBm8s4njS4lC1j9kvwiVfzOzx/vv8tU zvQ1gBTbE8JCmuelVU6igZLzjnQw2sba6nrJldg2pfrLoxf9OvmKjVM3koEYuhBMZcmo5X KvInyGZjXlShUJ2OUu0rscrJiWI+3Ag= 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-57-lEnw1gHXMTSWxi2etIHTIg-1; Fri, 17 Jun 2022 06:06:39 -0400 X-MC-Unique: lEnw1gHXMTSWxi2etIHTIg-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 AAC03833967 for ; Fri, 17 Jun 2022 10:06:39 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.194.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AB6B40C1288 for ; Fri, 17 Jun 2022 10:06:39 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v3 1/6] mptcp: fix error mibs accounting Date: Fri, 17 Jun 2022 12:05:15 +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" The current accounting for MP_FAIL and FASTCLOSE is not very accurate: both can be increased even when the related option is not really sent. Move the accounting into the correct place. Fixes: eb7f33654dc1 ("mptcp: add the mibs for MP_FAIL") Fixes: 1e75629cb964 ("mptcp: add the mibs for MP_FASTCLOSE") Signed-off-by: Paolo Abeni --- net/mptcp/options.c | 6 +++--- net/mptcp/pm.c | 1 - net/mptcp/subflow.c | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index be3b918a6d15..0bfa6662447c 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -765,6 +765,7 @@ static noinline bool mptcp_established_options_rst(stru= ct sock *sk, struct sk_bu opts->suboptions |=3D OPTION_MPTCP_RST; opts->reset_transient =3D subflow->reset_transient; opts->reset_reason =3D subflow->reset_reason; + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPRSTTX); =20 return true; } @@ -788,6 +789,7 @@ static bool mptcp_established_options_fastclose(struct = sock *sk, opts->rcvr_key =3D msk->remote_key; =20 pr_debug("FASTCLOSE key=3D%llu", opts->rcvr_key); + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFASTCLOSETX); return true; } =20 @@ -807,7 +809,7 @@ static bool mptcp_established_options_mp_fail(struct so= ck *sk, *size =3D TCPOLEN_MPTCP_FAIL; opts->suboptions |=3D OPTION_MPTCP_FAIL; opts->fail_seq =3D subflow->map_seq; - + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILTX); pr_debug("MP_FAIL fail_seq=3D%llu", opts->fail_seq); =20 return true; @@ -833,13 +835,11 @@ bool mptcp_established_options(struct sock *sk, struc= t sk_buff *skb, mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts)) { *size +=3D opt_size; remaining -=3D opt_size; - MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFASTCLOSETX); } /* MP_RST can be used with MP_FASTCLOSE and MP_FAIL if there is room */ if (mptcp_established_options_rst(sk, skb, &opt_size, remaining, opts)) { *size +=3D opt_size; remaining -=3D opt_size; - MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPRSTTX); } return true; } diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 2a57d95d5492..3c7f07bb124e 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -309,7 +309,6 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fai= l_seq) pr_debug("send MP_FAIL response and infinite map"); =20 subflow->send_mp_fail =3D 1; - MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILTX); subflow->send_infinite_map =3D 1; } else { pr_debug("MP_FAIL response received"); diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 5351d54e514a..57d2d8d933d0 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -958,10 +958,8 @@ static enum mapping_status validate_data_csum(struct s= ock *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) { + if (subflow->mp_join || subflow->valid_csum_seen) subflow->send_mp_fail =3D 1; - MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_MPFAILTX); - } return subflow->mp_join ? MAPPING_INVALID : MAPPING_DUMMY; } =20 --=20 2.35.3