From nobody Thu Sep 18 08:03:45 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:35eb:0:0:0:0:0 with SMTP id w11csp1347316uau; Mon, 20 Jun 2022 04:26:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcptEhtHJKoX5GD7Zk3H1cOgv4RMdZxsbhnpgIH4+ZD6XVCeqUdKs3M3Ky91/aSKke5/m9 X-Received: by 2002:a05:6808:150d:b0:32f:662a:f838 with SMTP id u13-20020a056808150d00b0032f662af838mr10633815oiw.32.1655724411852; Mon, 20 Jun 2022 04:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655724411; cv=none; d=google.com; s=arc-20160816; b=mEX80Guzy/NGeoRvE9/WeMwNICd8DfAdIkSIfeVFs6Pzv3r0BCJIf3ZvxsJ3oW3J/K E/6AeI1xkelHZHSemdRvLqAVcenn8BPmrhlUnRy96TBiPbfnoHvEkoZe9CfHQ6auPXs7 WSWIEWZkrQeK/7uUMZYugXf37QSzbXMEeX+Ljb/CIkOxwa4yu9GcEqHopqVoqaisJVHB u7awlC18MC67V8fDg9Nls2cQX/Cr05bkL4aw/WxaWZDcZPMrPMUMJBBijudu0B/ROdCr aFU4gkDK8VGALZECbX0wwWHCbjkrhcgVFIE5aESwLK61Mtx0i2WXYe5NuYur3wje09UU x/SA== 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=eFwqqoY59UyUQ+0GwlcoN4m0DnKOoBreiDH7yFN5PT7KTtF5BONK1oHxTVOnt4TT5Z QwXyYlkqlK2LZLTvwCG/TOPEmo5WFeNDyhLeA4oH4ZMMZIZGxEA5YJ2TI9QOIlNlFzVB TlpWPRErSTyrYpKMpFGDv354TzfK5iHMDVmCePFJGJJumB0mDV5/TWEoiSVpfmXsq5zV PpeLblkXdd8RgeVJf765EK+uWpLHbRTlTK6tcQqpLIYsjUr7MOZpJ6NGa6STbxxvtsOz e/dz8V/SA6HfS2wKFNi5dcpvlgIVAn5s8ihn6ENn6nn8uO2xD6ziZ2o96cWY68O+t3UL S4nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hlispNPy; spf=pass (google.com: domain of mptcp+bounces-5707-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.84.19 as permitted sender) smtp.mailfrom="mptcp+bounces-5707-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from da.mirrors.kernel.org (da.mirrors.kernel.org. [139.178.84.19]) by mx.google.com with ESMTPS id b17-20020a056830311100b0060bff0dff7asi13925861ots.268.2022.06.20.04.26.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2022 04:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-5707-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.84.19 as permitted sender) client-ip=139.178.84.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hlispNPy; spf=pass (google.com: domain of mptcp+bounces-5707-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 139.178.84.19 as permitted sender) smtp.mailfrom="mptcp+bounces-5707-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 da.mirrors.kernel.org (Postfix) with ESMTPS id AF2642E09D6 for ; Mon, 20 Jun 2022 11:26:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7852380B; Mon, 20 Jun 2022 11:26:50 +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 13E207F6 for ; Mon, 20 Jun 2022 11:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655724407; 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=hlispNPyJgve03yVPGdeziP8v6dE26L948bUzPxPkFleIrl0ebO+SZ7zugIrh/lyV84byn YzFl+5lhaEWNiUrYZcNYxcp+9wRYRowoV8gjn2IdAvKOjC5E8VUKHWSy3LxIubdOAuwATa XRAoHhli7pdG19WYd09BtQsFoUnQRX4= 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-512-pISkVIbjMeqhH7CtBKYVIA-1; Mon, 20 Jun 2022 07:26:46 -0400 X-MC-Unique: pISkVIbjMeqhH7CtBKYVIA-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 9DDB91C05AEC for ; Mon, 20 Jun 2022 11:26:46 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.195.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D86740314B for ; Mon, 20 Jun 2022 11:26:46 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v4 1/6] mptcp: fix error mibs accounting Date: Mon, 20 Jun 2022 13:26:31 +0200 Message-Id: <3a7b0695362fe7228484d2a2bc97fc26ca68f919.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" 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