From patchwork Tue Nov 15 20:49:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 1695 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2935493wru; Tue, 15 Nov 2022 12:53:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Tb4OdQsVQAcM8Ezu/Txp+zYdGmcR+yACe4PJo5TkzAc1n3G7ljW+HUYVrFWs5gGm1WP8s X-Received: by 2002:a05:6402:1547:b0:461:5e99:a299 with SMTP id p7-20020a056402154700b004615e99a299mr16637976edx.40.1668545600844; Tue, 15 Nov 2022 12:53:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668545600; cv=pass; d=google.com; s=arc-20160816; b=K0V5fqWDzC1d6JoDwE1UGblgagOaMdo+cpo/j/8nvZXG3lEFzyNglGVjI9wSwLpHsD eUInfRJdrOFjx8hTKEoHZXHLf3l6qIQDegbcjhYFTAzjey7NP2GJdZ1UJfXwjCKswCgG I7zETx34ANTkpQNo4WBdfmlBwet8pAH/CeiUrlnbHrNok7M4BumzU4v2dTEbKWSIxHP/ omJVTdFAnMYdJweXRTjv5UhW5y0sWmcWe0ya208SKBGFQklXLvYVXMoTK/YOdle/jYuJ 4OE6L2zyv8xgRNA/7B52np/pwqSaOY3dsyxPMYoles3KDnRqEm4N2H8NoSNhPlVN1hxN FQUg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=/bgvgUHpnHVYwxcYIoGZlKG83XXI2aZHk0axyOY23N8=; b=PaT6ukpuJGsX7/wI4qvaeYs3L4JU/Db98lij0y7peWc7Upx+/0xU1uciFiiw+tn70h PCDaL+JyeAOZCGxr8tzo36C0uOduG9uwHgL1RQfoPU4uoBFKQ1lwJ2K+7T+NzbYKK6Mt KJa6zH168yJKHwGBdUjcNKwpNNhDMkH65E544UddzMIUEWME9s/VV36gFPjVGq5FciIL 7g5u86erx6cSPn/UPW51SnHYxZFm2otcVC/CBGgQPpZfTyQW041ZeTB29VjS2DDk7+XT k2nsuMzuCIO5kIR17my1vJ7AnArnaSav/TRimX6fJ0urzfVEMI1r5hGGSYmvNLT4p71s lVKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="kd4jS/Tv"; 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 oz43-20020a1709077dab00b007ae0211844dsi13321239ejc.937.2022.11.15.12.52.57; Tue, 15 Nov 2022 12:53:20 -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="kd4jS/Tv"; 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 S238289AbiKOUuR (ORCPT + 99 others); Tue, 15 Nov 2022 15:50:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238306AbiKOUuK (ORCPT ); Tue, 15 Nov 2022 15:50:10 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60075.outbound.protection.outlook.com [40.107.6.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2504C2D1DB; Tue, 15 Nov 2022 12:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWJ0IvRDtLbHVukaF0k/o0F0NzKAX1aVUw8XeUkthVihUIVDlxwvC0upNS10qdi9TLqRTqh3Sb3KpKIVF7sKRXbWT8EpE4Hh5awNogtmjglardEJbsw9v3mUKI/AjgtjUn6A2WjmncSsY7095eVS+r0ufVYC5ZZ5jT3dSNkaingwp8xEcbkxtDPyCyGbKQiSmTFyzr2zAaRzDCAjrIc/F++3YL7Obqb8OZ1BV5KJzWaAXQ3C9sUkDipmjSdYAFSE9p5c6tSHFJIO4FGZrK69hG/ku98p93w3S56+kBWkzUGEiMwy7EX18QYQy+lUltORnsljogxWhaSZmAMuDJ+inQ== 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=/bgvgUHpnHVYwxcYIoGZlKG83XXI2aZHk0axyOY23N8=; b=bX1UIUYPx0osUKVWoMEOJmp2YVqaZ/whZsWwwuWbIhvQho+GxkfK/JH9AmouNx2ebw3CuDioVxZDfU9lxS1nACeopK0WLcPjT+AE3TdQpPwDwVCG+T5QYi1MKNwlxEny2JsGV/7YYQfjWXjBcCVVaCd3wx5ntcHJsOjxKDhPQQaxj71w0cAGbnRmWXmBJV9cg7AonX2PcrlvKZzPd41i8H9gKbe8LisXJ2UsjF1iv6+jU8egBfla4YHcIQj6ptWlAVXuB8UO2yv1Y33sL0t3s0RCHMJn23MR3RjSGPgayiV1MvidnkDTSUzML4DQuEKXF9qpt4g0JHJ1hTt4BX3vAA== 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=/bgvgUHpnHVYwxcYIoGZlKG83XXI2aZHk0axyOY23N8=; b=kd4jS/TvuOEPTSdcjtWCcQS2xGrTCn4szzfBZiuo7aMrmmQrzirDU9Wyx3bicBwhuyJj6fxTwxiK8uyznV7A7z/srPgeEffJatUD5EcTju3T4pNuu/R6eYFW0DS6nVNdTgr4qGbeZaPBJOJeSTgS7/aIpiNapg7Wg4kWoJVeih0= 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:05 +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:05 +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 0/3] net: fec: add xdp and page pool statistics Date: Tue, 15 Nov 2022 14:49:48 -0600 Message-Id: <20221115204951.370217-1-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SJ0PR13CA0210.namprd13.prod.outlook.com (2603:10b6:a03:2c3::35) 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: 66acdb00-6632-4cdb-d649-08dac74af934 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G3jx33ioH1bYBzecEMQgdIguy0McAier46vppxU0jDtcdbSXMQgENwFf0/CXdMu7En4zBw7/XaufmUg1TzNe38090hl9Dn94wH3OSNeqxLgAJxvoWQDgR2GTFtum1jTdQke+ILcdqfUB7HE2EHGSg17DsetVVMzDQrwN38IPkkQJ7wN976Gbjkrsjo78ZjzoyQEkgXlXFMrvYAupW1I9sIDDkcxZ5hNCxEsziSCI3ToOrdvR24ef6Oz4SXnCguzXL3c01QpqZSD+nbumwd9YWD7cb20VzkTA7XYv+Xkr8omc+F9Hv2xEVQ/dHFuvwksaIn4HfIK7PO8HOjF/ADMRotiSeSV0AZti08z/FG594pUyvpS4Nu4RnINY0ATFAXkMrBnsTVjs9RRr1QKJrLRdxaLEVk8YsFRkxfwp+v0Okx4JlTH1+Wa7p/et02RWOf+2ZTeeVl4T6wz/lYDeckZEXGAgJS0em9Q8Lxvv83oidRRYIQVzvAgkHYatx+zuFEl198UKy6meyoTKOL02UxOHLFOW3iyetG36YCLcRZs6WREsNn70oJ9+CcAOhSZo3WF40VTkhiwc1Y3fdSMHGOTP9L0YxlEYQIMlWJWvUOsIP9rTeDQ6yStLmXhRVqoiLXvHjy6NjqMoU0SdHKIpX+3abQHQKn0XPF3+VR1VQMgo3pfPsUAjSacuI9BgOBGbNavB7ViRKQhzh7ThoAttDH58h0KgItMoAW52Bb0p8tXNvP4oiYu9TcILU2Vy9U2cLfALVKnSHvcdWd71Lmd/EZTF6w== 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)(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: LO/kYWjBISMMo8vTiMEQWtfVWFbA38/6DZ/CUJlyB+hCFquEPJVKsKJCWUrCDLFKUGilTIjYIfzt4XmLSVEJF5zc/iAhuy5OIIr5AVcRXkJIJRI4jLVbSopCFtRTF7jGJFbvCc6hZlVOZWi+d9cyGT3g+cF2daKiQVIEFLj8TYBmgsALTVkPccP1K4fRXGXCaiZFO7C2wKHmIBp0FzMKArJiuOCE6AewogylPWVL+DBCBF1wKWRL9qx+1YvvH8ubJp9QCHxlWaBQSxQgYtQFhJQ8ysg9HC4sSTZOd8zuL/E3G5gJZaDZWmecd+m9JDGZSyAOUja7AB+b2naABdKjvPNSrppKFvUyRRxVpxvo9PPSqfx1vjUPZnp5igzVSBlu2dKoA5aMTDINZhNlJbS/PB+unWl5hRlvIhJnbz3pjynCEhq3oTLfB1IAbA/QmU/RSGJAT+KViqksGzTDG8yLtj1WYHiVVyCsivQJ5Nxsr7pyuPK87QtXSaZT1CtJsZaDRN3TOaGgo22betALOOKwpvScSbyizDYlw3qLacK0opvxT0QEyroAgpJPls7uzkwYAY//VOuMH/vb7YsvBVkk8j+gNHe8aPYXVBd0DWlj0ZR3irpJeitTFT1G/2AoAsWMjtV0B/NgywHWACgBpRaZjopIf26133C1yUWKYwZgyD6nY7FB/whtuuhh2Ay7NDKq9tj1KOKAapYgzo9rWuPZYVr9fE9OTRcs/QWKXhNv48+fb3yahhnKN0GHWkHjFEi3rjpnRV4xygD239fTadBj8pak/VoOnFpBdl8aUcakaeQNVg7oQfDziVViBG2YSw2q9y948Pg5QeCoZtFu3yqrLuvs52wohnCSjBNMzcZoxVbSPz4bQAa9RUHZU3P7yceB1iGxGO+J8BUYzhF1IXUDU6Ce9k3y0tv0FzH086N9IbFYm7DJdPETGD+0kH1WAzXbVBX4W0xkec/7WWk/GPXdGiA+Vk8ly+6vMW3EPIT1VsHQ2f0IANMdtO7ULYPfr62KVyCjWg8LZ271tZrpZhZmZOO7gQvllVa6Av885VGm8LUId42sviV7sNXuBnG94iSR9NKZMQc0C7TG3frizv+gETDspKIijSX+polRH8QPNYj8213GSkA6fiSBCT6ma2vtqR6aMHNpQBKOMbKL1IbSMHoGaj9AYy0fPzne1/MDjiw//4BA+VZuq3OLxJSj38YX8jMwndxqHrMRQLmv0RKNZ6EzJ34SykZTXoJKY7DmtNS3SDDU/ge2XzTqrGnN/FA7wCiSU/SMteK9nib0q9uLoHWlEhzUMAdSBNtcc44iD9Kzwk6QbmdnyaKeQ0rNUo9GF2795aoFb99Pmg4oWbh1XVpbN3Lt4glH14csAnCNR0dFjW5Sg5CNiWo96bnNaU0oT5zDnmuuE0aOAma/qWJsmHKlKzNs9rHZeE6njsSkr5CFCb6K31CssGMMapbcGP+232TO+uuYl+PFyT2LvgKo3N92LpOraAzk5Q3L3cH77vl/ubDEYisK6ZOeOrACrZJha7swRpPIdUIsGNGLnepjcqDBKmnzzjhNWqurkpyzkMVG4pq+kBdvFya9h3eD0aqM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66acdb00-6632-4cdb-d649-08dac74af934 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:04.9937 (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: M9GOPovUvrMVzzzmJPA6S9IqgodhYCchxOHnjfLQ7ifK9ZdMEuZa1UDaUXq255fFGJhBHIcdqp4QdvtwsAJNcA== 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?1749596871694853070?= X-GMAIL-MSGID: =?utf-8?q?1749596871694853070?= Changes in V5: - split the patch into two: one for xdp statistics and one for page pool - fix the bug to zero xdp_stats array - use empty 'page_pool_stats' when CONFIG_PAGE_POOL_STATS is disabled. Changes in V4: - Using u64 to record the XDP statistics - Changing strncpy to strscpy - Remove the "PAGE_POOL_STATS" select per Alexander's feedback - Export the page_pool_stats definition in the page_pool.h Changes in v3: - change memcpy to strncpy to fix the warning reported by Paolo Abeni - fix the compile errors on powerpc Changes in v2: - clean up and restructure the codes per Andrew Lunn's review comments - clear the statistics when the adaptor is down Shenwei Wang (3): net: page_pool: export page_pool_stats definition net: fec: add xdp statistics net: fec: add page pool statistics drivers/net/ethernet/freescale/fec.h | 15 ++++ drivers/net/ethernet/freescale/fec_main.c | 96 +++++++++++++++++++++-- include/net/page_pool.h | 2 + 3 files changed, 107 insertions(+), 6 deletions(-) --- 2.34.1