From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D803C4338F for ; Thu, 12 Aug 2021 12:20:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB4D06101E for ; Thu, 12 Aug 2021 12:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237615AbhHLMUr (ORCPT ); Thu, 12 Aug 2021 08:20:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36133 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237466AbhHLMUB (ORCPT ); Thu, 12 Aug 2021 08:20:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628770776; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vKmC5YkDRzwBofq4XWda3KBrNPR0n6/8+JsVWcX9in4=; b=TMDAydez17VxF2rJUUDrr5CACgjtKacHqa/71Y74IXKKc6p47+c25uBC78wnaCKuoHD9HF lxBs9AhgTFfl6Xp8y5xbKJsPLkiMJqkaQYaNoDhlEVUVjv9tyf1oghgYSp6gEWQjVZxNjr xfGy7ju3oBB9Rw/ELpeuegPODYVxJmo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-dt2hPUcFNRK_O4nEt-4kEg-1; Thu, 12 Aug 2021 08:19:34 -0400 X-MC-Unique: dt2hPUcFNRK_O4nEt-4kEg-1 Received: by mail-wr1-f71.google.com with SMTP id q11-20020a5d61cb0000b02901550c3fccb5so1762199wrv.14 for ; Thu, 12 Aug 2021 05:19:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:cc:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vKmC5YkDRzwBofq4XWda3KBrNPR0n6/8+JsVWcX9in4=; b=iVv0R789RV1S69OxsneJkA1ZRz2N2QQ3J6BobN43AgiMlGr+neeQhfWK3yXtMM4kJ0 tU58gVMDtK2WVg9GzEaKtQMmBq0Jdlc1VXY+Nef6WskHCJK2E+R11X8p7HtDsuzMDSzt obeE3cMbJN1eKaKbx5hILmpY44KqTqn4Oxir45rb0nUPscnHAdKu+/HuQj5lGeEeFrKz GlmdnpFcR6D9JtpzkOqoj88DHM3uiyYE4tdFaErK1VpnsSS4XtFinAqyohiYl8S9cVBj uQZOqw9Y+FuUa2ufKn26QRZszlvRp83uFepgPlpDfKTLZ72b4zAN53uXlzO7tbX3NaT4 aTqQ== X-Gm-Message-State: AOAM530UAfeq7QiWZcFRjWzDRlf6sF/UoKtCsXnKUxHI42zQw4YtKYsA 2U1g8EzG7WHnwskLK0su2IfiAmQnq3j28sCF494k1Hi00C9cvLvoANop/u0KYq/UwIVyHmFi+A8 2mSPhmWbTPggAMnM2jtmtvosy X-Received: by 2002:adf:e5c5:: with SMTP id a5mr3643741wrn.120.1628770773517; Thu, 12 Aug 2021 05:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh3mpRx4+tSpvGMhZFyCMJkBTd2zX5gzQsxWqA2o8nGoya+6ffI+jOm3RdAsGVpKlF7gwyqQ== X-Received: by 2002:adf:e5c5:: with SMTP id a5mr3643715wrn.120.1628770773253; Thu, 12 Aug 2021 05:19:33 -0700 (PDT) Received: from [192.168.42.238] (3-14-107-185.static.kviknet.dk. [185.107.14.3]) by smtp.gmail.com with ESMTPSA id z15sm2806100wrp.30.2021.08.12.05.19.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 05:19:32 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Cc: brouer@redhat.com, Saeed Mahameed , Alexander Lobakin , "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 To: Jakub Kicinski , David Ahern , "Karlsson, Magnus" References: <20210803163641.3743-1-alexandr.lobakin@intel.com> <20210803163641.3743-4-alexandr.lobakin@intel.com> <20210803134900.578b4c37@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210804053650.22aa8a5b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <43e91ce1-0f82-5820-7cac-b42461a0311a@gmail.com> <20210804094432.08d0fa86@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Message-ID: <5653e19f-75fa-9a94-4b45-0cf110fd6e36@redhat.com> Date: Thu, 12 Aug 2021 14:19:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210804094432.08d0fa86@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/08/2021 18.44, Jakub Kicinski wrote: > On Wed, 4 Aug 2021 10:17:56 -0600 David Ahern wrote: >> On 8/4/21 6:36 AM, Jakub Kicinski wrote: > >> Does anyone have data that shows bumping a properly implemented counter >> causes a noticeable performance degradation and if so by how much? You >> mention 'yet another cacheline' but collecting stats on stack and >> incrementing the driver structs at the end of the napi loop should not >> have a huge impact versus the value the stats provide. > > Not sure, maybe Jesper has some numbers. Maybe Intel folks do? (sorry, behind on emails after vacation ... just partly answering inside this thread, not checking if you did a smart counter impl.). I don't have exact numbers, but I hope Magnus (Intel) would be motivated to validate performance degradation from this patchset. As I know Intel is hunting the DPDK numbers with AF_XDP-zc, where every last cycle *do* count. My experience is that counters can easily hurt performance, without the developers noticing the small degradation's. As Ahern sketch out above (stats on stack + end of napi loop update), I do believe that a smart counter implementation is possible to hide this overhead (hopefully completely in the CPUs pipeline slots). I do highly appreciate the effort to standardize the XDP stats! So, I do hope this can somehow move forward. --Jesper