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 A4D36C4332F for ; Mon, 29 Nov 2021 20:40:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234438AbhK2UoF (ORCPT ); Mon, 29 Nov 2021 15:44:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbhK2UmC (ORCPT ); Mon, 29 Nov 2021 15:42:02 -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 4CE63C0698E5; Mon, 29 Nov 2021 09:17:19 -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 9A04DCE131E; Mon, 29 Nov 2021 17:17:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CE23C53FC7; Mon, 29 Nov 2021 17:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638206235; bh=EJ/491y2sXQi1g7e++9dtTCnZ+NIW/pxkeKhPGvQhr4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=r5sBkG6jS8z1zsNlYMyawzFPioGjVixsVOw0Ii/uoxSHvPUJ8zkb9vwhsUGZB1SjC b5EPq7n6lHSPSWRbJI5Wim0jnfb4TpFra84ABPIm40GZIbacR4r0CjUUUOUA0Q7URx mKyzQC07M5H2ZvE3JrUq4r5HxdQrt04MiTLdNQ5icIIqiAMoT35yQCNlZW46XMphD/ bDOvL8HxJJ/DT9H6LkybSYXMQ/OSKO4aynUXfIJXJNT3hbNwneqPcxnOCH/nec0Fw/ nYyQDuf7GwKxHFHh10RyPRwPGoQHEEqL19lCbB6BFGNV4F4jf+S5XYpKzUl2NqfTeg MYL0mKOyVagGg== Date: Mon, 29 Nov 2021 09:17:13 -0800 From: Jakub Kicinski To: Petr Machata Cc: Ido Schimmel , Toke =?UTF-8?B?SMO4aWxhbmQtSsO4cmdl?= =?UTF-8?B?bnNlbg==?= , "Alexander Lobakin" , Daniel Borkmann , "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 , Jesper Dangaard Brouer , 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 , , , , , , , Subject: Re: [PATCH v2 net-next 21/26] ice: add XDP and XSK generic per-channel statistics Message-ID: <20211129091713.2dc8462f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <87sfveq48z.fsf@nvidia.com> References: <20211123163955.154512-22-alexandr.lobakin@intel.com> <77407c26-4e32-232c-58e0-2d601d781f84@iogearbox.net> <87bl28bga6.fsf@toke.dk> <20211125170708.127323-1-alexandr.lobakin@intel.com> <20211125094440.6c402d63@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211125204007.133064-1-alexandr.lobakin@intel.com> <87sfvj9k13.fsf@toke.dk> <20211126100611.514df099@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <87ee72ah56.fsf@toke.dk> <20211126111431.4a2ed007@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211129064755.539099c0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <874k7vq7tl.fsf@nvidia.com> <20211129080502.53f7d316@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <87sfveq48z.fsf@nvidia.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 Mon, 29 Nov 2021 18:08:12 +0100 Petr Machata wrote: > Jakub Kicinski writes: > > On Mon, 29 Nov 2021 16:51:02 +0100 Petr Machata wrote: > >> IFLA_STATS_LINK_OFFLOAD_XSTATS is a nest. Currently it carries just > >> CPU_HIT stats. The idea is to carry HW stats as well in that group. > > > > Hm, the expectation was that the HW stats == total - SW. I believe that > > still holds true for you, even if HW stats are not "complete" (e.g. > > user enabled them after device was already forwarding for a while). > > Is the concern about backward compat or such? > > I guess you could call it backward compat. But not only. I think a > typical user doing "ip -s l sh", including various scripts, wants to see > the full picture and not worry what's going on where. Physical > netdevices already do that, and by extension bond and team of physical > netdevices. It also makes sense from the point of view of an offloaded > datapath as an implementation detail that you would ideally not notice. Agreed. > For those who care to know about the offloaded datapath, it would be > nice to have the option to request either just the SW stats, or just the > HW stats. A logical place to put these would be under the OFFLOAD_XSTATS > nest of the RTM_GETSTATS message, but maybe the SW ones should be up > there next to IFLA_STATS_LINK_64. (After all it's going to be > independent from not only offload datapath, but also XDP.) What I'm getting at is that I thought IFLA_OFFLOAD_XSTATS_CPU_HIT should be sufficient from uAPI perspective in terms of reporting. User space can do the simple math to calculate the "SW stats" if it wants to. We may well be talking about the same thing, so maybe let's wait for the code? > This way you get the intuitive default behavior, but still have a way to > e.g. request just the SW stats without hitting the HW, or just request > the HW stats if that's what you care about.