Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6292469pxb; Mon, 8 Nov 2021 06:22:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOnLeEW4lbZjWyMuM0pSHBKP9i8WBNq0DmmN/cz0tXp9gC+182kMQkKIAKjfoE3We8pdB4 X-Received: by 2002:a17:906:d196:: with SMTP id c22mr215840ejz.231.1636381357060; Mon, 08 Nov 2021 06:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636381355; cv=none; d=google.com; s=arc-20160816; b=vqtt14Vozws9LFM1Zj6oPqhSmi0s1r21Pe357K5a8o2m0AEE7MJYdsAG8VrIp/jwnW UZ5VniRJRahVeDcQntlY1Hfz108CXqUzORKCz0rZoxLbvbQMLfhIe7W8enEna8AuP3zu 63CI3UKkJZWHR6jab7GT5NAx/V6plji6lI7GeuownsWA0aN9l90feLe0/qPcVDXC+aJQ xOhfZOsRnZer6e8LFMAxvlkklWFgOQa0M79vKK2shn6Hk6mR3he9YI9mp3JhgiDy+9mm IQRaj4ReelfTfiqT9AT/tZICQysDYuk8wVsNw4f0suR0jx92AbnEI/5deFOaIn1X6Irs 0qyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=zlpIDeohuxGJKr6/NQGxf0qdewWP/HeI2X9Zoct4WLo=; b=thhED5DbQuIS/0NDPuuZwPhb7wKQVnocJan73oHdF8skwRVLEBnCmACdPQgq3i5MS/ PKAFdpPFsv5NPvb2lL+O8f0Cti4ZrAqPesXrdZV1nHBTJLbneMmPnDuJaaRukHhN8vAb JwNRvY6Egq7O9cubiJS7kd5i8MYrGofDLcPGzGiTxpABpBx4Mn6IEMgL/0SBQS350dzh Gn27bVUuO+pJVpc890f/ArfTsvdK31lRspifcTeytO192+IPRMBZJ50MA9O4QDbPMBzy vVZb/hOuLa2gI27yYHRmBfdcS84JW2iX64f+uX25RYd2BKYxI3YXrWyzYL81d4ZBUqWu KI8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L9mv7Wzv; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc16si30185579ejc.214.2021.11.08.06.22.11; Mon, 08 Nov 2021 06:22:35 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=L9mv7Wzv; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239273AbhKHLkq (ORCPT + 99 others); Mon, 8 Nov 2021 06:40:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42966 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235534AbhKHLko (ORCPT ); Mon, 8 Nov 2021 06:40:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636371479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zlpIDeohuxGJKr6/NQGxf0qdewWP/HeI2X9Zoct4WLo=; b=L9mv7Wzvbe42e1CbAnv05oCbj8xcueiPsoDNZRRpzHHeNz90zepp44MFDAB5Ig2c3VuFh2 V2iePOr5/bQ6OyJrUh0fzeYi+Etn+LUBaymtZQoSoCcSWpeEqNfppdpXhuPnSceCrC7PJw FQX5XIZh1khAGao2jfLbVc3uYq60Ma8= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-qYWbZ6BPP0CZtiAUmjThVQ-1; Mon, 08 Nov 2021 06:37:58 -0500 X-MC-Unique: qYWbZ6BPP0CZtiAUmjThVQ-1 Received: by mail-ed1-f70.google.com with SMTP id o15-20020a056402438f00b003e32b274b24so4090763edc.21 for ; Mon, 08 Nov 2021 03:37:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=zlpIDeohuxGJKr6/NQGxf0qdewWP/HeI2X9Zoct4WLo=; b=qk0Sz4Yu7/SAFrqtKWf2i00ghcEDyMg92Mqt596jSNErTGBHayhQqhAdEZwO3OL3b9 z8HtQEzP6xt91o9C/ya2B3WeY9aYv9oqjA1aZCjFWJCdE4xnLiyHRlmmwE79jwRf7d1e YNG2+tLRjhhY2KBsFqXXAeHV6BocmRsQ8kAinAqjYC0zpVfVZfiRN5fdjkhKRbbh8Hca 6FHOX3nMDRCClLXRM6UrfW6Owykt8Fp3f+KLNhUnF9VzGex3tZuYwzjJfyXQ3BKvXYzi dUFGhv1MxoWeylQo4Ll60zs1s8CC7KkkwSP8sxUaBZ7vncQK7wTMGzv8dEDU5LqwYuzU jieg== X-Gm-Message-State: AOAM531N3KhykxdLyAqqwgaoP6sWhNy3ZuUXM8KChWxxkxA1Mpx1FIeM HWoSk2/VgzavpsrFdezqz18UD9TLtRt5GQeFlf4iXRpbDPiudT/qvFWRevTBJavUigAAw2jtHAV hXkyzU9+1dZkEf4yBoD0XWPod X-Received: by 2002:a50:ff07:: with SMTP id a7mr107385522edu.338.1636371476591; Mon, 08 Nov 2021 03:37:56 -0800 (PST) X-Received: by 2002:a50:ff07:: with SMTP id a7mr107385478edu.338.1636371476247; Mon, 08 Nov 2021 03:37:56 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id sb8sm6393735ejc.51.2021.11.08.03.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 03:37:54 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 2E6B718026D; Mon, 8 Nov 2021 12:37:54 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Alexander Lobakin , Saeed Mahameed Cc: Alexander Lobakin , Jakub Kicinski , "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 , Maciej Fijalkowski , 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 In-Reply-To: <20211105164453.29102-1-alexandr.lobakin@intel.com> References: <20210803163641.3743-1-alexandr.lobakin@intel.com> <20210803163641.3743-4-alexandr.lobakin@intel.com> <20210803134900.578b4c37@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20211026092323.165-1-alexandr.lobakin@intel.com> <20211105164453.29102-1-alexandr.lobakin@intel.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Mon, 08 Nov 2021 12:37:54 +0100 Message-ID: <87v912ri7h.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexander Lobakin writes: > From: Alexander Lobakin > Date: Tue, 26 Oct 2021 11:23:23 +0200 > >> From: Saeed Mahameed >> Date: Tue, 03 Aug 2021 16:57:22 -0700 >> >> [ snip ] >> >> > XDP is going to always be eBPF based ! why not just report such stats >> > to a special BPF_MAP ? BPF stack can collect the stats from the driver >> > and report them to this special MAP upon user request. >> >> I really dig this idea now. How do you see it? >> as a key and its value as a value or ...? > > Ideas, suggestions, anyone? I don't like the idea of putting statistics in a map instead of the regular statistics counters. Sure, for bespoke things people want to put into their XDP programs, use a map, but for regular packet/byte counters, update the regular counters so XDP isn't "invisible". As Jesper pointed out, batching the updates so the global counters are only updated once per NAPI cycle is the way to avoid a huge performance overhead of this... -Toke