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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C03CC433EF for ; Fri, 8 Apr 2022 03:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbiDHDcK (ORCPT ); Thu, 7 Apr 2022 23:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbiDHDcI (ORCPT ); Thu, 7 Apr 2022 23:32:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ED2D32765B for ; Thu, 7 Apr 2022 20:30:05 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id D087B61DB0 for ; Fri, 8 Apr 2022 03:30:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4F77C385A0; Fri, 8 Apr 2022 03:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649388604; bh=CIKp4EBhVeVP5VDWB1RAD8ZdzptsOPckPZjUlBLHpfk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XwAdDjby8DSKA59zpJ9nlXCtzzVZz4lATuvaKgyuDd152/Wyvk1je0HdWk7POI2Kw 6h50go8jW6/Uop9ljlw5ZQZLgQqYoyGLISsRJ2/+HfSZYtKRPFf/mmWNd2TH0V/9qS URuOWMQUE264A//SfbMDj41GBAOYT1KFBYaOZgNhyv6F1lxwU5cvlm0izUHKdnaQZN vO9rSxavp3fUkuiWjzlsNez5+BE4U6V/8jiyiG4EFxTddZObGuFDreUKeCp0DkPPFg FmA7VHD+hTAVXZq/wmyfWxor6ZJZoiLC5GYIPmfGwS987XgBx/QmbLHL6VF3736nKl blFEdF3/Bvgeg== Date: Thu, 7 Apr 2022 20:30:02 -0700 From: Jakub Kicinski To: Lorenzo Bianconi Cc: netdev@vger.kernel.org, lorenzo.bianconi@redhat.com, davem@davemloft.net, pabeni@redhat.com, thomas.petazzoni@bootlin.com, ilias.apalodimas@linaro.org, jbrouer@redhat.com, andrew@lunn.ch, jdamato@fastly.com Subject: Re: [RFC net-next 1/2] net: page_pool: introduce ethtool stats Message-ID: <20220407203002.6d514e43@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 7 Apr 2022 18:55:04 +0200 Lorenzo Bianconi wrote: > +void page_pool_ethtool_stats_get_strings(u8 *data) This needs to return the pointer to after the used area, so drivers can append more stats. Or make data double pointer and update it before returning. > +{ > + static const struct { > + u8 type; > + char name[ETH_GSTRING_LEN]; > + } stats[PP_ETHTOOL_STATS_MAX] = { > + { > + .type = PP_ETHTOOL_ALLOC_FAST, Why enumerate the type? It's not used. > + .name = "rx_pp_alloc_fast" > + }, { > + .type = PP_ETHTOOL_ALLOC_SLOW, > + .name = "rx_pp_alloc_slow" > + }, { > + .type = PP_ETHTOOL_ALLOC_SLOW_HIGH_ORDER, > + .name = "rx_pp_alloc_slow_ho" > + }, { > + .type = PP_ETHTOOL_ALLOC_EMPTY, > + .name = "rx_pp_alloc_empty" > + }, { > + .type = PP_ETHTOOL_ALLOC_REFILL, > + .name = "rx_pp_alloc_refill" > + }, { > + .type = PP_ETHTOOL_ALLOC_WAIVE, > + .name = "rx_pp_alloc_waive" > + }, { > + .type = PP_ETHTOOL_RECYCLE_CACHED, > + .name = "rx_pp_recycle_cached" > + }, { > + .type = PP_ETHTOOL_RECYCLE_CACHE_FULL, > + .name = "rx_pp_recycle_cache_full" > + }, { > + .type = PP_ETHTOOL_RECYCLE_RING, > + .name = "rx_pp_recycle_ring" > + }, { > + .type = PP_ETHTOOL_RECYCLE_RING_FULL, > + .name = "rx_pp_recycle_ring_full" > + }, { > + .type = PP_ETHTOOL_RECYCLE_RELEASED_REF, > + .name = "rx_pp_recycle_released_ref" > + }, > + }; > + int i; > + > + for (i = 0; i < PP_ETHTOOL_STATS_MAX; i++) { > + memcpy(data, stats[i].name, ETH_GSTRING_LEN); > + data += ETH_GSTRING_LEN; > + }