Message ID | 20221115155744.193789-2-shenwei.wang@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2814782wru; Tue, 15 Nov 2022 08:11:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lRFSjVfgm9DW98wgrb1YbLscY+43JLMId9c75z7/AO2guvMk2GhR/70D1RcyOeRnl7z5a X-Received: by 2002:a17:90a:ad96:b0:217:f784:689a with SMTP id s22-20020a17090aad9600b00217f784689amr3124397pjq.0.1668528674791; Tue, 15 Nov 2022 08:11:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668528674; cv=pass; d=google.com; s=arc-20160816; b=Oowc3LH/nY4x6RoTFfUowWEC83c5oql7SnCIgB1ts31e7Re/jtd+L+uEN2A/2wI6du gGilQGRK/4x+7p4gIu3RGpWFc7C0/86bZYXxMO/NZ8LZPlYrALwDoTu5IR1GM3sYR/W6 5EFcINai1eqQNnYGVL7tmAHL2KB1JB3+7s5PPHCBvkoVSyxpX8h9JSUyLuTk+vzDrz5e iY0ovXKZmC6vUhaABeWG04bb//0sbIGBRXlfSJSFJPL0uF3oPHGhUdC0ZziVuQYeN6iB /l5IhH7GMiU3PRsMDLFCnJQwo0msxUGVcoWkxnK9MlPPJJtR2kci0jn2GMkeSeedj2AL NhZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=25xDlwa8FLh4KnY3G2hZMn4siFAizlq83ldQ6RuVf3o=; b=azlQqJzMySWlOmkN0dpQJxISayegISa+lX8Wi89fYV0vRcrm9Hxnlb0xbsAxuDY0He mbXp69WRQcEc1JC5sH7mixmRf8bOqCGS1V0MCwGjgALwaayhW0iDyPhSITQuyvoZpKi4 zGB7o03rDodiMl+qcx9B6AmhGyDpjJvGx7icFKV26LPCwvpKt9qtkOtUGLK8shixtynM hmPWahM9AT4Z3TWmLuNaR8pRaKRSVM97koQ6SnEqHewNqjTNNcUu8wOT3wUuzcdGvqDe wzx0wH2BFE6kZlAWoOdxf4vle+pErToFD5C+Jyh/TIJekvntXLHX6XD2yq+mVWJ8Rxv7 xr0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=KOeYfQHc; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a630b01000000b004708630981asi12990425pgl.353.2022.11.15.08.10.58; Tue, 15 Nov 2022 08:11:14 -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=@nxp.com header.s=selector2 header.b=KOeYfQHc; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238482AbiKOP6l (ORCPT <rfc822;maxim.cournoyer@gmail.com> + 99 others); Tue, 15 Nov 2022 10:58:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238029AbiKOP62 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 15 Nov 2022 10:58:28 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2063.outbound.protection.outlook.com [40.107.21.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 709BD2ED5C; Tue, 15 Nov 2022 07:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bN6LEdxrXKJGWjyCF2oLiYAnD1FP6l7daF4liXtrzkckIgRFWq6FYNkIq+hAVYQnFm7hB1BDpRE9RqUALvT8hHcPdOoVQCGPRAOc/CoYubcmnfyvNaggDQ7vYUFRZeAl0bIp1ZOHoWfrR6q+3iL6M7v2y79/PISR2PcVO6NqkwNbzAHcwxynQCtyWM1R4OSMbgd3QqPTuq/bXsdEg98ZC9KzhU+qwKSyRTx/LHk2dNYXc3cM0TTfSiZiQ/jKzI44r6QNLG1Kg42m8hzIbD+4adoHXi2Dh+KdoF0q0i4IHVnhaiPMpJ03VIJhlmqegSUfUxfMDyiPxCdoXaDFy087Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=25xDlwa8FLh4KnY3G2hZMn4siFAizlq83ldQ6RuVf3o=; b=Y9YT2rDVGccXDEDmwPjD4aXI9tSgeP7kmfAxj7nhlTh0mDXom4+qSet/+15OeTE0vdz3olRP/6pquWfvvBqUzcK/aLAE9hnKnhEgedSb5tESbkY+H3mCmzwpROzrBmlL/q78E6j6RDAhBdId+/o3RqQ/5I1WQiyydPWyiWHao0C3cVTwzMEXHCwU28QQA1ig1ochLFZvVxK8fpkr+RJaCPp70y4R6lFIPrK6os6gv3RE/1rmtWSv6wovsSxL0Mraw3vDTyoJd3AI2///85w6Gs/9Kwj00iO17Q34QL78eieSXK1/W3ZpBHahQ3zzXR4g369/tjbfhwNospnnEPzyaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=25xDlwa8FLh4KnY3G2hZMn4siFAizlq83ldQ6RuVf3o=; b=KOeYfQHcMhI2bvM8hrLykslLTtG5zWottACfTEi1/q2Yu8WZVT5uQUhpdNEK+yF/DrvH+1Rajd41w4bYkL5G2SzDo4cJZ+zF2P9aaNW/Uou0nKQcyDPZPgsU6GozneExbeCfWkQV4Xg2ivhHVjpohXtxjDjMLC9TtFYdtdXz+oE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by DBBPR04MB7690.eurprd04.prod.outlook.com (2603:10a6:10:200::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Tue, 15 Nov 2022 15:58:18 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::6b44:4677:ad1d:b33a]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::6b44:4677:ad1d:b33a%6]) with mapi id 15.20.5813.018; Tue, 15 Nov 2022 15:58:17 +0000 From: Shenwei Wang <shenwei.wang@nxp.com> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Jesper Dangaard Brouer <hawk@kernel.org>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Shenwei Wang <shenwei.wang@nxp.com> Subject: [PATCH v4 1/2] net: page_pool: export page_pool_stats definition Date: Tue, 15 Nov 2022 09:57:43 -0600 Message-Id: <20221115155744.193789-2-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115155744.193789-1-shenwei.wang@nxp.com> References: <20221115155744.193789-1-shenwei.wang@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR08CA0030.namprd08.prod.outlook.com (2603:10b6:a03:100::43) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|DBBPR04MB7690:EE_ X-MS-Office365-Filtering-Correlation-Id: 60facf98-beb6-4b77-cd9b-08dac7223614 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1bJuG8LB9RLuejUKIcfYMcBlhytNwNbmzXUCqRb5q8nwE6lNCyFP+/cLE909/X+Mq5agFkahY4ZoHuNB07IT0iyo3hEpAT8Eoa9UFha3EScaoOd9roZp2VL6sPyaOPYtfVRW5R0kQC7W43En3Nwpp3xuoE8tYa3WsYucHWO7KHNM11FF1oFuix4BwdbDHbQMcRPRNxOkr1beTnvVotOcGkK9oIH6ISI8SsQWuqf27GKnt4vPEDzkABo5PbjOy34+OxKVx/borFpmoC2HIJwYMubKWrkNf5Guz1eOGmUAYuMhTxL55KBcOgjG3oZB+sVBhQH23x1ChqAeEHGpERBESbD63APrwKJOiOi2OsURNU8HZq/g0PFLFHYVh9v/UhZmJgfYVOwgRXmMA6QYdK/6Hpsl7K22el2+075avlt151rCHsitGozrHjnOAJ5TYNgBBK7D2Jg5adFHVcSM6dE7Ibwt7tD3AnyJCankT9lEQgv9xi+RipVtQU6ALApV2mFOsPkBqx4DV4H6dcKJ0MGdTL6IOLtBEylwyIkIcvyFOJhFbB1eOK7yAQWZdo8YkzAXJNdWSZsYIKaaYRHh7D+gtElUROAKWUvMmHKG6LKDnzLadNGtRZHM8K42OEwKM7wdXgV6CPmXUAStaWm9Yu7NqOmBCcIHCSFmeHdqmbXk/2A0bj0E1r6SGDbIEjLGdSiFAlO4gJYgT8VVLGy3tsIvPEYuKF2QULiVYJQno6qEGXvpqaIUeqhgyZpgNdYj058IwPLLRJ30hnQgoSERRkf3dA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(366004)(396003)(346002)(376002)(39860400002)(451199015)(36756003)(6512007)(186003)(83380400001)(26005)(86362001)(2616005)(38350700002)(5660300002)(38100700002)(7416002)(2906002)(44832011)(41300700001)(8936002)(4744005)(478600001)(52116002)(55236004)(6486002)(316002)(1076003)(54906003)(110136005)(66476007)(66946007)(6666004)(6506007)(4326008)(66556008)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QpmWGvBghVNJSP9rySjTyIzIiFEyHFeJh6YnbG3w1D2n09DKddnz6xRIj9PFYj1FU+qkhpSW1tPOysCdsoLx7WC+obcJmxKvUyhMvbFZA44U9iJe4//FciVoORnFxhhlJVTsCHPkcizWdi+0PEmsphNF/I8HNb/CgeiyzCq5JaDwkErKNVHfI0Wr5nj+5dRafMb8Sz7xd+HWKDBLGuYK8S6kPjF5/bxeWY+tUaQ4GBEebihI2H1G+Ng8IfVKV7//ddVRtuj0qFrZATpQecv0nx56Lrg+lgbGPh3g5BAJrRrDHA6GDewpUN6jDPpVR1kZ0MY3xZg6gKBbBWOudMDlhjkP2FIS6hs+A2AOmk8RtF2X2dclTF18ZrW0ZsN1afPbCld3eW14ArRO4rBjCjYR8dw7UIp2wzR/pydlKjXWqQsNnHmrNB32NM0sus9YJ3Kc4u+R1CIiXFJFt4kD4gM1ah307A5EEA7X8CvnAjWY7F+0hJDmqVLYsjZPzUVY8zk+DJrJ75kKLrX1zbBw+3oexOUBWdkJQTH2isRNmx/jdPN4vCr8zoA/qzqauuJ0OvN9xpYw5PTZxlXKP19y81D8vNu+xqbzXHEDzNoiWABoL9rMxhjfCaDD5vr9GSICQTloddjWTJCnG4itbpLlwhJdvxfhXwsPblSpgP95RXw0VJzQMtQNPZsvImaZtNn+b2VKSkUSWjAYcRBwcNoyMmRrlMAKbKYcQuQI0lVHgDimxKuI78SRkNXcC8nXkgx7BYnnzl9cYzteMsz7E+AkOojkqzqpRLp03/PepXCUWcPm+A8HBAeNobWPDV8j32OayipOBCSe7/4kAA4AGdtoCsu3omS4PhimPpLRou0ydeeWwKkQkSY8Dm8+e3i7X/89H44bow/tE8b4S7Ap12tkrkIJ8M9LVpg7LT5HWweH0R0Pd11gCHpj8hG3QYBr+Z1rF52ph/o9y5T/TRFL1ZPvkXWmeQr3TjVub3hjc/4quWr9oO3V2bl2OBbHAQypHDuNkJ6LM1xeEbuE9vZQt7qELoCmku0EB78/H87vnUGFvkzZ4d7046QlyDVZmwCPbKUnRK9vPRSNDI4ijyLYpZZ10v+Q5xYl/zxUoG1Mtz0qOWPWku72JX9CNlUJgLxwlGkdj/Jz/luJEuXSKvNOnIlzv0G6cFLkxJWxveulpi0bt/GmOrzbf2PIoP7aMLcSoJS05sfLRdZcuhw2N8+aE67aw6oAZChuwyWdvs1AMq+p/EitHU08ipp3Kk6m+5Bop8KCVj383x3ySaoM3pVO9+IuQFe2FXCaGzJNecEJr8yAGEeqdSYaxkndbJByeKfMQ66RDu2szmbzEC5tdu5+gF/clLkbqxnCnpTvZ6B1KQCiiv/XRXwGDeApt7sNexe0Lz5iNBgYOmmsR80CAZswWRjH5XujlmLQY8IdySIaMjA6db/hb4UpTtDwrPG3lKebNWK00itPC6uOfdCFq2zXvtyDdUtMJ/MxlVntHUVcQVzEnd5aOUjdkOP1o5QqHvEZHyHsTOE/W7g8foZs3Yt0vo1eyfoOXpZlAWHbnXpbZiM+GSVnzRML/UiPPznI3pjQadOsGKeI X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60facf98-beb6-4b77-cd9b-08dac7223614 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 15:58:17.8994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y00TKI3t/Km2r6s2IfS6spYAoooRlpioMq0a198s8NMflZRSdljx13dpXIO/QzPWa9MBNI85kVzaY8KENilaEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7690 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749579123267171698?= X-GMAIL-MSGID: =?utf-8?q?1749579123267171698?= |
Series |
net: fec: add xdp and page pool statistics
|
|
Commit Message
Shenwei Wang
Nov. 15, 2022, 3:57 p.m. UTC
The definition of the 'struct page_pool_stats' is required even when
the CONFIG_PAGE_POOL_STATS is not defined. Otherwise, it is required
the drivers to handle the case of CONFIG_PAGE_POOL_STATS undefined.
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
include/net/page_pool.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Nov 15, 2022 at 09:57:43AM -0600, Shenwei Wang wrote: > The definition of the 'struct page_pool_stats' is required even when > the CONFIG_PAGE_POOL_STATS is not defined. Otherwise, it is required > the drivers to handle the case of CONFIG_PAGE_POOL_STATS undefined. I agree the API is broken, but i think there is a better fix. There should be a stub of page_pool_get_stats() for when CONFIG_PAGE_POOL_STATS is disabled. Nothing actually dereferences struct page_pool_stats when you have this stub. So it might be enough to simply have struct page_pool_stats{ }; Andrew
> -----Original Message----- > From: Andrew Lunn <andrew@lunn.ch> > Sent: Tuesday, November 15, 2022 11:12 AM > To: Shenwei Wang <shenwei.wang@nxp.com> > Cc: David S. Miller <davem@davemloft.net>; Eric Dumazet > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni > <pabeni@redhat.com>; Jesper Dangaard Brouer <hawk@kernel.org>; Ilias > Apalodimas <ilias.apalodimas@linaro.org>; Alexei Starovoitov > <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>; John Fastabend > <john.fastabend@gmail.com>; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; imx@lists.linux.dev > Subject: [EXT] Re: [PATCH v4 1/2] net: page_pool: export page_pool_stats > definition > > Caution: EXT Email > > On Tue, Nov 15, 2022 at 09:57:43AM -0600, Shenwei Wang wrote: > > The definition of the 'struct page_pool_stats' is required even when > > the CONFIG_PAGE_POOL_STATS is not defined. Otherwise, it is required > > the drivers to handle the case of CONFIG_PAGE_POOL_STATS undefined. > > I agree the API is broken, but i think there is a better fix. > > There should be a stub of page_pool_get_stats() for when > CONFIG_PAGE_POOL_STATS is disabled. > > Nothing actually dereferences struct page_pool_stats when you have this stub. > So it might be enough to simply have > > struct page_pool_stats{ > }; > As the structure is open when the CONFIG_PAGE_POOL_STATS is enabled, you can not prevent a user to access its members. The empty stub will still have problems in this kind of situations. Regards, Shenwei > Andrew
> > I agree the API is broken, but i think there is a better fix. > > > > There should be a stub of page_pool_get_stats() for when > > CONFIG_PAGE_POOL_STATS is disabled. > > > > Nothing actually dereferences struct page_pool_stats when you have this stub. > > So it might be enough to simply have > > > > struct page_pool_stats{ > > }; > > > > As the structure is open when the CONFIG_PAGE_POOL_STATS is enabled, you can not > prevent a user to access its members. The empty stub will still have problems in this > kind of situations. The users, i.e. the driver, has no need to access its members. The members can change, new ones can be added, and it will not cause a problem, given the way this API is defined. Ideally, page_pool_stats would of been an opaque cookie, but that is not how it was implemented :-( Andrew
> -----Original Message----- > From: Andrew Lunn <andrew@lunn.ch> > Sent: Tuesday, November 15, 2022 11:43 AM > To: Shenwei Wang <shenwei.wang@nxp.com> > Cc: David S. Miller <davem@davemloft.net>; Eric Dumazet > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni > <pabeni@redhat.com>; Jesper Dangaard Brouer <hawk@kernel.org>; Ilias > Apalodimas <ilias.apalodimas@linaro.org>; Alexei Starovoitov > <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>; John Fastabend > <john.fastabend@gmail.com>; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; imx@lists.linux.dev > Subject: Re: [EXT] Re: [PATCH v4 1/2] net: page_pool: export page_pool_stats > definition > > Caution: EXT Email > > > > I agree the API is broken, but i think there is a better fix. > > > > > > There should be a stub of page_pool_get_stats() for when > > > CONFIG_PAGE_POOL_STATS is disabled. > > > > > > Nothing actually dereferences struct page_pool_stats when you have this > stub. > > > So it might be enough to simply have > > > > > > struct page_pool_stats{ > > > }; > > > > > > > As the structure is open when the CONFIG_PAGE_POOL_STATS is enabled, > > you can not prevent a user to access its members. The empty stub will > > still have problems in this kind of situations. > > The users, i.e. the driver, has no need to access its members. The members can > change, new ones can be added, and it will not cause a problem, given the way > this API is defined. Ideally, page_pool_stats would of been an opaque cookie, > but that is not how it was implemented :-( > Okay if the assumption is the user would never access its members. Regards, Shenwei > Andrew
diff --git a/include/net/page_pool.h b/include/net/page_pool.h index 813c93499f20..adfd4bb609a7 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -84,7 +84,6 @@ struct page_pool_params { void *init_arg; }; -#ifdef CONFIG_PAGE_POOL_STATS struct page_pool_alloc_stats { u64 fast; /* fast path allocations */ u64 slow; /* slow-path order 0 allocations */ @@ -117,6 +116,7 @@ struct page_pool_stats { struct page_pool_recycle_stats recycle_stats; }; +#ifdef CONFIG_PAGE_POOL_STATS int page_pool_ethtool_stats_get_count(void); u8 *page_pool_ethtool_stats_get_strings(u8 *data); u64 *page_pool_ethtool_stats_get(u64 *data, void *stats);