From patchwork Mon Apr 8 01:29:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 13620471 X-Patchwork-Delegate: kuba@kernel.org Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2106.outbound.protection.partner.outlook.cn [139.219.17.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 773B64685; Mon, 8 Apr 2024 01:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.106 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712540783; cv=fail; b=G+MHKIN4P0KyoGLx+dmnTVLpt1rlAPBWDP1YgVd4QzmpyGOxtnc6v8ezLD5NP+WC5jHIIV6CtzfeeuEqOFPT+Bb5trfRIsxfR3PvXnihCnrH0kSrbLLupT6c4wbjIXy01f7Bcl4jHQXS6XBgyRQTnJH27rCa+J5o07ZBAxEx9tU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712540783; c=relaxed/simple; bh=JQxhhyRt8yD4RwyZ0R7BN2i2rF8WZQgn99xp5tlDhew=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LxnDpIPyEOquxid3j6h6E2eCERtkGIu8fpbu+bgbXDZiNwMIJmEcMPERbj7+y7gJwUt1J2NW6HA3cki5wfrli3twio3jaCBQGiWKPvl89k0Zfu0WFdcJmuOfH2AwzPuHr8e3nKKZLqKsuNdJrQebiILrJBeFDy3ogExdKLqMOA4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.17.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=llCK7Nx4rpXB7hHnYkRQt6CQyCHfzUlkvBHpkQmQRuwgxRwKtgDfCb48Uf5uCRbVOlb6P+aoKYEB3Woc9K6ST43rqWkmX13zQe8sdMU85RTHzWttvrkPdeQeaYVCONj+kzwn3ZxHMtsj4UgkVKQP7rVDac+V/xn5ROpYAL7tyi16GcowWWTnkPg+hN+XfmKphyqQZF65OquBGlqT9E/iyMemdtnXv317xaZ7MZaULKaGr2+iyMjtQS2r6cz3hfhFebV/SG8MTLKSxJVlyQTpQ/UrNjIJra1OxtTeLFnn6DPo07kZC51E5LXmJFX/M/Eal6ivwtj/NPxhHS8y8JWjCg== 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=2QX0SfnClk7LRWZIRU9iyQDvzeg5wiOTW+vSlPOWGvs=; b=C5S7Q2jAjlWqjuokBcRS7m4l9pZ+ALDbZIBMSK1b0C7Cq89xyvDW56bzerZpv/VyIHuj3fbAiShnx2d40zc6+QjnaOctMZZjQbVMUdr5xpfPJX45Ckd/EhKnun+AIzhW7eErvveufjU4kxVBn3QLhoPJVK/vriCgPN+/U03lQmeVIxS4Fy8vlbqn4QQJoOHGOkCxpqnBTWX4ihf/b6v1RXHXHsmkgVnglfkAxJtwEFdE1/fcfcLTXDd6HYQrUVgwzLf2Hxtny34YzInz+svLX7LYudnvnyTV9dsrcqNlooNtJN7jOnHgLjum+JsXtl/mCdi8LI44o2vsuhxyIp7Plw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) by SHXPR01MB0605.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Mon, 8 Apr 2024 01:30:16 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::a137:b8e5:8a0e:ca9f]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::a137:b8e5:8a0e:ca9f%4]) with mapi id 15.20.7409.053; Mon, 8 Apr 2024 01:30:16 +0000 From: Minda Chen To: Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] net: stmmac: mmc_core: Add GMAC LPI statistics Date: Mon, 8 Apr 2024 09:29:42 +0800 Message-Id: <20240408012943.66508-2-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240408012943.66508-1-minda.chen@starfivetech.com> References: <20240408012943.66508-1-minda.chen@starfivetech.com> X-ClientProxiedBy: ZQ0PR01CA0012.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:5::6) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_|SHXPR01MB0605:EE_ X-MS-Office365-Filtering-Correlation-Id: d924d458-a657-4fb8-ff29-08dc576b71c3 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S2Q/iSEaUVp2sdOviLvzC7Z/x6tyh1b+FlvJI3JVk4cH2oe4eSQ/+xuDlmZgXlOIYQ0M3mhHePWLKhmrWhovl+cL4LrqvAuWzndu5yE4+8U+rWZFp5QhwR9UaBVBH3P6pL57aJFcHIDm2yq0jYJw+BqfklDOmcUkSSRwfx0lPPs9fYJLCzvrCaHehxvAp/8YBhFRN4SN4m6mAA9IfrzKwyD/Ea5U5HGRMz2NTUYqgnUo8+pXrLOV/MuWlEL5Rpgt8OjeGeF2z+xwHzChWqNywwLW+AWQ+1p6yK1kLAI3cx16/Pisw7Vui/CuYZ9Dr2LoMWQ0IPr0UIjsfurq0fQmvyJSAkenlsbb9vtKMUZ7yBWW6V5TDvLVKTW7ZWM1WASkrhUCQmeUml+EgX3ZjyJ7ggT5jxd9TXuzUgtt65Y0yxyzsiSIWfONHi0m+Jq6lYnnV5+CSvBdZzvJdYE1GDTJkyY1HMlrzzk5tMLKsj1zBix7lu0P+xzB+MjUJ97G/aujfbgm98Uze/y9fVH95pVOLJPkbGPeoYgXqF9uPaR4sMfp1nI3YlTD0eV3kH+rhcYr4zpIlHtHhBSBsflHp5VEOyzXzTFGXsMbs7I6kkby+/gcxjwABtldpOsDbl49F3/G X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(366007)(41320700004)(7416005)(52116005)(1800799015)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MJUaj0hQtLPYrfFxoWasN40NbM5vVLA0JrGsMsBco2lqR5X9IDXFLeH3CvahjJp13k4S0dRnlMRlahY8WEu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cs3YKA+iQdCLNUtvis8ruhDo9/hFlioE2AZJIPLuVibOPsShuKt861v69elPeenxm7sbYBSCN0siD3xUKZDe4E7+HVM2aW4jmoAPS/rFlDEJsM+RWet5AAl+cgfCow6JQKPl3mH2mwLTC3K9a+b9jVhHdjDiLUljRmfeyF2SpKXzryDrB0M+Yw/rssf77FravNk845BIgoeUkMaS5en674HLzPmBG/CYLz8xWf3UpywzQUcvj/+Cr7Pqm9g3Yrr6QmeowelsIw9L4UrSHExKcV1SiinFPtOaPdOHx4p2TZJns8s3B8uR+IWriB/QS2qzp1vkVb1+4gp8BiMR8KDG4jWR/QsflNMGM473YukGmT8XMMGHCNieJmBzfH0Q3+ZNJ7Du3fsyoITknShF/FJCqE6rX0M8Do1OdPbW68OyvnOLeRHIvfYQktKfGNvlgzEmIHXsqQ== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: d924d458-a657-4fb8-ff29-08dc576b71c3 X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2024 01:30:16.6256 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bIVk/FFw3CZQJfSM0XvOTT9LPGFcXL0P6nUdul99jA7SYO3Cg0WUof/C5UTNj9OFxF7uDMDa7nMGNAnwWsBo9Z8A0bz1p8YQsJGcIiB5v3w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0605 X-Patchwork-Delegate: kuba@kernel.org XGMAC MMC has already added LPI statistics. GMAC MMC lack of these statistics. Add register definition and reading the LPI statistics from registers. Signed-off-by: Minda Chen Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c index 7eb477faa75a..b0db5f4e8fe8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c @@ -79,6 +79,12 @@ #define MMC_RX_FIFO_OVERFLOW 0xd4 #define MMC_RX_VLAN_FRAMES_GB 0xd8 #define MMC_RX_WATCHDOG_ERROR 0xdc + +#define MMC_TX_LPI_USEC 0xec +#define MMC_TX_LPI_TRAN 0xf0 +#define MMC_RX_LPI_USEC 0xf4 +#define MMC_RX_LPI_TRAN 0xf8 + /* IPC*/ #define MMC_RX_IPC_INTR_MASK 0x100 #define MMC_RX_IPC_INTR 0x108 @@ -283,6 +289,8 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc) mmc->mmc_tx_excessdef += readl(mmcaddr + MMC_TX_EXCESSDEF); mmc->mmc_tx_pause_frame += readl(mmcaddr + MMC_TX_PAUSE_FRAME); mmc->mmc_tx_vlan_frame_g += readl(mmcaddr + MMC_TX_VLAN_FRAME_G); + mmc->mmc_tx_lpi_usec += readl(mmcaddr + MMC_TX_LPI_USEC); + mmc->mmc_tx_lpi_tran += readl(mmcaddr + MMC_TX_LPI_TRAN); /* MMC RX counter registers */ mmc->mmc_rx_framecount_gb += readl(mmcaddr + MMC_RX_FRAMECOUNT_GB); @@ -316,6 +324,9 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc) mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW); mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB); mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR); + mmc->mmc_rx_lpi_usec += readl(mmcaddr + MMC_RX_LPI_USEC); + mmc->mmc_rx_lpi_tran += readl(mmcaddr + MMC_RX_LPI_TRAN); + /* IPv4 */ mmc->mmc_rx_ipv4_gd += readl(mmcaddr + MMC_RX_IPV4_GD); mmc->mmc_rx_ipv4_hderr += readl(mmcaddr + MMC_RX_IPV4_HDERR); From patchwork Mon Apr 8 01:29:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 13620510 X-Patchwork-Delegate: kuba@kernel.org Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2114.outbound.protection.partner.outlook.cn [139.219.17.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D423522F; Mon, 8 Apr 2024 03:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.17.114 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712545440; cv=fail; b=n8+jT5gdA9rsRvEMji2NU+y2uRb14OC1jwy6b+UbCHbmKk4RaTH0Cm2tAjcMbeM4H5z5NiwdH+y1eOgNKvBobDGLUMIDtSLxqNwCEbkRAH1KsjSea4jBXh0JX7EDl/Al4kMOG+i/bZ90G0YvMEOct93jR/O2mozG0YPrcLmYeYw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712545440; c=relaxed/simple; bh=bXD5oWWCtttoZyH/fJlQf6T/DhR/+fua4zLXUJavZXw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=a98DMGXHQTQOz0T/rSjVgeaRF3FM32bkLJUe5m6eX7GKyf0RX7vdylRtj0q7QUcgQSDls5Y2FudiKBXSzLzQkc/TRn+3m/tNDa/TzXBuE3xMbwc0iGeWGo2c7zdTc46larWNxKmn4uatyFlIDdl6VTnkoZILPYMx/OgGRV7eoRk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.17.114 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dIRl+u6yq9BhneHGcRT7kcDWVJ/nICKWlSqx2k0Imq3Y+g7VH59v/sCRCJELIuxMb4Z+qPrKOoYgogge6ROJ1kEKohrQLaWZgZzV+89eMln4W/8+ribWN3kNEzw1KK3nkL2IuvFxQtVY8/1ozgCfIe+40IkZeVkh6ypNy7wevVgE7WaUQq0ToLU3agT9TNNw558dsZ0GkoXMTSXtBs940rRsB3JycKhePgCAGpEkqgsQP2stsENggO7zV5FdAl32Gd4Rqf+2H19oPzL2apKQckAPyHXe+QDax4+l057oz1ifCNPBEHJX0AckXc2pGTQ47cnLHNMHiBmvke7skNtJlg== 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=eMHpdm0Pdoe+kMUPk+cXNJAMD3NI2g9hf8cdZv+rRPY=; b=KLTO4ZnjrEw8PAmrF/h3MGaGfWQ/vo7MxEksCeDNV8NZSJQk6fK3AhtqyGjoryWDgfwD+8rea+kmw6SdfpuyUPWtozIjwkf6oGTs9nVCMe7riYZ7oY66eALBN8NNwA7z27GTpvzYNfTl4pQV50zHCdBPDPL+v8z3Pd5shv9HlGMLtTBWLxzgtfbrP64aN/vunJNZd25c+3gdzKbuQXIu9hhfU4Qz92PYh31JVl4nccKEGzuWQnQEqVueKoNtOKJcc+VcMipDPZPAKRSFcckiNzvr7nH7Q96TttyqyxXKl+zPLtJIu8dRAK60sxJHpVVoemkqn08xLnJ+IfVvlmGF0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) by SHXPR01MB0605.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Mon, 8 Apr 2024 01:30:17 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::a137:b8e5:8a0e:ca9f]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::a137:b8e5:8a0e:ca9f%4]) with mapi id 15.20.7409.053; Mon, 8 Apr 2024 01:30:17 +0000 From: Minda Chen To: Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics Date: Mon, 8 Apr 2024 09:29:43 +0800 Message-Id: <20240408012943.66508-3-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240408012943.66508-1-minda.chen@starfivetech.com> References: <20240408012943.66508-1-minda.chen@starfivetech.com> X-ClientProxiedBy: ZQ0PR01CA0012.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:5::6) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_|SHXPR01MB0605:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d124cfc-e7b3-40d7-9377-08dc576b72ae X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7x/gIxA5gNq0nJ+ZDeGkNw4/XYFX1TCrU7EMWbjRhX9w5DVFONHs43ldNzbq0w6lYZznBmEHdtBT8OhgFqOv9MNG/AHymSQCy9d1KYuPQhfIsiu1h8Pbt0n3fn0g1sAdEyd6S+VtRc2EO6NQBTBSOmOzDtf+bvebu7NRH9g6t5Fb9VeLZ3Rq5xnjrL/qe7B1Fxw8bGFbHC82KZveOUbqSibKhz/GTO8iWj8KuuoBOniDdN1uZglr5Bg+k9zwsT93DNyVbf7n4oVMCct30g9xEHTV4JFV7pk4fPiqpLBLteMoj8deoYLnmD6J7IUTusTSvTJYOP0YIWXURGMfOIT4pUwiDCjosQSTb4xv33Cm4lBnBVBq+pV9MMGF9aR+PJ+iFbkwh3BGx4uCWD2ivj5vDi7hG2yNeyyjj52GhxFUuThY42AEKgVGwgvOEjyGzYeRUfKtqtXWuPo2SH24WBP1IkXG/X1c6YtyOfNgPwx66/uwPIaoe9mOISmo8aJzrDPTakpmj7Zro1WZKSGxMtXyQ1SiYI8tzX+Mb4gJBcH25EFQtdTFsY7PJfufQ+R65wDqZp3/73Ejtl0gWNEmACW3sbWiXZfl/7DXMqA8HVGJvz5qqh/XPTMzIB2ZBdKqCykh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(366007)(41320700004)(7416005)(52116005)(1800799015)(38350700005);DIR:O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JI2EGHPq/opkMbmWbEIN+jnBwiW8Yday3NlFvf09GtfpfHvMzmXF6ORIw6eJAmZlTzve3p/uFgL3xJfBijY0tm6Y5afRcdGY5lYOl1MlW3rcEssEkloBNzZRM2UEwkLplwIaa7IbX21KBlvvqtzlMWW7NeFYzUBJry3Zt0bAhMErNuzRUKt2LfObrBZ48Mu9nYYFF9Bmeg58hMcpjvK+oRi0Eme3PDy/0jKv6vQX6S7fU1GdQEKzlzmhiXhOeqPj9AMCUQKsPVbOVhqDnvYmOusOqhD3cmOSfmt3vwEVrKn8+A69pveXjcr1pt79k6SxXbCCRF6HGP0JWa+2HQDeYNlPzR2HBgdHFjAqOFBwvMylWyNeHw9sBHmeXWRLj2L1/zt9bmKyVRisC94vBzTHUCmUMoBXOD17b2a96TtyifP7wAajeRWgAXkpR8RCw3XNBEyR3fQ7PF3p+LlPZQjqPSkknIHv8h0RbT4b1ioJl7uKv7LhpUxHTUfEzIo68Dl82hK3Pxqt21EuC6uLdY53Mrus+Uhc7n2R+7I0bcPBaudt+mRIIWCD8C38juVpdx5wxz35BB9vLiknSVcf2wg1UUJaV+Dd7NgySJriWQ== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d124cfc-e7b3-40d7-9377-08dc576b72ae X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2024 01:30:17.7952 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7oKzcSj/tNKwE81hwkQ/BD8hwxONP0dX+jXF4tIs3o7DN0nZWgfFMV0kjPqHm6lyX8wnoNhSbDVAblKQ5CVu5AbCdjFooXlcfFFCm60Dxuk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0605 X-Patchwork-Delegate: kuba@kernel.org The missing statistics including Rx_Receive_Error_Packets and Tx_OSize_Packets_Good. Signed-off-by: Minda Chen Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/mmc.h | 2 ++ drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 4 ++++ drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc.h b/drivers/net/ethernet/stmicro/stmmac/mmc.h index dff02d75d519..5d1ea3e07459 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc.h +++ b/drivers/net/ethernet/stmicro/stmmac/mmc.h @@ -52,6 +52,7 @@ struct stmmac_counters { unsigned int mmc_tx_excessdef; unsigned int mmc_tx_pause_frame; unsigned int mmc_tx_vlan_frame_g; + unsigned int mmc_tx_oversize_g; unsigned int mmc_tx_lpi_usec; unsigned int mmc_tx_lpi_tran; @@ -80,6 +81,7 @@ struct stmmac_counters { unsigned int mmc_rx_fifo_overflow; unsigned int mmc_rx_vlan_frames_gb; unsigned int mmc_rx_watchdog_error; + unsigned int mmc_rx_error; unsigned int mmc_rx_lpi_usec; unsigned int mmc_rx_lpi_tran; unsigned int mmc_rx_discard_frames_gb; diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c index b0db5f4e8fe8..0fab842902a8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c @@ -53,6 +53,7 @@ #define MMC_TX_EXCESSDEF 0x6c #define MMC_TX_PAUSE_FRAME 0x70 #define MMC_TX_VLAN_FRAME_G 0x74 +#define MMC_TX_OVERSIZE_G 0x78 /* MMC RX counter registers */ #define MMC_RX_FRAMECOUNT_GB 0x80 @@ -79,6 +80,7 @@ #define MMC_RX_FIFO_OVERFLOW 0xd4 #define MMC_RX_VLAN_FRAMES_GB 0xd8 #define MMC_RX_WATCHDOG_ERROR 0xdc +#define MMC_RX_ERROR 0xe0 #define MMC_TX_LPI_USEC 0xec #define MMC_TX_LPI_TRAN 0xf0 @@ -289,6 +291,7 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc) mmc->mmc_tx_excessdef += readl(mmcaddr + MMC_TX_EXCESSDEF); mmc->mmc_tx_pause_frame += readl(mmcaddr + MMC_TX_PAUSE_FRAME); mmc->mmc_tx_vlan_frame_g += readl(mmcaddr + MMC_TX_VLAN_FRAME_G); + mmc->mmc_tx_oversize_g += readl(mmcaddr + MMC_TX_OVERSIZE_G); mmc->mmc_tx_lpi_usec += readl(mmcaddr + MMC_TX_LPI_USEC); mmc->mmc_tx_lpi_tran += readl(mmcaddr + MMC_TX_LPI_TRAN); @@ -324,6 +327,7 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc) mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW); mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB); mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR); + mmc->mmc_rx_error += readl(mmcaddr + MMC_RX_ERROR); mmc->mmc_rx_lpi_usec += readl(mmcaddr + MMC_RX_LPI_USEC); mmc->mmc_rx_lpi_tran += readl(mmcaddr + MMC_RX_LPI_TRAN); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index e1537a57815f..542e2633a6f5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -212,6 +212,7 @@ static const struct stmmac_stats stmmac_mmc[] = { STMMAC_MMC_STAT(mmc_tx_excessdef), STMMAC_MMC_STAT(mmc_tx_pause_frame), STMMAC_MMC_STAT(mmc_tx_vlan_frame_g), + STMMAC_MMC_STAT(mmc_tx_oversize_g), STMMAC_MMC_STAT(mmc_tx_lpi_usec), STMMAC_MMC_STAT(mmc_tx_lpi_tran), STMMAC_MMC_STAT(mmc_rx_framecount_gb), @@ -238,6 +239,7 @@ static const struct stmmac_stats stmmac_mmc[] = { STMMAC_MMC_STAT(mmc_rx_fifo_overflow), STMMAC_MMC_STAT(mmc_rx_vlan_frames_gb), STMMAC_MMC_STAT(mmc_rx_watchdog_error), + STMMAC_MMC_STAT(mmc_rx_error), STMMAC_MMC_STAT(mmc_rx_lpi_usec), STMMAC_MMC_STAT(mmc_rx_lpi_tran), STMMAC_MMC_STAT(mmc_rx_discard_frames_gb),