Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1657858pxb; Wed, 30 Mar 2022 07:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ8TK68LLybCG60LEA3E3zQLP39Ok0XqtpUmpHRELjhyxbf2irdKo7W0RGFMq4H12DfLid X-Received: by 2002:a17:907:608d:b0:6e1:123f:7a2d with SMTP id ht13-20020a170907608d00b006e1123f7a2dmr9087059ejc.155.1648651979604; Wed, 30 Mar 2022 07:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648651979; cv=none; d=google.com; s=arc-20160816; b=vapvwjRz3pFtdtRO4vRf2J/+/BQoWCmu8MG1chOrmyqaccdi/IceT7IRe9LTrqP4DT imwPdw8Fp8hqaZHUCtBpWMAGCd1Ch9jvR153B1ciRzQZJYSuEHBtCPfQOOX7FM5bWLA1 qH5J8oowdYFkILzhAfvyQUdFAVGOQ3LPNsrsxzipVxH8bsvytRfUeUJINOr00WUVv2Z0 5yiPUxStJnIv6Kff+aPuyRHxfU4RFKJMgtKyyYoOs4bJOOsWkPDknfDdNuQbKh9joijq Wj9DDsw4eHXLCd3aX3qsjFmYkk5/ZWuDdtgCduGrFYIRMSlI2xcjO9lBPjznStmFRH9j 35RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+9nJ17wToVkz2ZPcG9CwbZfW5kPgnDX2ZPn+nnPNEjM=; b=BpcV27y4JoGvU3o2Vb/Xh7SPEeVH7VnXiWPHrd6EdJ7e9b62a1bibL+UBYcYDwN8OL +IQ6hNPe5mKFO0ZTX65bpAF28EAsPvPm2hUtmIJQhz0U13BofQd8OTqBSuFMWLBU06+x MS9ENXunisuRyZpSWoAaywNzU6xzsKqdkOAjBTK6qYdNVe6/VP9Xb5FoDQRmCfTxIctx O+/8D8tm6QXXR1pdDV2pyCShGf0ew4mc16ML40/cNsXQM+O44KYl9DWjHkttpIZL+Lz7 V4XRi7zyLdXq7Px+KGyn9C9OXrHECLIGONF3UyoqJXwgoY8MCkWjwsa1yET81na4ywFX x6tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YIHFHgdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a17090668c500b006dfe2af50fcsi18706320ejr.893.2022.03.30.07.52.32; Wed, 30 Mar 2022 07:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YIHFHgdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242214AbiC3DIB (ORCPT + 99 others); Tue, 29 Mar 2022 23:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232750AbiC3DIB (ORCPT ); Tue, 29 Mar 2022 23:08:01 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7359419B07F; Tue, 29 Mar 2022 20:06:16 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id x31so11004508pfh.9; Tue, 29 Mar 2022 20:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+9nJ17wToVkz2ZPcG9CwbZfW5kPgnDX2ZPn+nnPNEjM=; b=YIHFHgdA6n5W2gWzuxkP+FNng+eXZoaQaWsmrB9/EI8v0sRimGtYE3l8bRMt/4nFjL mLH5Ku+zm/8uWi41VEimc4+wXh6eiM2UeQXbiqClg4nAvKJ1BS1mB75k/2z/E1synHV0 HSOVNFod0/FvprNgcEPPBEk9FVUd691ajUaxp8q8a27sJjuuAKnWuQ9HOFLmW3lmpaxj rcPk4Plz5LhfkHwk4t8XFTxbUxS/OT18gbOlsBN+QDIS29y3RxTifdoYz12IlR9QwM1w iM6EzEb2FArDEiftWl2RvcHHsbA4Lwee58CbLVajegQD3MHPS/+eDRE4qrpPi93POJVK hmYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+9nJ17wToVkz2ZPcG9CwbZfW5kPgnDX2ZPn+nnPNEjM=; b=TeE2R96tdvUlwsPg9PbNQk2Y2rsoQcVJOdSR2fxtocqDK0RUQKrEBJlHWIrhLF4taJ XmjsDUyPQnQPnGhH+ERiDGIo5zCfVC9mXdDg9g4xsLHVSjfuBf4igcYiWbhwMVxLJlOz FADIW1iVwwqDHQho4lD4vtDz5y7zXNkayPw/sYXPv+jdAORV9uynqppPSSzZPfCwi/R8 ZAT00HqXcQpBOmr5QlxoixdzVxqw7pUAdEKtYIBs4E22f+ybKv8WujuBiN7p9TyecFdg ZLlbyg8WMwaYQ2PbN5b+aJyZMdA73y2bvpDMBg6EOqyqztef6GslPhnf1/6XI/fS70ui tNIg== X-Gm-Message-State: AOAM531FT7PsFPtTqgxKvZaSq3iWwEnZ8qCYEGbNvbpa+MWiulzT4imD SnXmO+s0bzaIr15fFOOgXh4= X-Received: by 2002:a63:17:0:b0:37f:f283:24b with SMTP id 23-20020a630017000000b0037ff283024bmr4390753pga.407.1648609575963; Tue, 29 Mar 2022 20:06:15 -0700 (PDT) Received: from localhost.localdomain ([180.150.111.33]) by smtp.gmail.com with ESMTPSA id u14-20020a056a00124e00b004fab8f3245fsm22067326pfi.149.2022.03.29.20.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 20:06:15 -0700 (PDT) From: Jamie Bainbridge To: Vlad Yasevich , Neil Horman , Marcelo Ricardo Leitner , "David S. Miller" , Jakub Kicinski , Paolo Abeni Cc: Jamie Bainbridge , linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 net] sctp: count singleton chunks in assoc user stats Date: Wed, 30 Mar 2022 13:06:02 +1000 Message-Id: <0dfee8c9d17c20f9a87c39dbc57f635d998b08d2.1648609552.git.jamie.bainbridge@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Singleton chunks (INIT, HEARTBEAT PMTU probes, and SHUTDOWN- COMPLETE) are not counted in SCTP_GET_ASOC_STATS "sas_octrlchunks" counter available to the assoc owner. These are all control chunks so they should be counted as such. Add counting of singleton chunks so they are properly accounted for. Fixes: 196d67593439 ("sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call") Signed-off-by: Jamie Bainbridge --- net/sctp/outqueue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index a18609f608fb786b2532a4febbd72a9737ab906c..bed34918b41f24810677adc0cd4fbd0859396a02 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -914,6 +914,7 @@ static void sctp_outq_flush_ctrl(struct sctp_flush_ctx *ctx) ctx->asoc->base.sk->sk_err = -error; return; } + ctx->asoc->stats.octrlchunks++; break; case SCTP_CID_ABORT: @@ -939,6 +940,7 @@ static void sctp_outq_flush_ctrl(struct sctp_flush_ctx *ctx) case SCTP_CID_HEARTBEAT: if (chunk->pmtu_probe) { sctp_packet_singleton(ctx->transport, chunk, ctx->gfp); + ctx->asoc->stats.octrlchunks++; break; } fallthrough; -- 2.35.1