Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1955010pxb; Sat, 2 Apr 2022 09:28:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNVAYVQeTr1VfI9D9lDfw+ziflR7bLZFzVvcQfHMV/k0MA3wG9NgcFXhCpnJNGql002L4u X-Received: by 2002:a63:5051:0:b0:374:5fd0:f131 with SMTP id q17-20020a635051000000b003745fd0f131mr19690134pgl.431.1648916913628; Sat, 02 Apr 2022 09:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648916913; cv=none; d=google.com; s=arc-20160816; b=cfVNqghP54pO+Z4ggW1/HPH+999MJLto8Q0y4DE8vUMP4wp7qnR/yNGIwHViRC7mTN Fbbm9qgMIsvwY4DWY8PHKZV52CetXhhWgW0CtaFf0c1ztrOa6bthTZ/kzWJnoGr3JoUi 8OpgOEel7hFpxK/EflBgO6WWruw1a3KCmhI2dwwbMxV3HLBCTDl9gZEl5Y41JREEeBM5 sS2DGTF30NlbUzUEkPBYeWfFZaqdJr4a4Zyw7VyNxE0a9+PGMU2sCj4HyNmKKpGYIVZe Xvt8f4NRet5aUahcyz6CZP8yWHXljxWENrgqFKMt9u/j3cYI6NNvD6xK8kFc4DhDRt4U n/hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HcEfpUQ3ounoEk46WpuTl4ogomoHLXuRyy0X+DJ0MeA=; b=KZ/SpojAGBwlNLysMhqAD25T9p5T+/cDArk0Wdk9XP1pI2aqE+e+5ZxYIrzQC3j3qq EeoS2QAbP7yospAgMejhoc8khJqyavlTPTweor3w4utUHoLlrpPaAwklbBRJg6wVHjbn ZHFOgwTlQ85vBe5U/Nbwd5aZpRbtcPOwUaqrEaeciwUZHhqmehdQpQgB8kYBUXzckhpg 0sVEGBwPMX8YEIhD6Jsl+lnjHglFaZMY/aaJRjb45+soc4ZyUZ2JHF00LkWD7sRXfNoI E+8xs/nV1xu+l586q+3iPDkRQpiOVCgcORI92IYxgZjSDMBn0TPh7TswgLb58P4QwOEx QWFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JSgJKyOp; 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 62-20020a630741000000b00398677c0d91si5170714pgh.870.2022.04.02.09.28.19; Sat, 02 Apr 2022 09:28:33 -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=JSgJKyOp; 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 S243477AbiDAAYQ (ORCPT + 99 others); Thu, 31 Mar 2022 20:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243451AbiDAAYJ (ORCPT ); Thu, 31 Mar 2022 20:24:09 -0400 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29FEE24B5DC; Thu, 31 Mar 2022 17:22:20 -0700 (PDT) Received: by mail-oo1-xc31.google.com with SMTP id z11-20020a4a9c8b000000b00328fdb15e4aso259860ooj.6; Thu, 31 Mar 2022 17:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HcEfpUQ3ounoEk46WpuTl4ogomoHLXuRyy0X+DJ0MeA=; b=JSgJKyOpJs0xV3p+zEHc4PIOtGNQpU0SC3R4Fm4w0pjs+USel1zNkXnecZYa+hrD2q DyXfwoxngF6ZfKcvBAeuZGtmxzU+ftNi5d8BLmnBJwluC1XX4av9zrcMl4KAlW3uErit AXRY0eyZKFZx1sNOOOxJ4f1qvoX2YfrOLQs7WQm7+eVq7jXcTfOI1ykvxoXSTJIXZTy6 Bk9O6trJeCj9OdWm0H1RFYx3RWYeXTD5sK2BXXhCC5Ly8DM7yAoBd5xeAGdtglXh6NhE 4kd53qDBcJnQ3+GzlTy3qu5Kf+C5LjBuFQoNMF1UYHWBI5ccneOFJu/8CwV65ffEBzPN Z/Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HcEfpUQ3ounoEk46WpuTl4ogomoHLXuRyy0X+DJ0MeA=; b=xsO7iT5NXrx9HgwcA9f8eJ/4e7UIlVTPwhHQC3/jWYztIvLS4N+9AFAAMoyfVFIEHx HUqKTTU43wLUDkoMoP27juaevVrWqKdN++rtzOYEVmvgs6hxpsA3feaVqK9jFvC8V8XQ V2kjwYa0U0dpNs1X42CEcVIWVvL2AKzzLXR0IZ9uFLZdd0hGWSFOQEchIYQZwIbCfhDP LVQb3T7nNz4nFka0wn+9eKjY1ANSKHFxF/+fQaTEr0PaoMHA0sKt/LsjMOdpb61ep7kv QFSNbJPiW4C/E14FZUD1jNnj1N5MKDCG1PyrISm420+QAux3Qe2XqO1Ob54E74BkSm9A vwqQ== X-Gm-Message-State: AOAM531yKa6SP05TFuGSpMOsihVGJDQTa07JSp7emwxjpLkE07Dp8GVF BE5CbfDG1BPPEhPhse9fwgQ= X-Received: by 2002:a4a:4245:0:b0:2da:d703:5561 with SMTP id i5-20020a4a4245000000b002dad7035561mr6019708ooj.57.1648772539475; Thu, 31 Mar 2022 17:22:19 -0700 (PDT) Received: from t14s.localdomain ([2001:1284:f013:f748:287d:843:bb36:1a30]) by smtp.gmail.com with ESMTPSA id s82-20020acadb55000000b002d9ce64bea0sm403698oig.48.2022.03.31.17.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 17:22:19 -0700 (PDT) Received: by t14s.localdomain (Postfix, from userid 1000) id 943811D69B8; Thu, 31 Mar 2022 21:22:17 -0300 (-03) Date: Thu, 31 Mar 2022 21:22:17 -0300 From: Marcelo Ricardo Leitner To: Jamie Bainbridge 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 Subject: Re: [PATCH v3 net] sctp: count singleton chunks in assoc user stats Message-ID: References: <0dfee8c9d17c20f9a87c39dbc57f635d998b08d2.1648609552.git.jamie.bainbridge@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Apr 01, 2022 at 10:09:56AM +1000, Jamie Bainbridge wrote: > 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; Yes. :-) > > > > break; > > > } > > > fallthrough; > > > -- > > > 2.35.1 > > >