Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp722309lqt; Thu, 6 Jun 2024 17:19:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/cS1/WHF3C8FyZoOZnod6JVETPPNsDshT6qXPbPjlal4ulHGrsDSg/7SdK17YjMiqNQWFEHGkE/r6tTvQOcTJwGv0y/JirRDJHt+Usw== X-Google-Smtp-Source: AGHT+IHx0wnvhXI9MOSUshZck8D0+Bj4HeitihoF4wEoa+4KhUwFyrIgFzrD1masEY5SglKcuzjR X-Received: by 2002:a05:6a20:3ca9:b0:1b0:225:2b2c with SMTP id adf61e73a8af0-1b2f9698749mr1208510637.13.1717719594945; Thu, 06 Jun 2024 17:19:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717719594; cv=pass; d=google.com; s=arc-20160816; b=DPCgHBz464qKr4UYU0j61UJx18cIl5hAKbSyfG+yl7rHKQYdsc8sNL5DEheG0N09Hy 81ACFm2dCrUB3fYsPGMq9jbSFtcbuX9Zs/8nLkTUL8KjQV6qRa76V8yLeSE+1RUcNIzQ 6rvEzf4yztKc22n2dX2L6ywoQ97ifQUVpA1tJEbB1rF38GIKFW12m9ViuCjecbCBb4me gjs6SB1cqrvSYnogelYRQ/Y0hvzMkdUGCd8D0vGYXUtAZNa5aQx4yiEtfkgseMt99xff d/dMa+qR9Oo1SehQQ1oTXe7cJLT1GxlUnG2DT77gH//YzUM4yhus5uNMaCtgH65WzxFO 6n1A== ARC-Message-Signature: i=2; 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 :subject:cc:to:from:date:dkim-signature; bh=fNX32hcjjNcareZxoo1RJb5PRzSClStKSuhRglk5hFs=; fh=gA7A0ptXHnydcACR4azKCi2/fusyPiA6iKTlIn+UOuk=; b=oM8ipl8x7cK4A+jLzU9owkZHfcFHF3GVHbChLWZtA1/dzuGBh/JzWkQP82r32Otu4I 2FCrq4OCmgFoN3ZnFgzbCLkDV+8sc55wV90L5wFC9I/v9GK5KyPRrHVWm7m+AMaPk/m9 ZT7Z+3WSGVYktqnOrA5huoOTS3I3+2loUUVyIqBrgmOkSeTNoSmD5xVeSkNaB3qdd6K6 /AnLJHD2xRZoOdfQh2Bn+fmOpw78wvJznyQwdgoTZRbmu1TVYKyxmRpORH4nOsXuOhWK pY7XLlOIQDwN6WzoQ1T+GIJ6j5Hs/4C77Ag7A5iZd490H8Wx1JClGdduXOlWigfiDqtb p04A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oiIDII4P; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd57e157si1616972b3a.376.2024.06.06.17.19.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 17:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oiIDII4P; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9007028896D for ; Fri, 7 Jun 2024 00:19:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B20D4C76; Fri, 7 Jun 2024 00:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oiIDII4P" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2C78A802; Fri, 7 Jun 2024 00:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717719584; cv=none; b=fGeYXMPJTx9Zv3EcJzYMd8H3QYBMdLEg8OfB955sCRApFpx9CDzutJ/+OdH7eahsQdpdpRKTS0RltLsBEF+JvOyZqDNwGAU3HqUvP317MF/rcIf+TEE6GcQOL70pbci5u3HWvFl23maC2AVrqBRI4Q5EGHqNaYhe+rpfOqWeQ9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717719584; c=relaxed/simple; bh=g3QH/J1UqGMMgv1UFdPgFNuujOHdUk7CBldWAmkk7JM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=An2lttabgbnJABaCj88d32LQ6UBBovfjVsv7G0D72akbIxytRyoMmRL93Ec4w8yULL3qR5O3cg4z/XtUtdC09CIT+JrDa6s3Aq8iAHsQ0Q6FnmIgzjql2TPrXFr9GORwPUxYkn2+8W7ODrcp3RfHYJrGoKybehJJEi6I6nYT4xE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oiIDII4P; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B6F6C2BD10; Fri, 7 Jun 2024 00:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717719584; bh=g3QH/J1UqGMMgv1UFdPgFNuujOHdUk7CBldWAmkk7JM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oiIDII4P8I3kgYt0Wf6S9xsjVebnxAwTbnApLdPnwJdv7o7zwSjjwbdoxUaGdQgSa 1+rnYpLqGni4g7s2kiXo1VxNITAFaLZ160mNlCPP2AX06NXC5mg7Y9cDHivIG+v3i4 DBTYq4x4H45ci4GnA3MCuRbo+IZ+6t+NHiwWO7hoEqwZ49EeHgcW6lDf4z8xTZUQIE RWEnefG15CzHvoBiAT3iSG6X3HCrXyJTQr4yPSpRRD+wEyK1k6j/4g8kOxQYxuXLxf HLKtKbvSyrlk74Up91TbD9tK9Sj5G8w5STIk25ccja88ZVhBgMimocXROJ4vdUlawq 1dZgvVAMlbmnA== Date: Thu, 6 Jun 2024 17:19:42 -0700 From: Jakub Kicinski To: Joe Damato Cc: Tariq Toukan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, nalramli@fastly.com, Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Paolo Abeni , Richard Cochran , "open list:MELLANOX MLX5 core VPI driver" , Tariq Toukan Subject: Re: [RFC net-next v4 2/2] net/mlx5e: Add per queue netdev-genl stats Message-ID: <20240606171942.4226a854@kernel.org> In-Reply-To: References: <20240604004629.299699-1-jdamato@fastly.com> <20240604004629.299699-3-jdamato@fastly.com> <11b9c844-a56e-427f-aab3-3e223d41b165@gmail.com> 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-Transfer-Encoding: 7bit On Thu, 6 Jun 2024 14:54:40 -0700 Joe Damato wrote: > > > Compare the values in /proc/net/dev match the output of cli for the same > > > device, even while the device is down. > > > > > > Note that while the device is down, per queue stats output nothing > > > (because the device is down there are no queues): > > > > This part is not true anymore. > > It is true with this patch applied and running the command below. > Maybe I should have been more explicit that using cli.py outputs [] > when scope = queue, which could be an internal cli.py thing, but > this is definitely true with this patch. > > Did you test it and get different results? To avoid drivers having their own interpretations what "closed" means, core hides all queues in closed state: https://elixir.bootlin.com/linux/v6.10-rc1/source/net/core/netdev-genl.c#L582 > > PTP RQ index is naively assigned to zero: > > rq->ix = MLX5E_PTP_CHANNEL_IX; > > > > but this isn't to be used as the stats index. > > Today, the PTP-RQ has no matcing rxq in the kernel level. > > i.e. turning PTP-RQ on won't add a kernel-level RXQ to the > > real_num_rx_queues. > > Maybe we better do. > > If not, and the current state is kept, the best we can do is let the PTP-RQ > > naively contribute its queue-stat to channel 0. > > OK, it sounds like the easiest thing to do is just count PTP as > channel 0, so if i == 0, I'll in the PTP stats. > > But please see below regarding testing whether or not PTP is > actually enabled or not. If we can I think we should avoid making queue 0 too special. If someone configures steering and only expects certain packets on queue 0 - getting PTP counted there will be a surprise. I vote to always count it towards base.