Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp154300lqh; Thu, 30 May 2024 18:08:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaxonkeX8RP3RCHuBm/2G+NcQssCCrnp+YpFlKRHcA8Fu0ayzRKNEOQ3AJuRuY4zgYhPq5x3Ly88L5jNk8hGq0PGr3mppwCqXmmzkq6w== X-Google-Smtp-Source: AGHT+IHvn9uFNTKtJ4SlclxUxCsPBgCt3ZESddBrL7jfsVOK8AhTMHYa3dZz5w+jz6rhUH07+Bem X-Received: by 2002:ac2:4e93:0:b0:52b:82d5:b369 with SMTP id 2adb3069b0e04-52b8958e0camr126929e87.27.1717117687648; Thu, 30 May 2024 18:08:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717117687; cv=pass; d=google.com; s=arc-20160816; b=VZsC7AM3SNcJOqyv+SA82zSDEmAdhsHRCFKWZFSXsQWI8KoxkK/BtkPOgDRufrdQHD bp6KRiC7v6OYg5lDKkaPT4rtnF548AXuIY5Zlca3FHuo5QPtUwZglIm3VxZupNJ7qsuo xh+t50Lok2anSdJB+VPNKDrytWpUR+i4KFvMYqSI/PbnWFoDBn4p4gIbIul+1HD9PdoD yeb1DvdR14QUfc9VBzJez//QZXxsWHCFRXv/SNVGUep2Q7Ys8KBjz87ziz7996Jv7bGI GQHTIVw19X7ha3AB14z00/q+kOELlnt+P1GUSTh+S0Ej1HyZIbmJIL4ZPKEp84OSjHL4 5bcA== 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:to:from:date:dkim-signature; bh=m7DdJux/OA+sO1H7974z00i13AM+nm5LXljV0O8GuR4=; fh=TJsQFJd2qeZnck0kUzGAFTljPssKEUU88nieh+Vp9R4=; b=jy6gBYJmvXN4nHJXF+bZT3gmgbIa6BbbPKuRg4P/2TaNDaWg/wkQK5hnilq0DpMo3D 1jGs4Tvyy0FBChAvr+LRYidXaifOdezYqDqINS97dMTysyjTWh7wvtR980Fxmjg+2YOC CwSTD5AFcQy2/OW5+XNe50jgeDoNfQhBRF51xRwO7SIIJ2S9Rm33pCQ57hUzH/c4k3kT 7tZ+sisURgWWk/IOSedbZP9OgrEhqfs0trBDqSfgQ2ksDuBTgPHkY14PI2JPZYlOuOcO mhhuaa8Udp+8It3Qji+/aY+qJCWMWjRROeQloPIjdubGcAudtgZOX1rfkZ92AjOJN+67 zykg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=AhEk8i5w; 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-196120-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196120-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 a640c23a62f3a-a67eaf65232si31905566b.814.2024.05.30.18.08.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 18:08:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196120-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=AhEk8i5w; 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-196120-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196120-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 CC0271F23770 for ; Fri, 31 May 2024 01:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADE1AC156; Fri, 31 May 2024 01:07:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="AhEk8i5w" Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.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 68D8A5C89 for ; Fri, 31 May 2024 01:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717117656; cv=none; b=eCyKuEsJ+fZlyFVC1KqsZcz4BxdvMe8iz490LhKvLEtcydw12oBFoUq4H0flzSnva0pulrP3dl21aG6WdELC7HPFDCndRL9FULelC0mFnsySvoXH1Z8SsbQDLZTQR/BVo4MlL0odbXQahLoK7BfvWscD9fu2o2yZWtQCP22BMY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717117656; c=relaxed/simple; bh=qCoGw48H5JuSeO4/uLKohrazXvqyWkFZ4amkv1FVJNU=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cyV8oXYzjC/2fQRpuMMdkDuFmfcf58uzrBZKmph5j6OPUm74RNIzpZuFAYspSPiC1jSzEzSrFKtgWP53r0jp1+K7vpNEirtuXqjaTsyUo8nrNstrfEe3HVozzeUuYpz88vYJHmTZoEs9JQm+050Sj+khB/NCufNNLBCadY2qyk4= 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=AhEk8i5w; arc=none smtp.client-ip=209.85.210.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-pf1-f169.google.com with SMTP id d2e1a72fcca58-70245b22365so158334b3a.1 for ; Thu, 30 May 2024 18:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1717117655; x=1717722455; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=m7DdJux/OA+sO1H7974z00i13AM+nm5LXljV0O8GuR4=; b=AhEk8i5wkdexFc7yUx99gyWj3Rd79spTea/3galECh7PX96PnKVTFdCrAnRwFg8jWE eXRJ/5KLbbSdXxn+aHs56pA0x1tQEmgiKosV/b6+cUnOMF5YSgY29OmjWnHqM4r2SmGN TdnFqVrGnyQVK4ElA+/agsfW/JPKDtOip2VNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717117655; x=1717722455; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=m7DdJux/OA+sO1H7974z00i13AM+nm5LXljV0O8GuR4=; b=oSZTMUdlQXFyW7437qpeN+/nHUf7oqhztYTWgHAHB6iGmUQ67+IzZ1eIIPR3Qpf5pA lhuM7bFuvBi2IE/qLDnHV4BPKAwyQO8+Wj9QsolzeKKUjPiclNDvwHXbWX0L1oYqqf4p bXPorIctMwgsCr5bc4zhdoxcYLNwH1uVmaNxLqlTo8nDjpjLEiFdK7ZK8I+jUVDNcdwt ZuxtgEsJt333+1cAlA1t9/4F6ylyKYp1jteKzE5EoFRLptN4+X8CQ6bGSs4qhqTwOPnN SsF5Rphx2/loR/tXa9Yc/bMQ+tNKTm6t7YakIQ3YES3neRgY2ufdzGUCpGi0RdMSUe2+ BRaA== X-Forwarded-Encrypted: i=1; AJvYcCXu9z5XCpf1esbNnOV4u7815NbATNHZMcbGMn3Et1ylAaiS3APcV0mXb+2jkza7FXqQCQ3XO+umzMPD3ueRi/v1uEnsdtBLeSBXOZGx X-Gm-Message-State: AOJu0Yy00tXYGkQQVV252rL1NbRQT4aLPrAUoBzOq66AZYPtb0BrqkCJ /6bkHx2EzXeW9s9AZE53O8Kadh7s8glgmddKTYkxEn4nYab06S0T8JNxqZEzlt8= X-Received: by 2002:a05:6a20:da85:b0:1af:a4bc:1f71 with SMTP id adf61e73a8af0-1b26f204cccmr675744637.26.1717117654608; Thu, 30 May 2024 18:07:34 -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 d9443c01a7336-1f63235f081sm4039805ad.87.2024.05.30.18.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 18:07:34 -0700 (PDT) Date: Thu, 30 May 2024 18:07:31 -0700 From: Joe Damato To: Jakub Kicinski , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, nalramli@fastly.com, "David S. Miller" , Eric Dumazet , Leon Romanovsky , "open list:MELLANOX MLX5 core VPI driver" , Paolo Abeni , Richard Cochran , Saeed Mahameed , Tariq Toukan Subject: Re: [RFC net-next v3 0/2] mlx5: Add netdev-genl queue stats Message-ID: Mail-Followup-To: Joe Damato , Jakub Kicinski , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, nalramli@fastly.com, "David S. Miller" , Eric Dumazet , Leon Romanovsky , "open list:MELLANOX MLX5 core VPI driver" , Paolo Abeni , Richard Cochran , Saeed Mahameed , Tariq Toukan References: <20240529031628.324117-1-jdamato@fastly.com> <20240530171128.35bd0ee2@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: On Thu, May 30, 2024 at 05:15:25PM -0700, Joe Damato wrote: > On Thu, May 30, 2024 at 05:11:28PM -0700, Jakub Kicinski wrote: > > On Wed, 29 May 2024 03:16:25 +0000 Joe Damato wrote: > > > Worth noting that Tariq suggested I also export HTB/QOS stats in > > > mlx5e_get_base_stats. > > > > Why to base, and not report them as queue stats? > > > > Judging by mlx5e_update_tx_netdev_queues() calls sprinkled in > > ../mlx5/core/en/htb.c it seems that the driver will update the > > real_num_tx_queues accordingly. And from mlx5e_qid_from_qos() > > it seems like the inverse calculation is: > > > > i - (chs->params.num_channels + is_ptp)*mlx5e_get_dcb_num_tc(&chs->params) > > > > But really, isn't it enough to use priv->txq2sq[i] for the active > > queues, and not active ones you've already covered? > > This is what I proposed in the thread for the v2, but Tariq > suggested a different approach he liked more, please see this > message for more details: > > https://lore.kernel.org/netdev/68225941-f3c3-4335-8f3d-edee43f59033@gmail.com/ > > I attempted to implement option 1 as he described in his message. > > > > I am open to doing this, but I think if I were to do that, HTB/QOS queue > > > stats should also be exported by rtnl so that the script above will > > > continue to show that the output is correct. > > > > > > I'd like to propose: adding HTB/QOS to both rtnl *and* the netdev-genl > > > code together at the same time, but a later time, separate from this > > > change. > > > > Hm, are HTB queues really not counted in rtnl? That'd be pretty wrong. > > As far as I can tell (and I could be wrong) I didn't see them > included in the rtnl stats, but I'll take another look now. I looked and it seems like the htb stats are included in ethtool's output if you look at mlx5/core/en_stats.c, it appears that mlx5e_stats_grp_sw_update_stats_qos rolls up the htb stats. However, the rtnl stats, seem to be computed in mlx5/core/en_main.c via mlx5e_get_stats calling mlx5e_fold_sw_stats64, which appears to gather stats for rx, tx, and ptp, but it doesn't seem like qos/htb is handled. Unless I am missing something, I think mlx5e_fold_sw_stats64 would need code similar to mlx5e_stats_grp_sw_update_stats_qos and then rtnl would account for htb stats. That said: since it seems the htb numbers are not included right now, I was proposing adding that in later both to rtnl and netdev-genl together, hoping that would keep the proposed simpler/easier to get accepted. LMK what you think.