Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2895309pxb; Mon, 4 Apr 2022 01:57:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDuc3+Cey606u3eDBfYfp4Bh6ggcu9lXqKl5ja1HxiwlcsXUK4dwtHVi4mJM3b8j+uisvR X-Received: by 2002:a17:902:ec8c:b0:154:2e86:dd51 with SMTP id x12-20020a170902ec8c00b001542e86dd51mr21700219plg.99.1649062627264; Mon, 04 Apr 2022 01:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649062627; cv=none; d=google.com; s=arc-20160816; b=tnsisTR8y9q1euD/XXrWM3Da2xX1wTDiqSvuRUCEQ45UYFo8f8t6pgRpFxfUGCvpmd aHUIZJxuz6CPCUu5GOcOYnCTLgLU+tkByGpA0ep2NWqj7Lp2VHOj1tIA5ZoGRa0CfreT mxY4Pv52sXKFmA+kdnGX76clESq/rVn2ADkqoyfGD+xNWJXRCWuTNJ65dFu5io9AP1X6 55Tg32y6DRE/B/2w3PDhsqc1HuMieF7pBOpgE0/+XooVbcekjJC8YXL/E4k/LSyW7fsK uun0+edYTQNFORq7AciBjw4vG/zc7BerhYnogSEOI/aIPg+/vGQ0U4KJapg6EatUECkU bW/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iQ35mcHW9PpHQYH0T0kI8l/DH4WYfOppOS30rqmBEbs=; b=VPG2XtnuAgwv+od92HTVtX3TPX9MhS8sBmrmrEwRT165LUZ1Z28JAXZVUNma4xuy65 8WIJ2nS3MsU4Aqvzg5027BR67CL9fy/T+LlllJMpdky+OJV1DhocipYEm7q7dnoz0afk Ndir51nfQSOJxBPMFqq58U/xTG2WmTM2brLAZ83RMujO5nlZcr6Fyc0t70EMSHNYp+Jv HTX2qrsZn/fG8xMHSds3+sELIMFQWalh3G6BDs9rZLr6FDkpF7TZ7AIFZBZeKx62RMZQ 3JzxO9omjNRYbQv8Kq9lcVnIMqQl0N47sjmFwalvcgbztvs7bTwaYUqs7jv1Rqj3ROAb 4/mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="btc/twgw"; 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 i28-20020a63221c000000b00382b764cc76si9248867pgi.299.2022.04.04.01.56.54; Mon, 04 Apr 2022 01:57:07 -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="btc/twgw"; 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 S243261AbiDAAL6 (ORCPT + 99 others); Thu, 31 Mar 2022 20:11:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbiDAAL5 (ORCPT ); Thu, 31 Mar 2022 20:11:57 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99C0E3C732; Thu, 31 Mar 2022 17:10:08 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id g20so1111445edw.6; Thu, 31 Mar 2022 17:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iQ35mcHW9PpHQYH0T0kI8l/DH4WYfOppOS30rqmBEbs=; b=btc/twgw5RlR+yat5KbCqymtiEM/wuE9wnD6UaafOxguLb1AjOIZqAz2abP/yKurZr DcdNPGkFq/Q/ftQOYt9LtkyWEKuGiYTGk4JFi6ElkZSOs4G369jhffT3AG7JpzYLylde ntJCo067c/rNwfhYbOqz/f2G0zGK9MbMiIIrEnIvSC0TwacTH6BriCi831jWo7fLJL1W /qJXnUNN1w3d9dedJYiDzP9VPqyCbnEa+2Ysi3s9lwhqQ+jmmzd7/UoBn46nx/Twqr1J 0kIncpALbxxARdrcHjsA9SG60BAAV85qDKOKnlrCtZfvO3YNsOKADjqdyB4GDl3JV7WB ZTLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iQ35mcHW9PpHQYH0T0kI8l/DH4WYfOppOS30rqmBEbs=; b=NDp+wM36euPSsZY1WYtBmGC4gdrxuNnYjTjpn7hqE6VJ7sRmphOpyvdA0l/0UPzqZh as38XWM3wi8+0eAu1v9daqr0EXvN+d95U+6Vn8u0N/ehkBPBXrbStiVh0DFMaiERb2XS kGuoF4v9a1VtJEwqpySh57XMiqiJclJdQY+gjiVnK/7XB2rkxB4/dHly1Lb7IAAvYaKK 3aO30jQ5uMQpQjVrLnCm/s/3jZzd4VlP8H7PrfA5f6IMJps5CRBZm4eAt3w2G6t3+BoT 0wbZhhodF8zoH9+7fpZqwT14j8E88y6sElvOGmBpKDcgcqt8buRY3GG+QsSgNrePzUq3 z7lg== X-Gm-Message-State: AOAM531SvxFf5AaV5e5mDisWlKPxQFkULhdKX39UgxteeTZxZZXGof7t bX0me5hPCvf/9FRVyPCFqu/TYYQXzrYMw1GFrKw= X-Received: by 2002:a05:6402:454:b0:416:2db7:685b with SMTP id p20-20020a056402045400b004162db7685bmr18669177edw.43.1648771807089; Thu, 31 Mar 2022 17:10:07 -0700 (PDT) MIME-Version: 1.0 References: <0dfee8c9d17c20f9a87c39dbc57f635d998b08d2.1648609552.git.jamie.bainbridge@gmail.com> In-Reply-To: From: Jamie Bainbridge Date: Fri, 1 Apr 2022 10:09:56 +1000 Message-ID: Subject: Re: [PATCH v3 net] sctp: count singleton chunks in assoc user stats To: Marcelo Ricardo Leitner Cc: Vlad Yasevich , Neil Horman , "David S. Miller" , Jakub Kicinski , Paolo Abeni , linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 On Thu, 31 Mar 2022 at 05:44, Marcelo Ricardo Leitner wrote: > > On Wed, Mar 30, 2022 at 01:06:02PM +1000, Jamie Bainbridge wrote: > > 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++; > > sctp_packet_singleton can fail. It shouldn't be propagated to the > socket but octrlchunks shouldn't be incremented then. Not too diferent > from the one above. Ah, thanks for the catch! Is this syntax assigning to error okay? error = sctp_packet_singleton(ctx->transport, chunk, ctx->gfp); if (!error) ctx->asoc->stats.octrlchunks++; break; > > break; > > } > > fallthrough; > > -- > > 2.35.1 > >