Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5559521rwb; Mon, 14 Nov 2022 06:27:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ML20FTH35DJNnU7hSUFdS5oPpRl6/XkYOiMHiN2/5WN0QkxiQ0NNMbD8+VP4Ez/f5wBSS X-Received: by 2002:a17:90a:ca0d:b0:214:1df0:fe53 with SMTP id x13-20020a17090aca0d00b002141df0fe53mr13763099pjt.214.1668436024706; Mon, 14 Nov 2022 06:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668436024; cv=none; d=google.com; s=arc-20160816; b=kpiunXzFg+JWZ8EXsFwk5tZI1xyQ2bNctqisikLh7GTBbAvYnRg8nzb++48OBkeZcB McgjctiV1oN8+JAksTsSYhwav4hujHwyXAbzdFRMxL8kX83FkuinuiUuGiVdxEHH7y1+ yEL0lhmXsOIaraDROAmarweayM7HKgWuymAAIJoKqEAv491vtz04gE5J1Y8oN3uSSdjF VdS3w/Wfyr9KYnafRKczfFLPzwnyh0QwZWdv9qz06Ye6ZSVyPdtU8SNDB60VrW0nu4n7 yBpGrbVc3oCftbuc0Bh184JIXskmF9w2KLqEiu9CucjmUWweWzwvu/oqmsRI6K81XSb3 LzfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HEWn0hHxqLUr4VDhw38qxu5BAlhd0x0tpVrhUvGq4fs=; b=Qk2347nh2cPJaaGWJYgGJYyVBPidpTzBUM67KzfGw2okHzE0EFBw9gAlcBst6ijRVk TKO2JBIcKxtiDxpZfgLqtFcXHTEtjidg3uSND6kPK4GN2zyrf7ZG4jrHySN3gBWw1rjl i/ITM8PVNTztAoec9TIG+SpGLAVWXlBfJ7kedl7YrUmSkFKo7lpmQ/l/4bg6bFxyKHJy Hq5dgcgCI7bPgO5g59jwK36i+/N83XMuvLLhd281c+fOnfCMX8SSsZsNOwIWNOyzulXa P/6nBKaRcD2PhngbcygCcz3dO0WHyZ+mnYxiNBg18EA9BLtLymNG78HNoOw1Rtl3leRH fBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wysAvnRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t194-20020a635fcb000000b00476879d7d6esi2345976pgb.576.2022.11.14.06.26.50; Mon, 14 Nov 2022 06:27:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wysAvnRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236799AbiKNOIq (ORCPT + 87 others); Mon, 14 Nov 2022 09:08:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235639AbiKNOIn (ORCPT ); Mon, 14 Nov 2022 09:08:43 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162641029; Mon, 14 Nov 2022 06:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=HEWn0hHxqLUr4VDhw38qxu5BAlhd0x0tpVrhUvGq4fs=; b=wysAvnRg1cgDEeYikw+59ARoyh V1D3pIJLLBVigmA9Nk+jFtQh4xlet9hkFJR7qI3SVuN3fFuA5Nv9wc8JdSumUhOzg+gIjVO9p56Pr RqvNyM7EXT57XYGzQ9gcj0CWAKbLCKwvaUab2IpXbNULd4LB62oq9BrZ0ksEOZZRU0hU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oua8F-002LO8-9s; Mon, 14 Nov 2022 15:08:15 +0100 Date: Mon, 14 Nov 2022 15:08:15 +0100 From: Andrew Lunn To: Alexander Lobakin Cc: Shenwei Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Wei Fang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, kernel test robot Subject: Re: [PATCH v3 1/1] net: fec: add xdp and page pool statistics Message-ID: References: <20221111153505.434398-1-shenwei.wang@nxp.com> <20221114134542.697174-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221114134542.697174-1-alexandr.lobakin@intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Drivers should never select PAGE_POOL_STATS. This Kconfig option was > made to allow user to choose whether he wants stats or better > performance on slower systems. It's pure user choice, if something > doesn't build or link, it must be guarded with > IS_ENABLED(CONFIG_PAGE_POOL_STATS). Given how simple the API is, and the stubs for when CONFIG_PAGE_POOL_STATS is disabled, i doubt there is any need for the driver to do anything. > > struct page_pool *page_pool; > > struct xdp_rxq_info xdp_rxq; > > + u32 stats[XDP_STATS_TOTAL]; > > Still not convinced it is okay to deliberately provoke overflows > here, maybe we need some more reviewers to help us agree on what is > better? You will find that many embedded drivers only have 32 bit hardware stats and do wrap around. And the hardware does not have atomic read and clear so you can accumulate into a u64. The FEC is from the times of MIB 2 ifTable, which only requires 32 bit counters. ifXtable is modern compared to the FEC. Software counters like this are a different matter. The overhead of a u64 on a 32 bit system is probably in the noise, so i think there is strong argument for using u64. Andrew