Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp867196lqo; Wed, 8 May 2024 18:58:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjHd3hbx5D6bYpyFBSnVB0JZXts/ZFVRsC3p2I7TEbihqE3bORYAqJTqhDEvONYZMXS4VzsqoKfC5fx4VpHJMi5GCeyIJr9zRzq05iCg== X-Google-Smtp-Source: AGHT+IGYE0DkvKayJnI87IbAehJvNLmNyUee2lzK0BtLSAEboETlE9tskcSjZhZFN2T0+DfbFRv7 X-Received: by 2002:a50:a417:0:b0:572:7e7e:4296 with SMTP id 4fb4d7f45d1cf-5731d99aa93mr3277916a12.3.1715219892182; Wed, 08 May 2024 18:58:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715219892; cv=pass; d=google.com; s=arc-20160816; b=ClhUX18a4GEdbWmojwhUOiWBdB9Tqd5+I+wci5YhK2o6fygIy0s6jWTGeExhAuvo0L DK7vrJmLz3azaA+PreHGAQBAzB9rHIRoGFujhA3TO97sdnCSa+Fpc+KTm38LyljOZCsT fgY0RZitgNO8y95/VmexSL9gaMIl0Vxde3aZx6P2b7IUSKASQMHSzxPOVwdmEIi6d3WK c6HvChCucFcUERrTJEbS6JcTYPBeBr2CQZquCoAIoYr5DZqRthE9TmDU4XvdiLFrnGbI Se2MBvujkZ64cLp+XlimTz0nlq65aPBgvjv9qbAx2sca+eUtppWFH4tBMbpJgVcEAA52 gtaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ol07fMm5kmX25Akoa7gDRlXSp7tunorw05f28am+peY=; fh=zVdFWUayRLC2j+1DoJkmR7ummrXfE6iFnAFUxze5nDM=; b=Aq0encwDdk/BLLs0rkKlAtXPlN9oPuhUD6rkumsiN2t1Wtp2v7ErKBrsXpuqYJg9dx JBjM+GaD7SQ3HJf1dGXFaAwnHnaynqGXZ8I5n1RUsGdaqmMqLTopF6Tju31oqqUsVyZZ qXLbCa3o/q9mU7aKeYFxgrPCySVc7irJcwjGHeli1/C2Bk1nIPsxcXkDC3a0uB7tmJsM hrZWW7hMtsczNmqrXbbiYDlH9EGdOmcVzCJ2/Rl6ntuhorWOI0K4Ww9yZhQgzl+3HCwn 76DMKzDM584JEykNLIZHb2wCpieay8vZC4ZddLqqr+9ovzx0THLVN+UgzvicW4YU2er7 xw9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=Sks9IBPE; arc=pass (i=1 spf=pass spfdomain=fastly.com dkim=pass dkdomain=fastly.com dmarc=pass fromdomain=fastly.com); spf=pass (google.com: domain of linux-kernel+bounces-174041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beacac8si219570a12.67.2024.05.08.18.58.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 18:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=Sks9IBPE; arc=pass (i=1 spf=pass spfdomain=fastly.com dkim=pass dkdomain=fastly.com dmarc=pass fromdomain=fastly.com); spf=pass (google.com: domain of linux-kernel+bounces-174041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E66031F22462 for ; Thu, 9 May 2024 01:58:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3433B13C9AD; Thu, 9 May 2024 01:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="Sks9IBPE" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0804E13A3E7 for ; Thu, 9 May 2024 01:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715219878; cv=none; b=LMSVOc23/R7m/FT2gRtB0e+jTqSULxI7b3vb8+SDbwpGTqfLWeSpO5aCmeuO2vZnc31Vzeu2RPEU7Aa5k2tZdFK39p2rjJMyfVjghTCJ3Usu22dbFtV3xGHRkDrA4z1IFd604NGb2UVpkZpEcZnNjnX8YVu4MAaukgTul/FUpe8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715219878; c=relaxed/simple; bh=wFHg8u5STogFH/ZoekFKe0WoCicext3N7WZORQvrdDs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iPBITJI1VBFEsPLD+uhSzfHySHG1V3H4W3U/jUK9r4h3lbZ74KlLy5MzgPs4+9BB0tf0Y6/dob4/lKJjgGst6RFzfO4MjW+tBzy4wVxKnYKyhrcrqcYRWnXEQAurnScu44/ScHfU+yy2wQlOE4bBY4PdUuhYgzkudcihd/KtoFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=Sks9IBPE; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1ed012c1afbso3530935ad.1 for ; Wed, 08 May 2024 18:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1715219876; x=1715824676; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ol07fMm5kmX25Akoa7gDRlXSp7tunorw05f28am+peY=; b=Sks9IBPESymzhpDHLQJlvEDOTLqR7Sh2SV1zfmi50CgRi8JlmGGlInrsBkbzmWyH9p FBOAR9th0E7/yR9V8naV4BOE01GY0GaFneWkzu+GoX8ltYJ5420vWQ37QfywGOyeKX6B QixmprdDDYlnLmotSR3jWskXsiC8iw7E8cqvU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715219876; x=1715824676; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ol07fMm5kmX25Akoa7gDRlXSp7tunorw05f28am+peY=; b=YpTkQGiL/qn9xLri8gqg69uzeVNyTSHiGJze6y7eazTnhPK0BPcmtR61KZKQ2AYsH1 gTdL/YqsUOh3YrvyLojBgRSM3FiftWUMDRL2C3a4phiSwbXNsWhkNFIqbaP+RPIf52Z5 TVg7vB2asEmig7J/IsTon5Z+r2J/Wstn8JXoV0iDKxTkWzPw87xqPTgwPih26smFZJjv AruONgla9PkDJ1HRZZWpK5ZUlj+So54hwbg0OSxBi4mXUvVlO56cX8lux4Z+TNVsXxVv LV7FcFR/qYixlHYfGjVKncSQyCj3I0hGrnSlvsXVE4vTSewZYXCg/f+mHmw46OFGL3LS n4pg== X-Forwarded-Encrypted: i=1; AJvYcCVI95d4PCMmhU1/JfHH5pS+lc94fZ23RMo3crnbrz6SBQsC58RyiF5lU6tbp7N+VOi3qTaUnIsqklgi3LgCmd4dilDvdGFTV3X1p3VU X-Gm-Message-State: AOJu0YzvUcEUPvKPWAV6mpCuR/Bq+ET4KLHNGgpYBGcSySQ9hN9RsMqL 6Fut6xdtADPCRiIyK4G1liX58JxLPbKWZnFoTzqBMFv70OFoXviiGDW0HX2Csw8= X-Received: by 2002:a17:902:cecc:b0:1e5:1041:7ed4 with SMTP id d9443c01a7336-1eefa12f408mr21848865ad.14.1715219876348; Wed, 08 May 2024 18:57:56 -0700 (PDT) Received: from ubuntu (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c25651dsm2083085ad.298.2024.05.08.18.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 18:57:55 -0700 (PDT) Date: Thu, 9 May 2024 01:57:52 +0000 From: Joe Damato To: Jakub Kicinski Cc: Tariq Toukan , Zhu Yanjun , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, saeedm@nvidia.com, gal@nvidia.com, nalramli@fastly.com, "David S. Miller" , Eric Dumazet , Leon Romanovsky , "open list:MELLANOX MLX5 core VPI driver" , Paolo Abeni , Tariq Toukan Subject: Re: [PATCH net-next 0/1] mlx5: Add netdev-genl queue stats Message-ID: References: <20240503022549.49852-1-jdamato@fastly.com> <20240503145808.4872fbb2@kernel.org> <20240503173429.10402325@kernel.org> <8678e62c-f33b-469c-ac6c-68a060273754@gmail.com> <20240508175638.7b391b7b@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240508175638.7b391b7b@kernel.org> On Wed, May 08, 2024 at 05:56:38PM -0700, Jakub Kicinski wrote: > On Wed, 8 May 2024 16:24:08 -0700 Joe Damato wrote: > > > A possible reason for this difference is the queues included in the sum. > > > Our stats are persistent across configuration changes, so they doesn't reset > > > when number of channels changes for example. > > > > > > We keep stats entries for al ring indices that ever existed. Our driver > > > loops and sums up the stats for all of them, while the stack loops only up > > > to the current netdev->real_num_rx_queues. > > > > > > Can this explain the diff here? > > > > Yes, that was it. Sorry I didn't realize this case. My lab machine runs a > > script to adjust the queue count shortly after booting. > > > > I disabled that and re-ran: > > > > NETIF=eth0 tools/testing/selftests/drivers/net/stats.py > > > > and all tests pass. > > Stating the obvious, perhaps, but in this case we should add the stats > from inactive queues to the base (which when the NIC is down means all > queues). If I'm following that right and understanding mlx5 (two things I am unlikely to do simultaneously), that sounds to me like: - mlx5e_get_queue_stats_rx and mlx5e_get_queue_stats_tx check if i < priv->channels.params.num_channels (instead of priv->stats_nch), and when summing mlx5e_sq_stats in the latter function, it's up to priv->channels.params.mqprio.num_tc instead of priv->max_opened_tc. - mlx5e_get_base_stats accumulates and outputs stats for everything from priv->channels.params.num_channels to priv->stats_nch, and priv->channels.params.mqprio.num_tc to priv->max_opened_tc... which should cover the inactive queues, I think. Just writing that all out to avoid hacking up the wrong thing for the v2 and to reduce overall noise on the list :)