From patchwork Tue Nov 15 20:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 20557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2935548wru; Tue, 15 Nov 2022 12:53:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5R4JSfhTR9AqD674acLhah/i1ATfuxhHgpdtMnDuZObhuxncBH+odtNxjvIoxxQDWixJRo X-Received: by 2002:a17:906:a057:b0:79e:4f34:a8e1 with SMTP id bg23-20020a170906a05700b0079e4f34a8e1mr15114822ejb.194.1668545610442; Tue, 15 Nov 2022 12:53:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668545610; cv=pass; d=google.com; s=arc-20160816; b=WqkjK3+IBq7SISvVS+9E+0jn6zdEoRJfZle7nC1rDyp0N+IFxuyrCKMNKW7urBIjG6 YJw4kN/8RfuNFnUBoOn5dwIZPAk/2XzjlkPo5u6DcLUPJLeRLBrhLuPmRf5U6u8LEiD6 GnBZAWn1Hh/tdwYkfviSbCFXKH8/ZK8viYRtLaEybylaLXEnlWm9NgLxygSMG52bcXv6 0hCHSpDQARbfMQ/EcGiCqq9/8xmGH21uaU7955WEGjPke5yTrz9x6OInZSvYwhPWDZLz Cgww7tCNs9JSDIu2gFht9DJUDLWDOB4+aNTqihC5NqHlVyiEsph/3Q+ETj8bZqBvZCRu qRYA== 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=aVeZBtalcc2PXkHGZTLwZ6gwpE7uWotjeys7jAPOtDg=; b=esALUnZOwjEtBkqKDOYkk85/gkHE58bUQphJCAWtUHUh1ojDUuM0zcAaf4jnPFk4AU xwafz6lRQ06QrrQYeTCTN0I+ERcXZmnJWyn33arTQJEWUvhuAYed/5BY6aWnkxl4OFJO 7wWtcz869lNYBTlTDQvn1ogtJN6ayE8J0QBE47ZBiq+MoOnR+cPLnOTSkcFxfy91va4B x2/4agU7oUiG0IHBqpu0DLSNwWNQkFlzaqv4F+D9CZTLVoHqwd8yR9Gg6aVcl8GD+cp9 nQVuBCgMkImoRK2xaWDesEO4JW3e4szMmQqRU8Rjx+47Y0Y/FLrJgezO6+awYhBQXBgv ZSFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nPeLHTla; 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 cm25-20020a0564020c9900b004608b4f28b7si9860099edb.106.2022.11.15.12.53.06; Tue, 15 Nov 2022 12:53:30 -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=nPeLHTla; 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 S230333AbiKOUu3 (ORCPT + 99 others); Tue, 15 Nov 2022 15:50:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238420AbiKOUuN (ORCPT ); Tue, 15 Nov 2022 15:50:13 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60065.outbound.protection.outlook.com [40.107.6.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 259D3B866; Tue, 15 Nov 2022 12:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EiNLXQrdgjLD1Felt3Lsn2GwV3epsFWtWYqGoP44b6DFLWzc/fiaS3VIYbYBrbTWG9Hj5pvsiFhj6EfgmG0+Bs608/+A4dMU4p2JgREujxWXVF4jFmUGFpnfFeIVf3u/o9xWNxWhw8noqxNXgcqTEGyUpAppwt1wHi9WuIITLcWD7kEruiFzyaMEeLdUAK11ngu+iHLj9wPumczaM9SXWE03RiXpFSccCb5cKsm67sxwZ5S8Coi2TtpWZ+7pHiPf/J0CjKNUowsJE5EECLhOmwCu+hBANw70w1Q41zJqg8qcv6pgQvIrz742zxUdn02iuhF7mp7OkErdpv9tmBsBeg== 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=aVeZBtalcc2PXkHGZTLwZ6gwpE7uWotjeys7jAPOtDg=; b=eyzXkZTOzwqnBRPNP3vLa5T58EmulhBoh+MLdycFp08l4JJSVgPDi/FjbImwQFCIHX0JmeaSzASt58Q4oJnTbs91c7kcLv4X1jCWnxsHjlwM93tjhvGjRreeXORJL+AugxTMSlFH76Ikz3LMPUqvjPWS+akPuhtXKImr9h1cxu0+0FNTZTUupSp20HW923ohg458cUF/fsUF/raGy2lvRPgGpVxqw66N/TqsmehKz//PW1VJ7md3f6Qx+lAnZDaHZHOAJDD4yrNL3n10i6xrt4VPIi4PdmhsLsaukyPcfrdA4EVcHRUrM6nXNv5iHTxOxZKthPPD+bNmr7CZAd94UA== 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=aVeZBtalcc2PXkHGZTLwZ6gwpE7uWotjeys7jAPOtDg=; b=nPeLHTlafoS4hKnbipHIQvjzIW4/dqRbqmfgH7m/WKxvOhlewT4L+aqDLcuLPqWOMaIeJwQy145joOhCBuII7JBHIqJiUK65I9z7yzAHGRdz3UI5IXrHSGkbgzXs256QoQCWcezX20velC5yRj3Ms0r05gjyWhXe4OM3kZDouoQ= 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 DB8PR04MB7129.eurprd04.prod.outlook.com (2603:10a6:10:127::12) 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 20:50:11 +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 20:50:11 +0000 From: Shenwei Wang To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Jesper Dangaard Brouer , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Shenwei Wang Subject: [PATCH v5 1/3] net: page_pool: export page_pool_stats definition Date: Tue, 15 Nov 2022 14:49:49 -0600 Message-Id: <20221115204951.370217-2-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115204951.370217-1-shenwei.wang@nxp.com> References: <20221115204951.370217-1-shenwei.wang@nxp.com> X-ClientProxiedBy: SJ0PR03CA0152.namprd03.prod.outlook.com (2603:10b6:a03:338::7) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|DB8PR04MB7129:EE_ X-MS-Office365-Filtering-Correlation-Id: 353def32-2a4a-4398-c2b3-08dac74afcca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5AtrRN2DTzZCY+wxUDKk+pxSTIrVm2GZ1L/ckjw1vGkjriz2eEAX5gQ5IY7V7TJDoqHo/nxAK3PhMhK9KwWXgjQUD0nbBlptiunO2Rb+UO6haUJRIlY3CvLjZjAeUE9gs+1YaRCavVf8miLLt/Pu5pqrP45LoxR8jI0YPFzXY6lbx22xLIpr9EJLfrBtbI/Ul/N5AlYELQB/ZpEbpNwQr9Bq8c+FuEke5W8mTej2kFzyDsHRlV007hfZJcStXW5hsmPgIGFwyBDD3L8MmRJMo3hLiLLijIiuXaq2gm1IPpgtx/LP6rO3q8bGaAx9dIOiNZmWtJ3ataYPx+qyuBVf6Xkspu3cMKnrLFa23ho0WFQ9/dshtlY5uJo7pJHEyB25id4zUmyDDGhfFjfW0xoSvdZkEdYFn/o5BSnyrqj5wzIenVgPWsAALN61Nh/cuANGyinlnAxZL9Kl41PwipxUl67aL3R7/XecuanESUlRH5uM8IAstyKY8mf0HAH0rwvEMgVX9QoWzD5NMmyMjviWxc0CCaUEyW/wKh2m110m6KIyoNvAwJ9mb0GaTmdINgQndtKN6eHCGi+5TdqsAomzGNFz9fOXU4RmFjbO2SM9Bc6fQ3hrtzbIY9l0Sj3oE6BxqsJF8Yv4/gZY9p0snpAbF9YnF+UIJue+dwgONQIB6kATWB8MlSne/aWvFxZcsXcgMMHwvBwlDHmPlQABKHXhIOw1m0OMAXBG0bl6Am5C566sT6vb8tQJUWj4z15U1MBTFxaDiXdsfhmtBX2i7P3O0Q== 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)(39860400002)(366004)(346002)(136003)(376002)(396003)(451199015)(66556008)(5660300002)(2616005)(66946007)(66476007)(6486002)(478600001)(86362001)(44832011)(7416002)(186003)(4744005)(110136005)(2906002)(36756003)(8936002)(1076003)(6512007)(6506007)(6666004)(54906003)(316002)(38100700002)(41300700001)(52116002)(55236004)(8676002)(4326008)(38350700002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iR8TtnJpvT7nH2UvOi6fOaAHPvAGKJdR3v4aBV+cb4R1qdOW22Pn8CcBs4/3lLq5jidrlbr2+ALMsYg65Ef3hEq5RuvTg+aIadjt835JeG1kW6Kfp5Kbyj2CpNfPYeFg2R5UTFCf6j19rYLBzv0SrdHLDU+iJpBqDmEyLVFo7z6+eP1c0XKykIhxZPytpCXcf1fVSKmbcMAH03I7NXwB8o+0eozY0+7icrK1tUHRmLEaAtfZLZUaMNjKx5cMBc5gDlQlRDw8wqCGIIJGKBePgx5kpfbkEtC0HqCGYjYpid3srlZmlk27RZBVZbKKahzeST8MmH5+knHACgoALnZMoQrgaQxNwwQ6emlbzGSEhSq553BJzC5+qJDAVTUFWYMNcpHmIcUz/j2oABpvCVr2qAxW/JtR9YpbK3a1pwe7Ie+dz3qo2JIMRdoWCCrtgnmq+gXOetNSVaG+lcdUJV9JR7fyLZZlUbpriA/kQVF2gYuPGO0leClQ7rNKlJkSvT4ppqUvuQX0suN6pzmKu7DU9oBw+tPvydIsOJrASWDhxg8Qb+9LAXuh1jqQ1tsB8z+OTuWGfDyJlfs2o65pnIg1bT1eVM15/XFe6DoVh+a57BFRCcqQZX8gv7yZJIrL5uoalMSGv+p6bxyiFELmBsmhFXbAsSbJcL2+LqhBfV7XR3/RabQsTb0Fk2MWgsz1z/9nxXxTm89ZudCcS9siKpfPN8JXs9YV9K22QuDvAnYZvjKED2R2vAKC4hA5+DcKbVrsdcx5sGIbOh/+8qfcRBEeQ3+IULOVfQhYmENspgUvpSL0CxO7EyMg39HjhjfC4dA/Q6pAS4rlXG1XYghiAtWJkhYIQCoqqTuPtq+K/alwcS9Nj/1U+QM7rU3iRtJoIgVu+2wNETwmhT3rIGE8PYJXZMd/wZQIJW0+BBL5j4tJkCtQoo/emEK4CQjEwTnDmLmWTFmaHTZWue7M8AhQMSLlqqVd3kvt7bGlVqzIr5m0s0lu6YNQepe+zTFUDj6BWjnBGb5Z7tQ3sdogy5YPAUYIupMTq+rkDL3gQwBsy2Mv/WuMorkpgcmt3waZ2EOPtLkQYy/8A/sKH0dczbimphcI7ZCLKAR2/Wf8AIMR3AYDlq0J3/v06I8TCRRHpGm2PNvu1iZc0UqsgjMdzuGFoYNhh76+0gDhsScOqG2yU8P4Yhi4dbCA1DyHE8KzimIH88k78tSWrdGd/7GSRa1gTPlxz4t8vIKscfCLkfopUF9wSoYLqQ5RaljRSzbxb50NRkRUhw0xpsp3OuDQC+JqwEvDX1coCmJEwo6WMOZ5ExK1xETz06nIF3aE5Vzh3aI6C+RzLoqY5AspPRv7ahBjFAlkM3A2uOt+raCkTaeJeuOVFHCfWEJLJ4j3FzIT4zRwNfeN4buOjEg3KiEv9MDxEO/vEXHNe67q2l18D2Vkq8dTsxF/4v3jk1Oof1Y2LPY0EBIf40XUHv9GGxOHEVWhmh+YYgINdQ3/holdvI1BkFDSwGGQ+NG0qQ4iwRc1mErifeLCSji8jUYlBb+HZTdnHZGIT8yXBYrMl2puSvK6DbOsh+AxfwyLlDcsJ6URGuH6eO4d X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 353def32-2a4a-4398-c2b3-08dac74afcca X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 20:50:11.1344 (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: zyOhY1mDu6TF3Ky6UtZZZGYQiMDy1xbjAZQmpABcA5s1EYzYEI/a4qNRi4TNKLYnCKIh3vwO2sktrqAgM4W3bQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7129 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749596882053484389?= X-GMAIL-MSGID: =?utf-8?q?1749596882053484389?= The definition of the 'struct page_pool_stats' is required even when the CONFIG_PAGE_POOL_STATS is not defined. Add an empty page_pool_stats stub, Otherwise it would require the drivers to handle the case of CONFIG_PAGE_POOL_STATS undefined. Signed-off-by: Shenwei Wang --- include/net/page_pool.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/net/page_pool.h b/include/net/page_pool.h index 813c93499f20..516d943bc1eb 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -129,6 +129,8 @@ u64 *page_pool_ethtool_stats_get(u64 *data, void *stats); bool page_pool_get_stats(struct page_pool *pool, struct page_pool_stats *stats); #else +struct page_pool_stats { +}; static inline int page_pool_ethtool_stats_get_count(void) { From patchwork Tue Nov 15 20:49:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 20558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2935551wru; Tue, 15 Nov 2022 12:53:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lDWqikUJNR//fshJFes7DNN9quGp6PO9j64YloaGsfTcfv8mzVs1W3X97qrji89jPEk6c X-Received: by 2002:a17:906:9f09:b0:7ae:ea7:2139 with SMTP id fy9-20020a1709069f0900b007ae0ea72139mr15309068ejc.319.1668545611701; Tue, 15 Nov 2022 12:53:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668545611; cv=pass; d=google.com; s=arc-20160816; b=u2XhqpLmcD7XWf52VExdraXNiitMBmlzsF2QTDOvWF8IfcyyPVOLT3Pb0gZmM/0Bd0 21YCvXwLe29PjkRcbWUVjC4qJvbzPc1Q41+AwJ392GmDiSrQpiSiK9xveBSAbVeMaOkc HYVvFFeiCPzw7o8RgkjPYWWV4rz7ejFinX8gWB6nnhHHzq0bzAHPJRfvc1vRd8BFq2kq /GehLK6zBJSNmlJJOUWoTmO4BH76CiF/EnJAS1g8xot9SaUDJP3zxnoVYC+B95TV694Y WFtuTbcGJp7EY8hDhGrIlyWmhIl3BuaBo+t/Gb6HLHI/MYlIhDhRhpvN2+f9Zy1y1Lwy z2LA== 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=F7e79ZCi6sldLaP/g97KBdZsh7fxEkaC+az8n7t1EzQ=; b=q+YopWEqcqUBwP2LLe7LYMUn625OfgfK2FxMtsIPQrVlIKTdoRy5jNZL/IMgoz5LN5 BnIs6irL5qvEeUyFMaL3VeKtFr8bUHmmz/7Zmds/JHTSZEnFyHMCO1DnCq8/E5sDNwx2 RPXl//JGL81GobR9pf0av1PYn+tRIXXUi70MNK3d62ofCORItU3yrDiFE4YsVI6Xh+38 P6M78f5CLp6032uoX8XmZbn5BgMZYnFi6eiLlNc0TXzWeF1E4IPG3yljLZCZpBo8iVpb NF0ARVXturpte33vMgohTq9mKxMPcpvz+WCEH7J20auzfheDpmPlhxACJw/GGFpnxHYO 2HcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Coyl4mFf; 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 ho30-20020a1709070e9e00b0078e9ca562d8si13391233ejc.879.2022.11.15.12.53.07; Tue, 15 Nov 2022 12:53:31 -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=Coyl4mFf; 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 S238566AbiKOUug (ORCPT + 99 others); Tue, 15 Nov 2022 15:50:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238500AbiKOUuW (ORCPT ); Tue, 15 Nov 2022 15:50:22 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60056.outbound.protection.outlook.com [40.107.6.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3537C2B624; Tue, 15 Nov 2022 12:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNWbGwP3+yf6jIAe+/8UUQddunsMB4XLN6pIFMu++sZfao06JqjFqgiKIrbj+AVf7aON2XUSw3AmidyxtC/mhetNhR14zzKs61QwSnvQtnGUD3cOwXev87bLYouAZWIp/iC1z85dQbDF1/NQqvsARScAEpqhvuCHLWxyB+7NNlx8LFL4A3ysNAAeXDFVEEL/eGa0NA3/PNLGNZf7NM5K0Z768vqqnalFFpXXcawJeVdKFb0f9ucVf3IRnTPZLJuj1EbLlas8tBnWyqhY10O/IZDlnZ2T0eEymxBvd3leFBInCi83Sc9Xny4piR+ah5N0Ns5VIAYWF3eCI6uvlzk0Dw== 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=F7e79ZCi6sldLaP/g97KBdZsh7fxEkaC+az8n7t1EzQ=; b=VoIEWVlBEHap5IfTopLaQNMg9IP9xDACuWqUioJmPoRHklZUjk/0p2jVMBDBnZBhO1CV9Vmt6i5f5OvKnMpnYr/mSgSfWOGq+9MeZkUPTkgqtobgC0tN6X7XmoJzqkxXBO3mWFv94893sMeJUFelD196wKfqpkgrFhAbuNMRoFvyURY/Mc+iPSDBxIlCJXlPbildIpG5hKuBDEu4a0izZn8jTGkJnlxq4K1ow3oGSPcquGEBgk+eZtucB9dtrg5GmWuOXSXzlmpfko8byBFsaMnjhuRW7ejI7HqVuDgmpLXujEnz31CyN8pR9zyQPBudRx7Dl409Pm7fudvlPg49QA== 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=F7e79ZCi6sldLaP/g97KBdZsh7fxEkaC+az8n7t1EzQ=; b=Coyl4mFf46WSJ7Nrdd80v0yKvEUm0lIOm+0bS8Q1npWQsSOPQvvnhM6g6h5SIOwN33Rzt2440ZAYWuGeb0D3rnBwY2c0V8KhyHniv+hlvikdBA5LSpVlMlcCHHsFpR8xYVWAXY+2onPvZk0/FRpxZ9eB8oqxbdSrthdn9vruGvM= 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 DB8PR04MB7129.eurprd04.prod.outlook.com (2603:10a6:10:127::12) 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 20:50: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 20:50:18 +0000 From: Shenwei Wang To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Jesper Dangaard Brouer , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Shenwei Wang , kernel test robot Subject: [PATCH v5 2/3] net: fec: add xdp statistics Date: Tue, 15 Nov 2022 14:49:50 -0600 Message-Id: <20221115204951.370217-3-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115204951.370217-1-shenwei.wang@nxp.com> References: <20221115204951.370217-1-shenwei.wang@nxp.com> X-ClientProxiedBy: SJ0PR13CA0066.namprd13.prod.outlook.com (2603:10b6:a03:2c4::11) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|DB8PR04MB7129:EE_ X-MS-Office365-Filtering-Correlation-Id: a0c502b7-4591-43cb-161c-08dac74b00de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 751gqxc5mXkrQNcgrvDJBPhxCLTSZK32oqyzj1Cin5RGcRfvo2d/a//fUfO+ySTwv07uhkB9u9kPs0OAvTPNbf/GO9Ma/psIjd3W1BGFZJjxVhqELAaEW+EDs7adxsdxanK1iw8aokZpcXQGnap8CV+NpTi2syX+vJGlQqIPMAcva1yULTgL3teuiHvF5I31Z4IyiNxVmf6LvOugULGcyxzU0gM/+2RpWZaWosf+gQ1PONZlC2Bc+ZCCaoWmkSrg0KahlYbZGfcvV3wUUKJpvoZpmuHqmMOFZTdTpS2DNr7284c1wu+l/4xdIh8XhTpdk1Szps9/0mCNjSg4ErjyXU/3snkZcgOY1jh6Mf5/nV00wyDLKvWh4ad1BBA361KAVQBuYsZVC1gtBpBxeqdEpqHyUIJ4XTiUHuNNitgZsptSoDSGrsl/EzQ3JxNj8sejDM2DqxCvdYqhgr1sjSg84iH9CbPCLg74CF6J4h+PiEuTAy6yLWte6p9a7kPC8n9JD9O+Z8gpnL27fEXSzgWh6a4UArh+xz6JZcJlwB6g1+IcInrIYbcWUJjunUper7T+/zuubCGe0PbMMJI7+S9FzAhrz8vqkrAkT7zkRHI07jjhS43ANiQil60hk2WQ/x4coXjdmAjeFXdKheq22vc2pPU4xBj8wCmoF7jBuCs83D3465BUHNG7dSN7/TtQZcQKZjU/2g3se/0oR2RwYvBaiYMOb6FFtN67xgQkpqVD6Z8T+gExfxbYxSKDND4p4TVm 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)(39860400002)(366004)(346002)(136003)(376002)(396003)(451199015)(66556008)(5660300002)(2616005)(66946007)(66476007)(6486002)(478600001)(86362001)(44832011)(7416002)(186003)(110136005)(2906002)(36756003)(8936002)(1076003)(6512007)(6506007)(6666004)(54906003)(316002)(38100700002)(83380400001)(41300700001)(52116002)(55236004)(8676002)(4326008)(38350700002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AoEOoRJnwQGf6xEfQKggcyyGl4DdAL11Mghn+zCZKP3uuO/7zpm4GNR61hO73+Mw/KWji5yJU46M277fdCCtEnnWirr0NOze2sL3FnQKnxgPDV6AERHek5dRq+0ZsRuFPPAmfaLcR4C/PFM0f4nYnV4pBKM4pZEazkAtfnRihsYKvBSjk0e9Kwx5LZuQR/V8zngku2dCBd6bP2qhFtTErnLfJJRKjXM0qHp/ZS5LFJCXECpshXIxQnBEZFk7QGTDcI6+884Bt9RoRkVaGpAm2nQUlBwENx8zIpGW2m+i1dDZDLHtoiiiL4bzm+KmWhvd3LmASmGpHLUcKtrGbkWzxE7pmxju+x1eCmsA0I6IjrOM+z5JPIZ59YF+pCaqyy+cBwSf0ccz/0dEO4beLqCr3xh5XoBsOXYgRcmNEf5nsQeB8Bfmm47G52qoLGrFYzi+3ILzpV9TCLMijbXhOL+QmSicUfSjWJjaTjvyKepZtgWAwNbN7H0R/jhK+nNa34cZQJPhU+YBM1hB52UtH/RxuDfRijyhRTHG+KuCTXtzuUHXx75m/M505CXyIsD/q4IAfnvx44eTtUWHRNw/YTpiaHPD4h20ENIWjOmcAvMzgeFfAIT+f9B+Ehz6Dhyk/v5xO59fj/Vu33h0SAvFtZLCFqleGfRddiOTrFYCSkZ/HsdisisR0afj8aVd4nc7vwd01h0RRIo454NNssJylhET2yZquaRTtFLZJEgsUC712mD1bI9z96mdY1p39QxUaCxDeicQwSKH9habmsPUtYdSb0Hbisg2vQS60AvpNdY1n51OUtvdPGN7pLUzOwZVuM7VMtsiPyeJYsI8KsZ4pMMPvrb00djDpAEGxpgQpT5oCqgiU5OW9e+GpEbsTZdpaH75OQgCyCN3e871uC6/TYGElyTDV0kdvaALoqpV9oegWWiWon111Lyg+8c1QaP5KQ50uaqrGW8G4rPPttgN7zq+tV4J11lgg8hVzkI7T2gYO2s75MhRz+Sx8dsOk1XDtymrHUpQ30DKPKZrCcJOkhZnRGKPcq1Cha07lLuqthms2WIo3erUHrnJLt/w243DUPN4EbZu8HefilyJOexszMX7Of/hyqXjE95Sce5tvzDEOzzOHhaTcTscxRAdn6mpiPxeG8mx96TrmDHDgj9/KR0xl4Rv9h1cicqFC1hV/B1ck3iCM541SNCtCCwJVFSeXZNfHDcwnVtMVE9RbBquYrNG3GPPhbepoMJbG26Y8E3zANK0+SLIArFvQXB7loo4WKMylCUvxru2XZyrCJKw2IyFy/9A5QlIX1N8yri20dt28YMt1ewhEygnhEPsAfLGs8RhYNMSCkW38LJhGBDCdXBVDa9aTnUZolrlf9D9Lt1t/xl8ns0f0O0N3fJpGMVmbE9b+QRb1tOsWBPi39zvkzMrb7WAf96Vya8XwE6Jahafay5y0ORKWcuvvvR6r2BrlnEjaGzn3P3nxAG+6qc9/8Tf+aWqG55K7hutiK8p/1JVLRs/VAurrQRBL1b4zMi3oafnl+bfThVdBhnRxJ7CRYU8e5d5nWfgGToJW9BdFrBytTfCPjaa4c9fMT57VKOFOSGB X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0c502b7-4591-43cb-161c-08dac74b00de X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 20:50:17.9890 (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: JlFBFtnndvPfzUJx3Bx2hnIfCNaQE9DxvB862/izcYmhk0YxKNNE7fNhKwvgfl1AVtuo5uouHMwKA4c6Wgq+Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7129 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749596883316544360?= X-GMAIL-MSGID: =?utf-8?q?1749596883316544360?= Add xdp statistics for ethtool stats and using u64 to record the xdp counters. Signed-off-by: Shenwei Wang Reported-by: kernel test robot --- drivers/net/ethernet/freescale/fec.h | 15 +++++ drivers/net/ethernet/freescale/fec_main.c | 74 +++++++++++++++++++++-- 2 files changed, 83 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 61e847b18343..adbe661552be 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -526,6 +526,19 @@ struct fec_enet_priv_txrx_info { struct sk_buff *skb; }; +enum { + RX_XDP_REDIRECT = 0, + RX_XDP_PASS, + RX_XDP_DROP, + RX_XDP_TX, + RX_XDP_TX_ERRORS, + TX_XDP_XMIT, + TX_XDP_XMIT_ERRORS, + + /* The following must be the last one */ + XDP_STATS_TOTAL, +}; + struct fec_enet_priv_tx_q { struct bufdesc_prop bd; unsigned char *tx_bounce[TX_RING_SIZE]; @@ -546,6 +559,8 @@ struct fec_enet_priv_rx_q { /* page_pool */ struct page_pool *page_pool; struct xdp_rxq_info xdp_rxq; + struct u64_stats_sync syncp; + u64 stats[XDP_STATS_TOTAL]; /* rx queue number, in the range 0-7 */ u8 id; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 616eea712ca8..bb2157022022 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1507,7 +1507,8 @@ static void fec_enet_update_cbd(struct fec_enet_priv_rx_q *rxq, static u32 fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog, - struct xdp_buff *xdp, struct fec_enet_priv_rx_q *rxq, int index) + struct xdp_buff *xdp, struct fec_enet_priv_rx_q *rxq, + u32 stats[], int index) { unsigned int sync, len = xdp->data_end - xdp->data; u32 ret = FEC_ENET_XDP_PASS; @@ -1523,10 +1524,12 @@ fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog, switch (act) { case XDP_PASS: + stats[RX_XDP_PASS]++; ret = FEC_ENET_XDP_PASS; break; case XDP_REDIRECT: + stats[RX_XDP_REDIRECT]++; err = xdp_do_redirect(fep->netdev, xdp, prog); if (!err) { ret = FEC_ENET_XDP_REDIR; @@ -1549,6 +1552,7 @@ fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog, fallthrough; /* handle aborts by dropping packet */ case XDP_DROP: + stats[RX_XDP_DROP]++; ret = FEC_ENET_XDP_CONSUMED; page = virt_to_head_page(xdp->data); page_pool_put_page(rxq->page_pool, page, sync, true); @@ -1582,6 +1586,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) struct bpf_prog *xdp_prog = READ_ONCE(fep->xdp_prog); u32 ret, xdp_result = FEC_ENET_XDP_PASS; u32 data_start = FEC_ENET_XDP_HEADROOM; + u32 xdp_stats[XDP_STATS_TOTAL] = { 0 }; struct xdp_buff xdp; struct page *page; u32 sub_len = 4; @@ -1660,7 +1665,8 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) /* subtract 16bit shift and FCS */ xdp_prepare_buff(&xdp, page_address(page), data_start, pkt_len - sub_len, false); - ret = fec_enet_run_xdp(fep, xdp_prog, &xdp, rxq, index); + ret = fec_enet_run_xdp(fep, xdp_prog, &xdp, rxq, + xdp_stats, index); xdp_result |= ret; if (ret != FEC_ENET_XDP_PASS) goto rx_processing_done; @@ -1762,6 +1768,15 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) if (xdp_result & FEC_ENET_XDP_REDIR) xdp_do_flush_map(); + if (xdp_prog) { + int i; + + u64_stats_update_begin(&rxq->syncp); + for (i = 0; i < XDP_STATS_TOTAL; i++) + rxq->stats[i] += xdp_stats[i]; + u64_stats_update_end(&rxq->syncp); + } + return pkt_received; } @@ -2701,6 +2716,16 @@ static const struct fec_stat { #define FEC_STATS_SIZE (ARRAY_SIZE(fec_stats) * sizeof(u64)) +static const char *fec_xdp_stat_strs[XDP_STATS_TOTAL] = { + "rx_xdp_redirect", /* RX_XDP_REDIRECT = 0, */ + "rx_xdp_pass", /* RX_XDP_PASS, */ + "rx_xdp_drop", /* RX_XDP_DROP, */ + "rx_xdp_tx", /* RX_XDP_TX, */ + "rx_xdp_tx_errors", /* RX_XDP_TX_ERRORS, */ + "tx_xdp_xmit", /* TX_XDP_XMIT, */ + "tx_xdp_xmit_errors", /* TX_XDP_XMIT_ERRORS, */ +}; + static void fec_enet_update_ethtool_stats(struct net_device *dev) { struct fec_enet_private *fep = netdev_priv(dev); @@ -2710,6 +2735,26 @@ static void fec_enet_update_ethtool_stats(struct net_device *dev) fep->ethtool_stats[i] = readl(fep->hwp + fec_stats[i].offset); } +static void fec_enet_get_xdp_stats(struct fec_enet_private *fep, u64 *data) +{ + u64 xdp_stats[XDP_STATS_TOTAL] = { 0 }; + struct fec_enet_priv_rx_q *rxq; + unsigned int start; + int i, j; + + for (i = fep->num_rx_queues - 1; i >= 0; i--) { + rxq = fep->rx_queue[i]; + + do { + start = u64_stats_fetch_begin(&rxq->syncp); + for (j = 0; j < XDP_STATS_TOTAL; j++) + xdp_stats[j] += rxq->stats[j]; + } while (u64_stats_fetch_retry(&rxq->syncp, start)); + } + + memcpy(data, xdp_stats, sizeof(xdp_stats)); +} + static void fec_enet_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { @@ -2719,6 +2764,10 @@ static void fec_enet_get_ethtool_stats(struct net_device *dev, fec_enet_update_ethtool_stats(dev); memcpy(data, fep->ethtool_stats, FEC_STATS_SIZE); + data += FEC_STATS_SIZE / sizeof(u64); + + fec_enet_get_xdp_stats(fep, data); + data += XDP_STATS_TOTAL; } static void fec_enet_get_strings(struct net_device *netdev, @@ -2727,9 +2776,14 @@ static void fec_enet_get_strings(struct net_device *netdev, int i; switch (stringset) { case ETH_SS_STATS: - for (i = 0; i < ARRAY_SIZE(fec_stats); i++) - memcpy(data + i * ETH_GSTRING_LEN, - fec_stats[i].name, ETH_GSTRING_LEN); + for (i = 0; i < ARRAY_SIZE(fec_stats); i++) { + memcpy(data, fec_stats[i].name, ETH_GSTRING_LEN); + data += ETH_GSTRING_LEN; + } + for (i = 0; i < ARRAY_SIZE(fec_xdp_stat_strs); i++) { + strscpy(data, fec_xdp_stat_strs[i], ETH_GSTRING_LEN); + data += ETH_GSTRING_LEN; + } break; case ETH_SS_TEST: net_selftest_get_strings(data); @@ -2741,7 +2795,7 @@ static int fec_enet_get_sset_count(struct net_device *dev, int sset) { switch (sset) { case ETH_SS_STATS: - return ARRAY_SIZE(fec_stats); + return (ARRAY_SIZE(fec_stats) + XDP_STATS_TOTAL); case ETH_SS_TEST: return net_selftest_get_count(); default: @@ -2752,6 +2806,7 @@ static int fec_enet_get_sset_count(struct net_device *dev, int sset) static void fec_enet_clear_ethtool_stats(struct net_device *dev) { struct fec_enet_private *fep = netdev_priv(dev); + struct fec_enet_priv_rx_q *rxq; int i; /* Disable MIB statistics counters */ @@ -2760,6 +2815,11 @@ static void fec_enet_clear_ethtool_stats(struct net_device *dev) for (i = 0; i < ARRAY_SIZE(fec_stats); i++) writel(0, fep->hwp + fec_stats[i].offset); + for (i = fep->num_rx_queues - 1; i >= 0; i--) { + rxq = fep->rx_queue[i]; + memset(rxq->stats, 0, sizeof(rxq->stats)); + } + /* Don't disable MIB statistics counters */ writel(0, fep->hwp + FEC_MIB_CTRLSTAT); } @@ -3126,6 +3186,8 @@ static void fec_enet_free_buffers(struct net_device *ndev) for (i = 0; i < rxq->bd.ring_size; i++) page_pool_release_page(rxq->page_pool, rxq->rx_skb_info[i].page); + memset(rxq->stats, 0, sizeof(rxq->stats)); + if (xdp_rxq_info_is_reg(&rxq->xdp_rxq)) xdp_rxq_info_unreg(&rxq->xdp_rxq); page_pool_destroy(rxq->page_pool); From patchwork Tue Nov 15 20:49:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 20559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2935606wru; Tue, 15 Nov 2022 12:53:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6aGvV2fNsoAfoH63u/NCrlQWF1foegoBRxSnlm2JmAY9H1d+uadxPXcuOwKdTavB30rYQ2 X-Received: by 2002:a17:906:5ac6:b0:7ad:ab0e:76aa with SMTP id x6-20020a1709065ac600b007adab0e76aamr14977827ejs.435.1668545622135; Tue, 15 Nov 2022 12:53:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668545622; cv=pass; d=google.com; s=arc-20160816; b=nEYrZxMnx5ciy6PnY38JUlE8/kYeAfLr6kp7gLx/3kRvPybhX94mY0tKRR2OqsTEYZ 5uF5sOr58X8paFViIDh5Tw/16OwGXz9XtS5KpqL0vt7TMFa2VkjORIzA/f46CnBjp+Yy 1pWhdZitev9OSVff3yrbMl1SDoyYgPvfoquCDw3hYNGnmG7mVkyyHAPzMgW9rKisu0k0 waARhgImN8lYT8KuYMe07yGh7dwLG6U4cBVRLbMTu8wm8GcyI1wgp164luPGPF4Uzvi+ Z4dFDyd9r/Pdhdx9QAg2b7VWFEdv8taLfx3vMqSpKiREsu5YRrMUOPMejUsIfFvc2Opo U9XA== 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=fPWHFB/asynaldEzOf4l+XeMdTB+9kDVQLjJFApCh0g=; b=CZyigPZDNjehmHnJkkGUd3eSVPlMV96wXpd+rsp/KCZgt+3GafIk1GWjSrkfTEqnRk GR/hjb+s8vkX5J1govrRPmK+evB4Y1yyk7acr2Tc9lt17p9S2uJTdfOBnRXBQpLFCEBV VrMFAen2VqboHd1ZW8BxUZo7/3jd0QwPDhiSRqsVgkOqGU0Gb0xZ+tRdheF+hySaNRfb wx6xp4KGXXI6FPDi8PS99FxTIkY1R5hvdFSaP1zdg6Nl7IKeSbTii5aT7fXRdCVMm3Rz cieHwfo+NC7aLxjtO5LaA8RK/qzYOy1Ip3OOE+swppY3Y84K/phTM/tpwPIGflmGPTZQ th6g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AzSawQIE; 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 d25-20020a05640208d900b0046360343debsi11620250edz.153.2022.11.15.12.53.18; Tue, 15 Nov 2022 12:53:42 -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=AzSawQIE; 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 S238628AbiKOUvA (ORCPT + 99 others); Tue, 15 Nov 2022 15:51:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbiKOUua (ORCPT ); Tue, 15 Nov 2022 15:50:30 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60078.outbound.protection.outlook.com [40.107.6.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1DBA1B7; Tue, 15 Nov 2022 12:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Or0yyZEwtbspAouyPZcb93uicXJRxrOlXSc8dPPXb93RN7VE0jJSIVEXaTv3UtG6hs7vnDBxjrZEWx/OD1m9J82Xh7ghSGq34M3eSuNfkrswhX6IqNWag//wsOfNUWDlPHxyNB0neCoQnnK7PkM6SaIbo51f9Fd8fgGTPIJ81Tt3eAnUWTKTneUrma0Vys8K2c0duFA3pLbTSiFqph5zC+Da/uNKGRbFIq9YiPcLudXNkMm6zqKfJ8ryqvk28aJmJx1tRhu5bwTS8Yc8u+gITH6qcX7i4w7kV7pu8GNksnYjaGeZXPAHCHvxv7NHSQ3e8s5wM7tg57bD+2y72Frpjg== 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=fPWHFB/asynaldEzOf4l+XeMdTB+9kDVQLjJFApCh0g=; b=AvCkPvMWE8HpmIBrFpsjOWs8PKIrK6iuNoEPBztaYuS0KOrLnhHRpBzrX1xOZEHR2VWs6AzotVr1Nrj+IitBiIg1gD5S1T6b074Kpn/RvnuB82Rsq6qoClgOFyGHXL7hOWb3cx2KBoLMjzBzXlBwSSAdSX8kfAoQePs+Ss0HMiRztoVs/ytkyRv2IlJwoQzj2PZlHuAgForU/eaWBxApWLfRcxbb1nW8wuUyQi7a8UTASut1RImKZ7sUdu/niH7cy0XpV8oRQXmwwfUS/cfkkOdV3138mXyINwWXaW5pOpG+8vyLUnQDLp8XM+RdGKq/KKrT2YeYqwod8MLoTV5HLA== 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=fPWHFB/asynaldEzOf4l+XeMdTB+9kDVQLjJFApCh0g=; b=AzSawQIEPSOJV7KaaU5hUTaERmx7kvjyrAD6Yn5R4N527k9OmQoTLI5vrzbpM4WjQwT2RFH0WYEhmeyJ+o7igE1MB54IzSYw25eDXj9pBLVpSMjW9ZXsn7rrQnpnIDSkTSbmC/op2/oYqpLhORmjY68jdTgT32cDYg2T6N1XaUA= 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 DB8PR04MB7129.eurprd04.prod.outlook.com (2603:10a6:10:127::12) 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 20:50:25 +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 20:50:25 +0000 From: Shenwei Wang To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Jesper Dangaard Brouer , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Shenwei Wang Subject: [PATCH v5 3/3] net: fec: add page pool statistics Date: Tue, 15 Nov 2022 14:49:51 -0600 Message-Id: <20221115204951.370217-4-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115204951.370217-1-shenwei.wang@nxp.com> References: <20221115204951.370217-1-shenwei.wang@nxp.com> X-ClientProxiedBy: SJ0PR13CA0149.namprd13.prod.outlook.com (2603:10b6:a03:2c6::34) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|DB8PR04MB7129:EE_ X-MS-Office365-Filtering-Correlation-Id: 525f1f06-9446-408c-b0b0-08dac74b0515 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oVHZyPaPDd5dbBw5mQu14byiiAsSQX9ja8wcegj17IF+onqlu22gXfKYHPOmn+geROLBhMqYcPYnc5n32ACb5xTulfFbm8wwTwaDFSa/LitELxAeNbTSeagvz8y6IJ6lUn/W/0BqB8HoARAP99dOsmmE3p42Z3x1lB7cAbhYzkMzpF/Or2ub+FFIUKK/vJZHC5abDJJ/5A6xzOVyCOxhe2FgxYgavZBuoSGRbB/ohl0nQV2TB05o9F1Fb6jxAaw0gWCTfm7ulrVCNoCjalHGaKMB7EjSUet86bViTf+LHechdEPqkrgnbehnt6elJVmuq+c4xTOgOtDiwY9pyqHoCczF8KRC2NOhn3ryWUKxusiJzZjcWhbE6OrhTJszZ4l3A0e65dH8oABea/zHWKY5o9vLSQp5OUOQp8Kf0j5WV2n2N8vBz2tahjZPeSrftsnnNMl1Iw5JQcBMOG/Z9OBa5IWIONKPPaAy9bsiRxRXgGA/EgotIHfesYe/SZw300tzVoiekS8RM/vX6EyXBbz2mKO6Hsg+gxyuS572y83ph+07JM61gfCXxnHNHNYRXGUA/tFCfnCx/l7z/zU7i0LczoCsTyxFWroYuuCzSd3kaNrJst/GAyncO7XvxMpkMsz5eC+16EkwZ9Kj+El7WSJGygf2vJCgcdMzb4wzC4zl0op7YPhMOmHXnrZiSllnEln1J1x7TQptDTduyDNDhHEwmTHQbCcvE9cLGADwomMGYBi4Ng/OZGL36Au7L7T34bsDOmaS0BBWwIBzQ8BSPCqm0g== 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)(39860400002)(366004)(346002)(136003)(376002)(396003)(451199015)(66556008)(5660300002)(2616005)(66946007)(66476007)(6486002)(478600001)(86362001)(44832011)(7416002)(186003)(110136005)(2906002)(36756003)(8936002)(1076003)(6512007)(6506007)(6666004)(54906003)(316002)(38100700002)(83380400001)(41300700001)(52116002)(55236004)(8676002)(4326008)(38350700002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RLTqxAuWSJp9vO6Oi74sLEi99yZxm5PplD6jjxQz65nVZYYXIjaOxnkBXDImUf9iFsFsuIp4/eAyB9TePjrg28vFzpoM3143L8ddIC7IfOpIhIrXkQgi/1XYTGOiX2ky4xknwi8/E+Kq8J9R8rT9IDfP+2YSbBbW/jSFp+k6HsbDLWGBrXerOfc+d9Xw81onO3xoJnImwe3M231sjbvtZZFURmbLvqUTns5KI0dyk5yirSp5W23eWYM/GG/RbyZqK7ThEZooFK8OKbMthRwFglQQ9O1ie2VC/3z+xYQQSx9u4ZiXKCNeWDSKZ8Wgm+tTQFEBCGMKSkIbFYZQIm68eZIgGty0DHu9A40K2qLVOsBqp3XHM9HBuiUmw1muPACoUxMjW0h2lw3Myiu2R/7LcWEcX0hI2U6gvUgqTtVqclUx4N6quVrqJkRghU0RPPFq1+WQMcg9cNB/Lb2cP4O9kNdKaalyxl0WrhbFSlIL1ZOZ2/PSF3ifz5s7hWXlowoHv2h67PR+AJCHKpw5XOoRqJ27B9Gr4YB433wGvYeC7HGyZQPCG2cHQC/xCSzNLS1f414D2m34bvg5ayoL2Drs8dEcnY3EO9BT5Mq9DIrjfpHYkTQSGFB5yk/9j0k+vzYSbztWiFIYbN34tAYXvy74RbEm/2TB3hzK+vkdjCXvMOQ+oNOfRYIuCiH29tZdOkWmZZMAXOWnSm1dU85wk5HDYIHhN5w+XaBUTU0qfyS0Zmbphkor5BFb4nH9Ps1AwoCdHPqj22zgUBOvfmUH5a2a9speeTn8BiS+ki4i3D4Qc33/KRDgMgCypP1qwvcfRk7rHgPoGl9MUPqH8whjswLd5PCNuKT11LR4598gOEVyr6xqfgUBTvN7K4sV+r87o9BfiWS8e9a1Iywj3l8O85LqAYbjSTJV1ruhJv5RDjbKrZDMnDHLi2t9sSJqC64RSWENb1nFZGark8clu8RrVma8OoBujEN02P5mDrN/kANnY8WQPNTh5MkbKoy4obV0hI0poaR0XL73VRhGKtAy8+9PUOj4YyMZ0EAJAiWqVZEVYQX+jraOdSpMtNXM/b2u24K8fHph4U0I7XTcDzxBDwMDdA22X81Y2KTc7fYCyQxusCt5oUhzfxZO4AO3ydcIcmYGWLT4NutDFUxQaxejsNAiir4JZWqebZh8fvrJr/mJIdp5C+nV3Ctgb37pgi/EB1MNyiV9FrM+zM68t5wJMuaRldKD+Nv6l9Slolx3kBggYwcjhcqDWZ3LYorBr/uJub6xlovCte9qWUHlJV1sjdWu2saUgrqob7tLV2KCEt8SjkmNN53KwaPNTdudDpOr9U+hQewJhls6QGQ0UjcbPkNailh3Z7r9u6zSjHInVwnLfFYymtP0V6mlBulvCn3filobx51WXW4KBIPpG9cVV1mX4IQAvhPURp2BVcvWP5L1dPPmwjpsSInNGsotnvytS+Y40KRXZJwGFugxYiZLQIhAwe63dJwiaMpDr29ttE32oBQ2VTmKDaAk1wtkg9+r/0q+nY0fxf0jq3/tlmLLNGU4CS+z4+z3OGSVuFJSIv4A1Nop0dxmawtG9Q2tOXc1cOzZ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 525f1f06-9446-408c-b0b0-08dac74b0515 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 20:50:25.0472 (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: UMwhrdbenGfTfKBkrOgKJ7Pbo1DZlwi9wVd/PiQZ874PrVpAt/+NV8AXuuX+lF5UbbLSBnBX6TAqcl3hAyfEkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7129 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749596894498443827?= X-GMAIL-MSGID: =?utf-8?q?1749596894498443827?= add page pool statistics to ethtool stats. Signed-off-by: Shenwei Wang --- drivers/net/ethernet/freescale/fec_main.c | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index bb2157022022..ae905ea1ab7d 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2755,6 +2755,24 @@ static void fec_enet_get_xdp_stats(struct fec_enet_private *fep, u64 *data) memcpy(data, xdp_stats, sizeof(xdp_stats)); } +static void fec_enet_page_pool_stats(struct fec_enet_private *fep, u64 *data) +{ + struct page_pool_stats stats = {}; + struct fec_enet_priv_rx_q *rxq; + int i; + + for (i = fep->num_rx_queues - 1; i >= 0; i--) { + rxq = fep->rx_queue[i]; + + if (!rxq->page_pool) + continue; + + page_pool_get_stats(rxq->page_pool, &stats); + } + + page_pool_ethtool_stats_get(data, &stats); +} + static void fec_enet_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { @@ -2768,6 +2786,8 @@ static void fec_enet_get_ethtool_stats(struct net_device *dev, fec_enet_get_xdp_stats(fep, data); data += XDP_STATS_TOTAL; + + fec_enet_page_pool_stats(fep, data); } static void fec_enet_get_strings(struct net_device *netdev, @@ -2784,6 +2804,7 @@ static void fec_enet_get_strings(struct net_device *netdev, strscpy(data, fec_xdp_stat_strs[i], ETH_GSTRING_LEN); data += ETH_GSTRING_LEN; } + page_pool_ethtool_stats_get_strings(data); break; case ETH_SS_TEST: net_selftest_get_strings(data); @@ -2795,7 +2816,8 @@ static int fec_enet_get_sset_count(struct net_device *dev, int sset) { switch (sset) { case ETH_SS_STATS: - return (ARRAY_SIZE(fec_stats) + XDP_STATS_TOTAL); + return (ARRAY_SIZE(fec_stats) + XDP_STATS_TOTAL + + page_pool_ethtool_stats_get_count()); case ETH_SS_TEST: return net_selftest_get_count(); default: