Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA01EC433FE for ; Tue, 30 Nov 2021 19:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239375AbhK3Ttv (ORCPT ); Tue, 30 Nov 2021 14:49:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbhK3Ttu (ORCPT ); Tue, 30 Nov 2021 14:49:50 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B48BC061574; Tue, 30 Nov 2021 11:46:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id DD2F5CE1AF9; Tue, 30 Nov 2021 19:46:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 740A3C53FC7; Tue, 30 Nov 2021 19:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638301586; bh=ApZc1+OcZnLq0/E95Na9o4zYk/Nz5een41TdSnFrjdQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UJX2bh+4xhNCn2QNWlJFipczmrFgKctmhXJ7Nz17F+8gO7gray2WfXcyTAilE0wBQ 49r2iTfeFnSSMq06q5ZgOg8ReXMaZLeRad2GqxdGlfXzlz6iIfRif/j2l+aJffEjmt juOonOC8+vT9yjmM48WOyBIWl71TjKGBv+iay+GDPe+l28AcZ08clUbPWqvSNruXVI xbvE+ucHkDg1hAIMV9mzO/873wdfxJm5ga/BfgDsyiB9bPsSC2nE5xPQZEjaoIBywm AXzPCwrR//xXsBrnHzWd3ZMncm4gkZdXrMNyIuRFi4GMdhIfLfKYqP1aBCvMeVFWcq z7VjsQNHR/1+A== Date: Tue, 30 Nov 2021 11:46:24 -0800 From: Jakub Kicinski To: David Ahern Cc: Alexander Lobakin , "David S. Miller" , Jesse Brandeburg , Michal Swiatkowski , Maciej Fijalkowski , Jonathan Corbet , Shay Agroskin , Arthur Kiyanovski , David Arinzon , Noam Dagan , Saeed Bishara , Ioana Ciornei , Claudiu Manoil , Tony Nguyen , Thomas Petazzoni , Marcin Wojtas , Russell King , Saeed Mahameed , Leon Romanovsky , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , Toke =?UTF-8?B?SMO4aWxhbmQtSsO4cmdlbnNlbg==?= , John Fastabend , Edward Cree , Martin Habets , "Michael S. Tsirkin" , Jason Wang , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Lorenzo Bianconi , Yajun Deng , Sergey Ryazanov , David Ahern , Andrei Vagin , Johannes Berg , Vladimir Oltean , Cong Wang , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 net-next 00/26] net: introduce and use generic XDP stats Message-ID: <20211130114624.5b1f5f61@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <18655462-c72e-1d26-5b59-d03eb993d832@gmail.com> References: <20211123163955.154512-1-alexandr.lobakin@intel.com> <20211130155612.594688-1-alexandr.lobakin@intel.com> <20211130081207.228f42ba@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211130163454.595897-1-alexandr.lobakin@intel.com> <20211130090449.58a8327d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <18655462-c72e-1d26-5b59-d03eb993d832@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Nov 2021 10:38:14 -0700 David Ahern wrote: > On 11/30/21 10:04 AM, Jakub Kicinski wrote: > > On Tue, 30 Nov 2021 17:34:54 +0100 Alexander Lobakin wrote: > >> I know about ETHTOOL_STAT_NOT_SET, but RTNL xstats doesn't use this, > >> does it? > > > > Not sure if you're asking me or Dave but no, to my knowledge RTNL does > > not use such semantics today. But the reason is mostly because there > > weren't many driver stats added there. Knowing if an error counter is > > not supported or supporter and 0 is important for monitoring. Even if > > XDP stats don't have a counter which may not be supported today it's > > not a good precedent to make IMO. > > Today, stats are sent as a struct so skipping stats whose value is 0 is > not an option. When using individual attributes for the counters this > becomes an option. Given there is no value in sending '0' why do it? To establish semantics of what it means that the statistic is not reported. If we need to save space we'd need an extra attr with a bitmap of "these stats were skipped because they were zero". Or conversely some way of querying supported stats. > Is your pushback that there should be a uapi to opt-in to this behavior? Not where I was going with it, but it is an option. If skipping 0s was controlled by a flag a dump without such flag set would basically serve as a way to query supported stats.