Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2762691pxy; Tue, 3 Aug 2021 14:42:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjzbusd2Rvq1BVNj3WRNgPXGldHZptRyJvyqh7PFp2y/khf6xjQtZO/dMwyNf3kV0LJkcD X-Received: by 2002:a05:6638:538:: with SMTP id j24mr20770241jar.59.1628026956524; Tue, 03 Aug 2021 14:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628026956; cv=none; d=google.com; s=arc-20160816; b=DGLd4/90MJ/KtdidQ1iEe68pqUTjzmyZPghMoDuUAcmU5X1+DlGWZxoji6211c0g3a opyZdeEQLqkFQ4xmvpGC/6mSHMFr9RFaQy3Y+EcC5e+/d6C7VXM/LyFlPXrEz9HLmvBZ XH/bqabQyY4/p2qhZqcxIRXdx8pseyPTl4RCpmgaOR49A/wBxxIfBwHkfTey8FDEwwe+ vGSQ5AZcbF8pYHNq0oyutbhRz/1Jb1JN0DXq+73batTUvF/W48lOheh5d+to0d/fi5EA vnGNox73t8hp6Nff46p3Aeh8BJQ0DMS4IJo5x4SSZv/OFxMa0XpvFjh3J8ybxIFbfE7I 3ZoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=aMyJXzHioQcX5zf0cG5YQqNAxYY0nkqs4gcw9cb4gIs=; b=bGubbMpAiaM18ZD7FUCp0mrks3lctESOIcnnTuL6VarshCaziUKDylbEiY1CudLDSy L8cn8enMjEXZugnf8ks3tf9Shd+A0xIicCIJGVOAiY4XePDkX5XFmaeiVK8dkPtlrxeb divQK0L2UvdXFUprrTxhaPhFCdlQ8Z9Hlo0IiRVA8hH/G2XGC1FjjEEHDohrT3cYULUW Woj1SSFeznCUgSSetJJs5o89SxLQskv4QNm3M+cXW+fzhDDJ+rykCjFEYzF286optiii aeECg0bt2VE2KSiXrZos4qoAxOeHqnu3T27EeJclFt1HwJ8oihJ8AP9grQKktj7/tSK4 2IvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A+RmfSYv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si182116ilg.108.2021.08.03.14.42.22; Tue, 03 Aug 2021 14:42:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A+RmfSYv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231410AbhHCUtS (ORCPT + 99 others); Tue, 3 Aug 2021 16:49:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:33650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbhHCUtO (ORCPT ); Tue, 3 Aug 2021 16:49:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F0A9600CD; Tue, 3 Aug 2021 20:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628023743; bh=L2qchuYbxOyp+fqlYH+GFJsXG7DrUHTwSWRLZdczBU8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=A+RmfSYvHE9P11/WJxmxViKPghkRtHhAHs0LjUnjSjnxkmVH2KPrPMiliYT1Bkfs8 eVGh1fEYmTwW4iJl8tmCGV8VlS2/9c/cPG2sgHqZnFiJ9H4o7j3R4OKQEuXvF92pJD ps1GjONP5qzzLDf7Wta6mlOCKhAlOFSlSTsjKw4QmRMgGvTMoovnupuvPzKsvBPj7C DzxzKRUBT7eiWJWoe3bjWJhUYp2A0lzVFV82ceV6lRRQhj9BK2lelnV+g64cZMw89N uOBJqzTMbmKzM1Fnw2DDJGMONk2sl8G2c35MRZsvKlkzHmzuwa539Aow4rDCYRY0Lf FxTqvypFbSmVg== Date: Tue, 3 Aug 2021 13:49:00 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: "David S. Miller" , Jesse Brandeburg , Lukasz Czapnik , Marcin Kubiak , Michal Kubiak , Michal Swiatkowski , Jonathan Corbet , Netanel Belgazal , Arthur Kiyanovski , Guy Tzalik , Saeed Bishara , Ioana Ciornei , Claudiu Manoil , Thomas Petazzoni , Marcin Wojtas , Russell King , Edward Cree , Martin Habets , "Michael S. Tsirkin" , Jason Wang , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Shay Agroskin , Sameeh Jubran , Alexander Duyck , Danielle Ratson , Ido Schimmel , Andrew Lunn , Vladyslav Tarasiuk , Arnd Bergmann , Andrew Morton , Jian Shen , Petr Vorel , Dan Murphy , Yangbo Lu , Michal Kubecek , Zheng Yongjun , Heiner Kallweit , YueHaibing , Johannes Berg , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, bpf@vger.kernel.org Subject: Re: [PATCH net-next 03/21] ethtool, stats: introduce standard XDP statistics Message-ID: <20210803134900.578b4c37@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210803163641.3743-4-alexandr.lobakin@intel.com> References: <20210803163641.3743-1-alexandr.lobakin@intel.com> <20210803163641.3743-4-alexandr.lobakin@intel.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, 3 Aug 2021 18:36:23 +0200 Alexander Lobakin wrote: > Most of the driver-side XDP enabled drivers provide some statistics > on XDP programs runs and different actions taken (number of passes, > drops, redirects etc.). Could you please share the statistics to back that statement up? Having uAPI for XDP stats is pretty much making the recommendation that drivers should implement such stats. The recommendation from Alexei and others back in the day (IIRC) was that XDP programs should implement stats, not the drivers, to avoid duplication. > Regarding that it's almost pretty the same across all the drivers > (which is obvious), we can implement some sort of "standardized" > statistics using Ethtool standard stats infra to eliminate a lot > of code and stringsets duplication, different approaches to count > these stats and so on. I'm not 100% sold on the fact that these should be ethtool stats. Why not rtnl_fill_statsinfo() stats? Current ethtool std stats are all pretty Ethernet specific, and all HW stats. Mixing HW and SW stats is what we're trying to get away from. > These new 12 fields provided by the standard XDP stats should cover > most, if not all, stats that might be interesting for collecting and > tracking. > Note that most NIC drivers keep XDP statistics on a per-channel > basis, so this also introduces a new callback for getting a number > of channels which a driver will provide stats for. If it's not > implemented or returns 0, it means stats are global/device-wide. Per-channel stats via std ethtool stats are not a good idea. Per queue stats must be via the queue netlink interface we keep talking about for ever but which doesn't seem to materialize. When stats are reported via a different interface than objects they pertain to matching stats, objects and their lifetime becomes very murky.