Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1237611lqj; Mon, 3 Jun 2024 14:56:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWqBHH0XqA1e7gKwNmgUXMkpJ3nCiFqITeRh4138Gu4wc1DslQTm++n0PxPYLXFGw8YQn+WLBuAk8YuxdqeHGlpt6BL8xK/LPKDMBE2Aw== X-Google-Smtp-Source: AGHT+IFxPeBx6nbWcmXdDzO84AP5SHBAQe1Z/YorEA+8TeAoLfN1Cv9YNqgQ5lRsQT9SXmPHJbOP X-Received: by 2002:a05:6358:5e9d:b0:17f:6b3f:1b0a with SMTP id e5c5f4694b2df-19b48d6835bmr1134816355d.15.1717451765502; Mon, 03 Jun 2024 14:56:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717451765; cv=pass; d=google.com; s=arc-20160816; b=j3OqC+lJOavbcb1414EvKEFusEYNMJ6bMdiwwh5yhA28W6STe7zeKjiJEkfPy/8xVj iRcF9bvx26YwLBsT6nY6l6kyJYJIEr6KVvqbvV0WDcBVhKS3viZKhlQY4CgczrLxDz1+ WlEL2tIaXhidlk8gvjnqQZjr6Dy8YqLj9tPDvRkIJPk8zv3GK3xsrU3R6p/SeMHAn5KY hUrCnFfM1o9fpABzENgmIcb9OdNGE7rZWoN2SgCFjeGEhiHxlI0tmusqqrkI7D6ACr47 gNt/nbHKIfe2OW5JiRffkn/zGP9lz+n4AGv+8j90N29dTqEkqiHiwbPUAbVUVpLeVh5W GuQQ== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=ZziI2v+i5IGjIKB8mlMLCYTpY3QI/oZfBdzVvUiG3pw=; fh=/OQ4phdel1oSqvc4BGVNZcquq7ZtnNtyaqQV1F9srfs=; b=cDPh/EJT8S5lcFvrqlMR4cCxhzxYUc1KdH1AEW68NZM7qpshYoDL0t4TkLfNOpG5lo nc+bhXusABbwaqbFxIUFYput1Wck0uOJKFFI/N3AW45FDa18Orbeeiq9JJQnbvIKgE2g vOn0NAlf98HZRFMpk8tXf3/XmKy196lWz1HHElFWLTMzdFmWIPRwBa1Sfp78a0PLG2uP fbIypfrqRXC7bzOhTKQS4bv0tX4pPEDqAVdwxq8BZVzBxVwvdUckFVNoyR6bsP7jfXjT 0Z/DZsFQcMeaRLpefearrCR3JGBoB9fNcb3JJj7f4qDs8cDeuQvHtPWI5lOKNh4AMAoc kKpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=qYHIkmV7; 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-199746-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199746-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6ce6056ce96si2043499a12.210.2024.06.03.14.56.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 14:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199746-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=qYHIkmV7; 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-199746-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199746-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4A01DB2528F for ; Mon, 3 Jun 2024 21:50:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 010E013C916; Mon, 3 Jun 2024 21:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="qYHIkmV7" Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (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 B5A4A80603 for ; Mon, 3 Jun 2024 21:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717451422; cv=none; b=Y7hrVGaDssaxC63LByfxF79oMPUpa9k8vgpySaRtYy4ZZ0Xks0h2egDa/HZozJLcM2/Kn4MBE1wZHJyBGUuF4GqIE1I6Jv6KwG32n6VWsmdoKGhvXN3PFVR6jbWP8hUZRDXvihuGnDn4w68bYgveVAERWu0Mph0tBHCRn/3/td4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717451422; c=relaxed/simple; bh=jQETexEejuJ/VAhqGR17NqtTNOI2iX3uh3MiiJifQJw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mNPKRQ8y1vgh3SFjRAbJzDUx857ssXuxb1DQjfTyWugoncEjBpgw5/Wuf2J1p7rRCEg1Lkrgch9DJtTz8B9kOEea6hpUOgqV0ri+wdEivjO0VEtKiRLCCgYYiY1TscECwBKSX+BdN2gClgHGgPVfGGK+v3FU4AvKx0iuzNjYMk4= 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=qYHIkmV7; arc=none smtp.client-ip=209.85.160.49 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-oa1-f49.google.com with SMTP id 586e51a60fabf-245435c02e1so2650271fac.0 for ; Mon, 03 Jun 2024 14:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1717451420; x=1718056220; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=ZziI2v+i5IGjIKB8mlMLCYTpY3QI/oZfBdzVvUiG3pw=; b=qYHIkmV7eR++1Jk87ogdHtjoEcI5ih1MRWLIA3J5MvcNcogA1uejXla+1L9xhQnePr FEOVvJIyyqXHADsMR8Ry+0w6+vaws0JTHn2IVjk9hz8K3AAw4vWrM4OXu2bp00mp0sO4 uTIFOU10bmKcXBYNyAKa7ZM3lX3VldG3zpsG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717451420; x=1718056220; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZziI2v+i5IGjIKB8mlMLCYTpY3QI/oZfBdzVvUiG3pw=; b=Qfh5oG2Q/BH6/tCXxOrFj0KJfWWUTx6s3EAyDDO+rC7I7IZQN7AqWeFvIrx83awUTU C6+g3WnjTZaymvjl4Wnivabcfz5MZLbnKb1/cq8Xrwmsf4aTY/xWjxJ7MIEBZRPnJKJg YfxSa6MTdVBVO0F+FgLsg2MNlw/WljUOH5x2YW/rIDN/6VBtp7Nxi9PKEEzoyeYEGryo VPtXjwh10SD8qT0oUTRvSsznNUPAdSpY5kcOdhdQ+1Sw8s+6yAtpNpr99LmRcJC7253l OqCctUdgKbn1V4GrKhkDon/dsQKoLkDpFYwiyMWgJnCwYOniDiT/hjLE9PzSOkBw90Uv UzXQ== X-Gm-Message-State: AOJu0YzalfOXm9CPGdCGYN599OzXWLzkv7gpeTCsyzH6yk4WaoG+0m1g uucgaYbK/dd6ZyuANEihCkeau6QsWlNl1QFngCKiTaL9qx5myf3I+i+e6oZuqrA= X-Received: by 2002:a05:6871:88b:b0:24c:ae57:b4ab with SMTP id 586e51a60fabf-2508b80dc81mr12624917fac.11.1717451419771; Mon, 03 Jun 2024 14:50:19 -0700 (PDT) Received: from LQ3V64L9R2 (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b09133sm6158526b3a.178.2024.06.03.14.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 14:50:19 -0700 (PDT) Date: Mon, 3 Jun 2024 14:50:16 -0700 From: Joe Damato To: Tariq Toukan Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, nalramli@fastly.com, Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , "open list:MELLANOX MLX5 core VPI driver" , Tariq Toukan Subject: Re: [RFC net-next v3 2/2] net/mlx5e: Add per queue netdev-genl stats Message-ID: Mail-Followup-To: Joe Damato , Tariq Toukan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, nalramli@fastly.com, Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , "open list:MELLANOX MLX5 core VPI driver" , Tariq Toukan References: <20240529031628.324117-1-jdamato@fastly.com> <20240529031628.324117-3-jdamato@fastly.com> <5b3a0f6a-5a03-45d7-ab10-1f1ba25504d3@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-Disposition: inline In-Reply-To: On Tue, Jun 04, 2024 at 12:36:16AM +0300, Tariq Toukan wrote: > > > On 03/06/2024 22:22, Joe Damato wrote: > > On Mon, Jun 03, 2024 at 02:11:14PM +0300, Tariq Toukan wrote: > > > > > ... > > > > > > > I still don't really like this design, so I gave some more thought on > > > this... > > > > > > I think we should come up with a new mapping array under priv, that maps i > > > (from real_num_tx_queues) to the matching sq_stats struct. > > > This array would be maintained in the channels open/close functions, > > > similarly to priv->txq2sq. > > > > > > Then, we would not calculate the mapping per call, but just get the proper > > > pointer from the array. This eases the handling of htb and ptp queues, which > > > were missed in your txq_ix_to_chtc_ix(). > > > > Maybe I am just getting way off track here, but I noticed this in > > drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c in > > set_pflag_tx_port_ts: > > > > if (!err) > > priv->tx_ptp_opened = true; > > > > but what if enable is false, meaning the user is disabling ptp via > > ethtool? > > > > This bool field under priv acts as a flag, means: ptp was ever opened. > It's the same idea as max_opened_tc, but with boolean instead of numeric. OK, but then to avoid double counting ptp, I suppose we don't output ptp stats in base and only when the correct txq_ix is passed in to the tx stats function which refers to the PTP queue? It's either that or we dont include ptp's sqstats in the txq2sq_stats mapping you've proposed, if I understand correctly.