From patchwork Wed Aug 28 13:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13781300 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2042.outbound.protection.outlook.com [40.107.94.42]) (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 5F028241E7 for ; Wed, 28 Aug 2024 13:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852763; cv=fail; b=BM4w2bK7MVrZIoRS9A69J0sb/07rs136UkheV/Ds8ytzEh+1UQ9CLNNGj5lXPcqZFL1KTOq5WgxAwlF9OL3FuqTJnhLT0YCNmKRPBmOCeI/2tCxEH+hqKPjMeCuBDDfeL2SM8nGLO9fZgb+ZF/73UKrgdJ3P6O1NUZyLw11ozKQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852763; c=relaxed/simple; bh=dBAtAkuh54qvFDem+BzhpEicFd0Uw5gZa5aEg6cc7jw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GV15g9LIvTa4a3i0mMG94emHHCsxoaWc5obdzmHGB4UucM4svvJAwfc0yo9n1TVdneigruh0kHQ1vfWUpU82LugsfrCw11QQQSSNpVKb8HwkPzztUFKYqH/0S5I81KQqgWyQaMhvQaLzzgNvzQHZL0eHndeHSG/2/q7ob616eXc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=tldW8Rm5; arc=fail smtp.client-ip=40.107.94.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tldW8Rm5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o5pQR76LRtiB+FuPaGJFbqzPWMZh4lPsKt3oMzd6SRKOGXgBIxNbOETngJqG4Br/C7KRrIkGi8PGljwg4Xx1tcJtGT9op8ZYtNC0esH9/G6v2aq/kS+NloBUv+/4T3QJ3ho4zkZnmZQvBGkh8av7vqOX/JF+9Tq8oIUgR+H4W5Z1rW97X7vq/o7QWKT2PmHxvuuzilEulYzZsVHEhETjVy9ah9eAOycVfufSRijULX87dxDK18cOId84AaRjaABe+inkrd84KFhI71xHU709xBiY96lWUKHuDfsyut8u8FgkjKPUBgwW5r3aLKG21OYncCWm78CXU0OC/ol4YxmtQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Pdzz1H6XZdB6hsXiW4gpBVn6mcDmWekWf/ieCGjvxWw=; b=LCyeMYU/xfOj+OhO809qHodC5lJCq8d2DZ33Up+GBjcT41IaJ6GvNEhuRXAcRCzvYNEaKJICSdfunLhm5WVeyNwM4RdSr8iAwliqJVFiK39bLSM43om2HIMLuOJJV8IKQFyU8qo77qI68exI6p5N4H2e02yOnvQGI/LXTv3VE3i9J4B4Ry8co3qtFKMrv/j2V1QYdj1wtOzXNsJTZeI9T6qddkMSj/01p47PeK6PhaIW49NEccfCbK8XYgXwNg7vQKhuVtNEN14RdgE/2k8BF+eCn5/TyqclnyxZFfwK/VyY31iLJCaHDCAfXKcyzmaqzxLy/FUUVsUvIg1IRzDL2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pdzz1H6XZdB6hsXiW4gpBVn6mcDmWekWf/ieCGjvxWw=; b=tldW8Rm54qtUPND+2Co7Cmyc8+wzzSf/5Yjnxf0jrOM7Zev7Ixb1vmXLQp89qpRXWhe2wM5orp2iwK0N0kPReULJBN5pkI/txRMNouY0UzRVClgIpr67R9tQN9Z82O7d1gXEu1a9xt5kEoNcubUkx5VJApoc9qm7jkq99Z5OqvQ= Received: from SA1P222CA0064.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2c1::15) by SJ2PR12MB7845.namprd12.prod.outlook.com (2603:10b6:a03:4ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Wed, 28 Aug 2024 13:45:58 +0000 Received: from SN1PEPF0002BA50.namprd03.prod.outlook.com (2603:10b6:806:2c1:cafe::3a) by SA1P222CA0064.outlook.office365.com (2603:10b6:806:2c1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Wed, 28 Aug 2024 13:45:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002BA50.mail.protection.outlook.com (10.167.242.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 13:45:57 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:55 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 28 Aug 2024 08:45:54 -0500 From: To: , , , , CC: Edward Cree , Subject: [PATCH net-next 1/6] sfc: remove obsolete counters from struct efx_channel Date: Wed, 28 Aug 2024 14:45:10 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA50:EE_|SJ2PR12MB7845:EE_ X-MS-Office365-Filtering-Correlation-Id: ab47fe83-5f4c-4184-f655-08dcc767bec0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: /j94FcEOBV9Lm7IH/w8Q6mXvPKnWyJOf8cFJZAuPmIs67m2XeSYbHe5eajxWkZ4TE6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T+H+5F/n4CY9u+8P5DriU5hLLv3bp5O9LbJnwE6zRQiCXdOrhny94pSAlyyAc7+/ZUj1MBZ7Q5sH+OBTGB1mpLVF0dv2GGR0MqnQj/nQFe3a6nkooAT9lRscKgDhp4tgs0oLzt07L1ven04BMkbTBgTtuOZlaFM9roybYEpXNJyGvJnRwHil/8Zzu5HcRbkKz32Z0OCGKkS149NJ3u5l7IBjvliIYP8myua45dNgdbKp1q1nF+daG7jSJQCZezWBSx+UfowClHB/mr+7zqTCTuH27iUeWIAOWPUllLt5Ag46F0L+djmgfTzbFJNuxM0ghtb X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 13:45:57.4706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab47fe83-5f4c-4184-f655-08dcc767bec0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA50.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7845 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree The n_rx_tobe_disc and n_rx_mcast_mismatch counters are a legacy from farch, and are never written in EF10 or EF100 code. Remove them from the struct and from ethtool -S output, saving a bit of memory and avoiding user confusion. Signed-off-by: Edward Cree Reviewed-by: Jacob Keller --- drivers/net/ethernet/sfc/ethtool_common.c | 2 -- drivers/net/ethernet/sfc/net_driver.h | 4 ---- 2 files changed, 6 deletions(-) diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c index 6ded44b86052..a8baeacd83c0 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.c +++ b/drivers/net/ethernet/sfc/ethtool_common.c @@ -75,7 +75,6 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = { EFX_ETHTOOL_UINT_TXQ_STAT(pio_packets), EFX_ETHTOOL_UINT_TXQ_STAT(cb_packets), EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(rx_reset), - EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tobe_disc), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_ip_hdr_chksum_err), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tcp_udp_chksum_err), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_inner_ip_hdr_chksum_err), @@ -83,7 +82,6 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = { EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_outer_ip_hdr_chksum_err), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_outer_tcp_udp_chksum_err), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_eth_crc_err), - EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_mcast_mismatch), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_events), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_packets), diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index b85c51cbe7f9..4d904e1404d4 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -451,10 +451,8 @@ enum efx_sync_events_state { * @filter_work: Work item for efx_filter_rfs_expire() * @rps_flow_id: Flow IDs of filters allocated for accelerated RFS, * indexed by filter ID - * @n_rx_tobe_disc: Count of RX_TOBE_DISC errors * @n_rx_ip_hdr_chksum_err: Count of RX IP header checksum errors * @n_rx_tcp_udp_chksum_err: Count of RX TCP and UDP checksum errors - * @n_rx_mcast_mismatch: Count of unmatched multicast frames * @n_rx_frm_trunc: Count of RX_FRM_TRUNC errors * @n_rx_overlength: Count of RX_OVERLENGTH errors * @n_skbuff_leaks: Count of skbuffs leaked due to RX overrun @@ -511,7 +509,6 @@ struct efx_channel { u32 *rps_flow_id; #endif - unsigned int n_rx_tobe_disc; unsigned int n_rx_ip_hdr_chksum_err; unsigned int n_rx_tcp_udp_chksum_err; unsigned int n_rx_outer_ip_hdr_chksum_err; @@ -519,7 +516,6 @@ struct efx_channel { unsigned int n_rx_inner_ip_hdr_chksum_err; unsigned int n_rx_inner_tcp_udp_chksum_err; unsigned int n_rx_eth_crc_err; - unsigned int n_rx_mcast_mismatch; unsigned int n_rx_frm_trunc; unsigned int n_rx_overlength; unsigned int n_skbuff_leaks; From patchwork Wed Aug 28 13:45:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13781299 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2074.outbound.protection.outlook.com [40.107.95.74]) (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 2933A1DFE3 for ; Wed, 28 Aug 2024 13:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852763; cv=fail; b=pFK2tt68HvEZ+/6++Km9IJTQ9oJvKhleUFcebZ2il5Wi46BSaXAeBort+nKGGpU1kqNjHwzeYRnazvrgJ938/U2U2qC7hn3qE6eIWKR2S6+U/oGLETj7NaUSKzZcHDvTi0mSZ+Us3oy0H57KNuRlaUAB7NBqvLf4ER1K8XtwO0w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852763; c=relaxed/simple; bh=AlPgx2TkTLWjeDDUns5chyOH8xCUsAgzc/pY7s5GoZk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e3ujn5h9ozOlLqucj9cygdLt4P1NM8VUWkAuzH+YkgczoGkcrxL0R9BTaTUWs8VEwBF2VQgCpikxLK8kI8Irzmw4oaIJLQJpAZMTRgPnAW3QmaqaoR24hIfEAt9wvF8ek4dmpF7z6Av8J4jEHTjIXcqfz+YPpextbdwpfAU6Wc4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=L2etoc4/; arc=fail smtp.client-ip=40.107.95.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="L2etoc4/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IXeO2jlC+9mYH7fbALy9WBGDnWvc3nxUOzdbdAHtrVpQYkuV5HZ7xEUZ2nxgU0/5gl07t9e7inwDtMXKC2XRGr0r7KnqzXRVOwdXWDmq3bCmnrCZYVommpN22sKuLSTW4VgY0yGLE2chT63/1W+sArwoXuk+++Vgiq4Y18WryQZstprR3lXzxD/F6Kkk5c0qUMDfHY7cU2uWf3mqGe9khfBv7LWfKudxoUaww2GqUa3xp99XRN1bN+vth516ajW4L3fhiMqWyomBAPVQSsK7z1T6p0LghzVJxFXll86Jf+1vXdKlyLpgweljnvh8GeS5/SEKc49UiVIx5DFds92nPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KlWnmDJkQwQnLTXFtESBviLWmbFO2A/nS2TG0yBpnxs=; b=aIS2tnmMZ6WNiruuLo5Vy+b/962qkkXtdFYK8bVPeoe2ivecQd+e0hC22cebvlzIfQoHBIzjab6SFGfIxarPKtY5KQewO478tNvYmJdDOJF2EvJndqZfnSc/3hexDZpPn9wf5/y3iZw8MwiaJDIHdsjQ7oWzIZTDmNYihZcYQN182+aN5XVkl+e1IRO+EBpiSjj3kHBKUkLKxHKi5ckpGi5hqYbIJFH5RNW3XPS7VWizcAYQdmBlBs9OfrNe4YTcTjlcUNvMdr2vc2TCMU+qBbXOTGHyS3AlE1PswLGNN6fD+3MUHOoPGkovSo2cXaw9hgmnv/PIwoXolxG4TkhKbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KlWnmDJkQwQnLTXFtESBviLWmbFO2A/nS2TG0yBpnxs=; b=L2etoc4/wUYV2X5c2kfksm/0s5jmfSj/MGNyp189gMJBRJPpaVrmsZZhXUPaoDsmjg30vfKkUG2ldzHKrByhlJZvmsPWVjSW7abMpQuZovkj82z/zshlxoeTwQdIrbuIWz/L86UbP9wATk+RxKplyi1jqcgMvVYq0cV90pDGdAw= Received: from BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) by DM4PR12MB5867.namprd12.prod.outlook.com (2603:10b6:8:66::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Wed, 28 Aug 2024 13:45:58 +0000 Received: from BL6PEPF0001AB76.namprd02.prod.outlook.com (2603:10b6:208:35:cafe::8f) by BL0PR02CA0142.outlook.office365.com (2603:10b6:208:35::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Wed, 28 Aug 2024 13:45:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB76.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 13:45:57 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:56 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:56 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 28 Aug 2024 08:45:55 -0500 From: To: , , , , CC: Edward Cree , Subject: [PATCH net-next 2/6] sfc: implement basic per-queue stats Date: Wed, 28 Aug 2024 14:45:11 +0100 Message-ID: <54cf35ea0d5c0ec46e0717a6181daaa2419ca91e.1724852597.git.ecree.xilinx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB76:EE_|DM4PR12MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 23d270be-d31b-4066-9d7a-08dcc767bea9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: igJXuUc4azV3a5odn/DBukwROEkDSsLamtoC+WAzdWZX+RhP9Fc95PR5o17mNXw96MM2KWUgKAUcz0KOjyNA1v9P1Ja/SVbpRCHmQRmkRBWcN+IaQGWLEQkJA20nYg8m32QUjuYuEfsLcg9XQvTpvcLCmZ1ccpaj8HBq12rMKPumxKWvvG9hsT8Nz0FcVU31X/TYKfoON7GlyMndUIK0qbSdiL/NM3ek5TfkainMYg/EcSbbynhoc1RYyFZOnAYPvLX4ktL1hUcR0brDkCeai7f5in5NL8OT1Ym2WVVrN+e9XK8h/sU0XmDqujBjsGJmhpIkaQPgyOs4pBxeTOM/BWe7t9Il2CIve1uwl8z6bN2d/BN3aElCLu25U9W7A+kK08cV7MIXT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-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 13:45:57.3488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23d270be-d31b-4066-9d7a-08dcc767bea9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB76.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5867 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Just RX and TX packet counts for now. We do not have per-queue byte counts, which causes us to fail stats.pkt_byte_sum selftest with "Drivers should always report basic keys" error. Per-queue counts are since the last time the queue was inited (typically by efx_start_datapath(), on ifup or reconfiguration); device-wide total (efx_get_base_stats()) is since driver probe. This is not the same lifetime as rtnl_link_stats64, which uses firmware stats which count since FW (re)booted; this can cause a "Qstats are lower" or "RTNL stats are lower" failure in stats.pkt_byte_sum selftest. Move the increment of rx_queue->rx_packets to match the semantics specified for netdev per-queue stats, i.e. just before handing the packet to XDP (if present) or the netstack (through GRO). This will affect the existing ethtool -S output which also reports these counters. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef100_rx.c | 4 +- drivers/net/ethernet/sfc/efx.c | 72 +++++++++++++++++++++++++ drivers/net/ethernet/sfc/efx_channels.h | 1 - drivers/net/ethernet/sfc/net_driver.h | 6 +++ drivers/net/ethernet/sfc/rx.c | 4 +- drivers/net/ethernet/sfc/rx_common.c | 2 + drivers/net/ethernet/sfc/tx_common.c | 2 + 7 files changed, 86 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/sfc/ef100_rx.c b/drivers/net/ethernet/sfc/ef100_rx.c index 83d9db71d7d7..992151775cb8 100644 --- a/drivers/net/ethernet/sfc/ef100_rx.c +++ b/drivers/net/ethernet/sfc/ef100_rx.c @@ -134,6 +134,8 @@ void __ef100_rx_packet(struct efx_channel *channel) goto free_rx_buffer; } + ++rx_queue->rx_packets; + efx_rx_packet_gro(channel, rx_buf, channel->rx_pkt_n_frags, eh, csum); goto out; @@ -149,8 +151,6 @@ static void ef100_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index) struct efx_channel *channel = efx_rx_queue_channel(rx_queue); struct efx_nic *efx = rx_queue->efx; - ++rx_queue->rx_packets; - netif_vdbg(efx, rx_status, efx->net_dev, "RX queue %d received id %x\n", efx_rx_queue_index(rx_queue), index); diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 6f1a01ded7d4..e4656efce969 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -22,6 +22,7 @@ #include "net_driver.h" #include #include +#include #include "efx.h" #include "efx_common.h" #include "efx_channels.h" @@ -626,6 +627,76 @@ static const struct net_device_ops efx_netdev_ops = { .ndo_bpf = efx_xdp }; +static void efx_get_queue_stats_rx(struct net_device *net_dev, int idx, + struct netdev_queue_stats_rx *stats) +{ + struct efx_nic *efx = efx_netdev_priv(net_dev); + struct efx_rx_queue *rx_queue; + struct efx_channel *channel; + + channel = efx_get_channel(efx, idx); + rx_queue = efx_channel_get_rx_queue(channel); + /* Count only packets since last time datapath was started */ + stats->packets = rx_queue->rx_packets - rx_queue->old_rx_packets; +} + +static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx, + struct netdev_queue_stats_tx *stats) +{ + struct efx_nic *efx = efx_netdev_priv(net_dev); + struct efx_tx_queue *tx_queue; + struct efx_channel *channel; + + channel = efx_get_tx_channel(efx, idx); + stats->packets = 0; + /* If a TX channel has XDP TXQs, the stats for these will be counted + * under the channel rather than in base stats. Unclear whether this + * is correct behaviour, but we can't reliably exclude XDP TXes from + * these stats anyway because in EFX_XDP_TX_QUEUES_BORROWED we use + * the same TXQ as the core. + */ + efx_for_each_channel_tx_queue(tx_queue, channel) + stats->packets += tx_queue->tx_packets - tx_queue->old_tx_packets; +} + +static void efx_get_base_stats(struct net_device *net_dev, + struct netdev_queue_stats_rx *rx, + struct netdev_queue_stats_tx *tx) +{ + struct efx_nic *efx = efx_netdev_priv(net_dev); + struct efx_tx_queue *tx_queue; + struct efx_rx_queue *rx_queue; + struct efx_channel *channel; + + rx->packets = 0; + tx->packets = 0; + + /* Count all packets on non-core queues, and packets before last + * datapath start on core queues. + */ + efx_for_each_channel(channel, efx) { + rx_queue = efx_channel_get_rx_queue(channel); + if (channel->channel >= net_dev->real_num_rx_queues) + rx->packets += rx_queue->rx_packets; + else + rx->packets += rx_queue->old_rx_packets; + efx_for_each_channel_tx_queue(tx_queue, channel) { + if (channel->channel < efx->tx_channel_offset || + channel->channel >= efx->tx_channel_offset + + net_dev->real_num_tx_queues) + tx->packets += tx_queue->tx_packets; + else + tx->packets += tx_queue->old_tx_packets; + } + } +} + +static const struct netdev_stat_ops efx_stat_ops = { + .get_queue_stats_rx = efx_get_queue_stats_rx, + .get_queue_stats_tx = efx_get_queue_stats_tx, + .get_base_stats = efx_get_base_stats, +}; + static int efx_xdp_setup_prog(struct efx_nic *efx, struct bpf_prog *prog) { struct bpf_prog *old_prog; @@ -716,6 +787,7 @@ static int efx_register_netdev(struct efx_nic *efx) net_dev->watchdog_timeo = 5 * HZ; net_dev->irq = efx->pci_dev->irq; net_dev->netdev_ops = &efx_netdev_ops; + net_dev->stat_ops = &efx_stat_ops; if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) net_dev->priv_flags |= IFF_UNICAST_FLT; net_dev->ethtool_ops = &efx_ethtool_ops; diff --git a/drivers/net/ethernet/sfc/efx_channels.h b/drivers/net/ethernet/sfc/efx_channels.h index 46b702648721..b3b5e18a69cc 100644 --- a/drivers/net/ethernet/sfc/efx_channels.h +++ b/drivers/net/ethernet/sfc/efx_channels.h @@ -49,5 +49,4 @@ void efx_fini_napi_channel(struct efx_channel *channel); void efx_fini_napi(struct efx_nic *efx); void efx_channel_dummy_op_void(struct efx_channel *channel); - #endif diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 4d904e1404d4..cc96716d8dbe 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -232,6 +232,8 @@ struct efx_tx_buffer { * @xmit_pending: Are any packets waiting to be pushed to the NIC * @cb_packets: Number of times the TX copybreak feature has been used * @notify_count: Count of notified descriptors to the NIC + * @tx_packets: Number of packets sent since this struct was created + * @old_tx_packets: Value of @tx_packets as of last efx_init_tx_queue() * @empty_read_count: If the completion path has seen the queue as empty * and the transmission path has not yet checked this, the value of * @read_count bitwise-added to %EFX_EMPTY_COUNT_VALID; otherwise 0. @@ -281,6 +283,7 @@ struct efx_tx_queue { unsigned int notify_count; /* Statistics to supplement MAC stats */ unsigned long tx_packets; + unsigned long old_tx_packets; /* Members shared between paths and sometimes updated */ unsigned int empty_read_count ____cacheline_aligned_in_smp; @@ -370,6 +373,8 @@ struct efx_rx_page_state { * @recycle_count: RX buffer recycle counter. * @slow_fill: Timer used to defer efx_nic_generate_fill_event(). * @grant_work: workitem used to grant credits to the MAE if @grant_credits + * @rx_packets: Number of packets received since this struct was created + * @old_rx_packets: Value of @rx_packets as of last efx_init_rx_queue() * @xdp_rxq_info: XDP specific RX queue information. * @xdp_rxq_info_valid: Is xdp_rxq_info valid data?. */ @@ -406,6 +411,7 @@ struct efx_rx_queue { struct work_struct grant_work; /* Statistics to supplement MAC stats */ unsigned long rx_packets; + unsigned long old_rx_packets; struct xdp_rxq_info xdp_rxq_info; bool xdp_rxq_info_valid; }; diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index f77a2d3ef37e..f07495582125 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c @@ -125,8 +125,6 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, struct efx_channel *channel = efx_rx_queue_channel(rx_queue); struct efx_rx_buffer *rx_buf; - rx_queue->rx_packets++; - rx_buf = efx_rx_buffer(rx_queue, index); rx_buf->flags |= flags; @@ -394,6 +392,8 @@ void __efx_rx_packet(struct efx_channel *channel) goto out; } + rx_queue->rx_packets++; + if (!efx_do_xdp(efx, channel, rx_buf, &eh)) goto out; diff --git a/drivers/net/ethernet/sfc/rx_common.c b/drivers/net/ethernet/sfc/rx_common.c index 0b7dc75c40f9..bdb4325a7c2c 100644 --- a/drivers/net/ethernet/sfc/rx_common.c +++ b/drivers/net/ethernet/sfc/rx_common.c @@ -241,6 +241,8 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue) rx_queue->page_recycle_failed = 0; rx_queue->page_recycle_full = 0; + rx_queue->old_rx_packets = rx_queue->rx_packets; + /* Initialise limit fields */ max_fill = efx->rxq_entries - EFX_RXD_HEAD_ROOM; max_trigger = diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index 2adb132b2f7e..f1694900e0f0 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -86,6 +86,8 @@ void efx_init_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->completed_timestamp_major = 0; tx_queue->completed_timestamp_minor = 0; + tx_queue->old_tx_packets = tx_queue->tx_packets; + tx_queue->xdp_tx = efx_channel_is_xdp_tx(tx_queue->channel); tx_queue->tso_version = 0; From patchwork Wed Aug 28 13:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13781301 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) (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 F07521DFE1 for ; Wed, 28 Aug 2024 13:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852764; cv=fail; b=eWUNRnA3D2UTUXpMGcIRZgE9T2iCk4aBH6ZW5rjf1FpNAfAF0iVVqyWFQlJYSKYLTGJrhc+VGbOIyt7iEH25YyfJT1ghP5dRbPUm72CECdNHMdbfXQIRMsPsBpb5DwQMxjXxwMkaWDY0uCqJz88rYTheAmdK52ddSR8/7JSI9tE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852764; c=relaxed/simple; bh=Eqyb7evNrPzG2LFbcfOgAADGWLbiMaQJyp1/XxhOT6g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mnjQ4FNjkWgsEfWxAxoPaTOsS61SteS7RArDmu9VYafaFtUZ7PUvzCB1/yfpFXdPetWHDRO5q9ynlDlt+KyR3IMHQSSxjkvngPcezei7Kx61OVX0E1epMeEEIkde0k0A/ZqO1jKzVv7OqKD+vOcjUy7PP4rsQqYDT7aPT2qn00s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=5RLLveU7; arc=fail smtp.client-ip=40.107.223.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="5RLLveU7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dxnN8ACkU7JckbhVOjMAWqXJIuYhaAfsICQlAKTR00gsnvDJFj+mDmTPVO0lmp1Sr6Nq3MSE4D1bns5Tu0uQMISbTVHQyrEM2OQNNaCT87YijHKG1LZ4rq+fNvQ0cmZYaDX08iNWPKgGLID0BVGl7mGOAOwZRe06m5u+dbEbb8yz4dfIBxJtlYdcYgk+KHx14RnZRYX8I/g5syDaqIn8II1rf2xRvVzO8cfQrD5bwqBzbZN2ruNExkOn8JCcV8cX905l+VkT9hSlbNGzcID+ruRTU168ccRMKisXTIPRLb2u72bpbkh/fw9jh9tQbVzk5/X1dpp+fUVi+FeL09t5SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UswNknTvo3YA5EIxQwUVLwgznB4IOf83B+UnItVPj0k=; b=mRFFHxMfx2jqP65h4y8qBN5SDny8uyY58hU8K6O4K43tlpv3Wbtj481OlRz27I4NuUUS4Z682ntgkV7wQnDAnTXeJ/vJwWRILbk2JfrArf62s10sM+MuCgvuIwnOO8hiVPJfHadsd1CY29lb3vU9sgEBdt54uncEkgZ5voKz6V+bNSM/l7qWLbnTZ/xekUc5MTPhw5K9S8Ukd9JlE1OvPDc913qB3udS9lwsnKXbNR9s5W5BS/PpMk5qzHiWdbIR8iG615ZeaEi+LFiR/5GkJifXdp0pu7U6SZCIxibiLPmbxOj48pJ4dWpCVgAcXN2QqeLKCsA0CCJGOZaklviaHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UswNknTvo3YA5EIxQwUVLwgznB4IOf83B+UnItVPj0k=; b=5RLLveU7qZ7ip/VLWdWGFL8Zqpv4rkoTM+nSp+ifhqEoR+lqhyTPWlvMJzEPm10KYZPVlDGcBN1DTDd0jYHwdSXG3rG/atXKraNNXu1tuzCtIGWeZmhp/CrzqqUF6bI/k3u9YjsuHwy8cWhEetQNHBDTLmzItkL24W2CS/UMwbg= Received: from SA1P222CA0065.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2c1::16) by MW4PR12MB7359.namprd12.prod.outlook.com (2603:10b6:303:222::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Wed, 28 Aug 2024 13:45:59 +0000 Received: from SN1PEPF0002BA50.namprd03.prod.outlook.com (2603:10b6:806:2c1:cafe::60) by SA1P222CA0065.outlook.office365.com (2603:10b6:806:2c1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Wed, 28 Aug 2024 13:45:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002BA50.mail.protection.outlook.com (10.167.242.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 13:45:59 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:57 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:57 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 28 Aug 2024 08:45:56 -0500 From: To: , , , , CC: Edward Cree , Subject: [PATCH net-next 3/6] sfc: add n_rx_overlength to ethtool stats Date: Wed, 28 Aug 2024 14:45:12 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA50:EE_|MW4PR12MB7359:EE_ X-MS-Office365-Filtering-Correlation-Id: 9148853d-d2f3-4148-3800-08dcc767bfe6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;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Wr9UNMbthHBbZuMgQa6Z53gH27l5dQ/xZ4iS/Ddv2jx6RJRobLI8O2MFYXiCjMd4X4p7uXmblrIlm0JnQUqFk8CT59M1enUJfK94DTMfixMly59HbHbm5ngQ5RHY7DRj1tHo07FEcmJB21K7Kx+Vei06YS620Z9ryFTRuHUaK68N8BtvHHv2oxbmDsnjdXthDncuIDVJHqJ4Wx3kAC6TgJlc9OLqqzPjRrVg7es04aH2Ae2/VtOgatCHFZOaQbb1dIlQu+rqwB6SJXQawWw1xQ8+EG+XgskBLoUtAW89AW+M6sQIu451zNdbunkekGeYgmb3APoaeSNPnG6QvX1d4Z49E59eRs2Cc7Xn5EZpXN6828IxK5BdE/+iARlGHX32NX/zGn+ncEFBnB6/lbJAe2M5pYKNt84L5bseTWDSz4QC4Eg1rO7X7 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 13:45:59.4081 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9148853d-d2f3-4148-3800-08dcc767bfe6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA50.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7359 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree This counter is the main difference between the old and new locations of the rx_packets increment (the other is scatter errors which produce a WARN_ON). It previously was not reported anywhere; add it to ethtool -S output to ensure users still have this information. Signed-off-by: Edward Cree Reviewed-by: Jacob Keller --- drivers/net/ethernet/sfc/ethtool_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c index a8baeacd83c0..ae32e08540fa 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.c +++ b/drivers/net/ethernet/sfc/ethtool_common.c @@ -83,6 +83,7 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = { EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_outer_tcp_udp_chksum_err), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_eth_crc_err), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc), + EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_overlength), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_events), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_packets), EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_xdp_drops), From patchwork Wed Aug 28 13:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13781303 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2060.outbound.protection.outlook.com [40.107.92.60]) (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 BE8C5188016 for ; Wed, 28 Aug 2024 13:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852766; cv=fail; b=Xs1W1yyAi1vNv/PZNmY3etZfLwMKcFoOe/zzdOy1d2YfkL5uGybhxUzN6tYpzXSTSkytS9C9wA62E29j+NQuE38Pjh8sjxpVhuQKXm3yFYqDqt9qo/mFAclHtbB14KIEq5/BGzloLzovg5b/mID83yzdX9qS1VJvsAIOU+mWZt0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852766; c=relaxed/simple; bh=SohGqyf4xQHlPn+Jpy/FPFGTdDRzadLSivXTa/QG7V4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S+8rqdKK7owmXAsW1L2bCOnPsegLi8M810T/oycEk0VYoSe0IBiICItn6nTo+i/m3OjYH53EbvvGWZdRkYbgglCHqQfPZBaEmT0qHO6EhXSaSH/xcSNKhYIlgUlfnnc/Qhj2ro6RrpE05GtHP5+zWyPbYtPy1Vin1qq/kvd7XhY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=kAvr9XXp; arc=fail smtp.client-ip=40.107.92.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="kAvr9XXp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BfX12+mjWuMTQF2YZcz9lQaw3AabkgwTp4tQrMMwH7otlksAh9DCUu2FCYKmYxA8cEaeM3VjGeFufoWDmWSKetx5HKpH+iE7NjJTqYfXvqr+7rrqmMKHxYXMdTaQW19SDk5x1h3jyj2GS2IuAi15VKbi+2w0dfhUsF0W9eumacTRi1S95DQJVRO53wY0T/zKSjI0aHS54kPeV73J7iQTzenAS1vKj3+LSsSU1Xp1xcuojj2ZpZQdZdyQEMwIzZgm3O1pZrhQDa+z30dlY23mkPkSIxDt71+dEkZvViREiaRbdHBiPPKCwt/iA591E/VHk5B3bfFepr9qWQsDOJkYPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=k3iep3+X4PGt3FOGtLQgA9lEGosfrN0WZIq/WDHvOrg=; b=BdldpOlRVKvslLt8jgsZeAyCLlIuGnzMb4yStUS99jO326U3zl2j0R/y0dp/gXDOKcKWCUoYg5mUah3ZMolTFDDSoyAByenpaMGYg0sLGxb5/84/xMfIZnWgZjCka3ayWLBYmOf2OC9zDpjUU32TrA2APb7yvk5ydmDivh5GKZgDXQkeFT3Zl95L0lz1dRvZ1hqvA+Z5XK6Q3NOg8flPPQO0TJhRcqlJcaUkXpZligHuqD7dKK+rkBaR4OAcuQ+MHDGObO8PHxwpTwPdUekWQQQTzhOZtJhCWztadp7oxM6U6/M3n+2/pUdkR8HtOT2WCldcQ/xYILNoNJPyOkFybw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k3iep3+X4PGt3FOGtLQgA9lEGosfrN0WZIq/WDHvOrg=; b=kAvr9XXpqb3RKQcYEMPGj20IBOXm70hifXQJFFwnIWuzKI+Ju2SZNY4V7jOj/9fcE2f0boPOAah17F/3pnC2+svjZ8muR1VlqEaMHoBp4McVb39QFVZ+mPDzXjiqUWmyw1gHveSGGlxJ4ZK6gjFH/nxTxlvrrhR9WLSbhZyJkkA= Received: from BN1PR14CA0008.namprd14.prod.outlook.com (2603:10b6:408:e3::13) by SJ2PR12MB7865.namprd12.prod.outlook.com (2603:10b6:a03:4cc::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Wed, 28 Aug 2024 13:45:59 +0000 Received: from BL6PEPF0001AB77.namprd02.prod.outlook.com (2603:10b6:408:e3:cafe::76) by BN1PR14CA0008.outlook.office365.com (2603:10b6:408:e3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Wed, 28 Aug 2024 13:45:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB77.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 13:45:59 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:58 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 28 Aug 2024 08:45:57 -0500 From: To: , , , , CC: Edward Cree , Subject: [PATCH net-next 4/6] sfc: implement per-queue rx drop and overrun stats Date: Wed, 28 Aug 2024 14:45:13 +0100 Message-ID: <379cc84db6cfb516f8eb677a1b703cbacfa46e02.1724852597.git.ecree.xilinx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB77:EE_|SJ2PR12MB7865:EE_ X-MS-Office365-Filtering-Correlation-Id: ebba11c4-94d5-463a-6910-08dcc767bfd3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: xoZUEHrTcgL0pTthcvdC54qZTW+3duGQeSAPr9nGw0xJ+0ta5GHtu/1hyq2cKZOwld7ZuWHZ3faPeZ//VAhyeaDpgUmsx9wl1P5WlWHc+FUzXwahR8oSNm/hLjXUMskX7aWxK9IyrW25Okhk2+bIUPQlmR6vSDeAovXuZJfg9b+8NzmOXA6H2B+bMjcH3b/tUJEwl5Lui7TGYkhA+I2+jE35DiSMHdys7J6xED8M2dfQJYBs6CFP6uptdF0rjYATDm2j1DJ15GUGQT1Jpl8VNK7bcL5q0JN39W4BjuVCGjcsO+7wGtNaXtESVJXE/xCNO3PG/wQd1rP7KXENosLmTSbAzg1Wonep8OkQH0/L/utI/Nh6zZden1OPGeEjTG2n9HJVLcb9o136JHkXiJR8PizcQ9MQLourLNz9vgcK69Va6UWvFvdKWcYfs/ZTIs2bOnhQSsHikmeD1HMYQmiogkkIklM70ij3CC2z5N3rA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omainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 13:45:59.2847 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebba11c4-94d5-463a-6910-08dcc767bfd3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB77.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7865 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Signed-off-by: Edward Cree Reviewed-by: Jacob Keller --- drivers/net/ethernet/sfc/efx.c | 15 +++++++++++++-- drivers/net/ethernet/sfc/efx_channels.c | 4 ++++ drivers/net/ethernet/sfc/efx_channels.h | 7 +++++++ drivers/net/ethernet/sfc/net_driver.h | 7 +++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index e4656efce969..8b46d143b6c7 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -638,6 +638,10 @@ static void efx_get_queue_stats_rx(struct net_device *net_dev, int idx, rx_queue = efx_channel_get_rx_queue(channel); /* Count only packets since last time datapath was started */ stats->packets = rx_queue->rx_packets - rx_queue->old_rx_packets; + stats->hw_drops = efx_get_queue_stat_rx_hw_drops(channel) - + channel->old_n_rx_hw_drops; + stats->hw_drop_overruns = channel->n_rx_nodesc_trunc - + channel->old_n_rx_hw_drop_overruns; } static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx, @@ -669,6 +673,8 @@ static void efx_get_base_stats(struct net_device *net_dev, struct efx_channel *channel; rx->packets = 0; + rx->hw_drops = 0; + rx->hw_drop_overruns = 0; tx->packets = 0; /* Count all packets on non-core queues, and packets before last @@ -676,10 +682,15 @@ static void efx_get_base_stats(struct net_device *net_dev, */ efx_for_each_channel(channel, efx) { rx_queue = efx_channel_get_rx_queue(channel); - if (channel->channel >= net_dev->real_num_rx_queues) + if (channel->channel >= net_dev->real_num_rx_queues) { rx->packets += rx_queue->rx_packets; - else + rx->hw_drops += efx_get_queue_stat_rx_hw_drops(channel); + rx->hw_drop_overruns += channel->n_rx_nodesc_trunc; + } else { rx->packets += rx_queue->old_rx_packets; + rx->hw_drops += channel->old_n_rx_hw_drops; + rx->hw_drop_overruns += channel->old_n_rx_hw_drop_overruns; + } efx_for_each_channel_tx_queue(tx_queue, channel) { if (channel->channel < efx->tx_channel_offset || channel->channel >= efx->tx_channel_offset + diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c index c9e17a8208a9..90b9986ceaa3 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -1100,6 +1100,10 @@ void efx_start_channels(struct efx_nic *efx) atomic_inc(&efx->active_queues); } + /* reset per-queue stats */ + channel->old_n_rx_hw_drops = efx_get_queue_stat_rx_hw_drops(channel); + channel->old_n_rx_hw_drop_overruns = channel->n_rx_nodesc_trunc; + efx_for_each_channel_rx_queue(rx_queue, channel) { efx_init_rx_queue(rx_queue); atomic_inc(&efx->active_queues); diff --git a/drivers/net/ethernet/sfc/efx_channels.h b/drivers/net/ethernet/sfc/efx_channels.h index b3b5e18a69cc..cccbc7d66e77 100644 --- a/drivers/net/ethernet/sfc/efx_channels.h +++ b/drivers/net/ethernet/sfc/efx_channels.h @@ -43,6 +43,13 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel); void efx_start_channels(struct efx_nic *efx); void efx_stop_channels(struct efx_nic *efx); +static inline u64 efx_get_queue_stat_rx_hw_drops(struct efx_channel *channel) +{ + return channel->n_rx_eth_crc_err + channel->n_rx_frm_trunc + + channel->n_rx_overlength + channel->n_rx_nodesc_trunc + + channel->n_rx_mport_bad; +} + void efx_init_napi_channel(struct efx_channel *channel); void efx_init_napi(struct efx_nic *efx); void efx_fini_napi_channel(struct efx_channel *channel); diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index cc96716d8dbe..25701f37aa40 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -472,6 +472,10 @@ enum efx_sync_events_state { * @n_rx_xdp_redirect: Count of RX packets redirected to a different NIC by XDP * @n_rx_mport_bad: Count of RX packets dropped because their ingress mport was * not recognised + * @old_n_rx_hw_drops: Count of all RX packets dropped for any reason as of last + * efx_start_channels() + * @old_n_rx_hw_drop_overruns: Value of @n_rx_nodesc_trunc as of last + * efx_start_channels() * @rx_pkt_n_frags: Number of fragments in next packet to be delivered by * __efx_rx_packet(), or zero if there is none * @rx_pkt_index: Ring index of first buffer for next packet to be delivered @@ -534,6 +538,9 @@ struct efx_channel { unsigned int n_rx_xdp_redirect; unsigned int n_rx_mport_bad; + unsigned int old_n_rx_hw_drops; + unsigned int old_n_rx_hw_drop_overruns; + unsigned int rx_pkt_n_frags; unsigned int rx_pkt_index; From patchwork Wed Aug 28 13:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13781302 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2051.outbound.protection.outlook.com [40.107.92.51]) (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 BA11E188014 for ; Wed, 28 Aug 2024 13:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852766; cv=fail; b=RNGcK2ofPhXrKy+kemMGWanTaeY2f1uHpnqwEIr5ZIu4I7n18PJB19rFdAwWfRJGrHISt3ed+UgLebASjp4t91BlDQSlj76dIz9a03mMuy+rFTY+Ckbe8nI52X8SdvlIBwgHl2+tskSXKxyNuQzq6xzQ+j7q2SBuUdSl9fBjyDE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852766; c=relaxed/simple; bh=QnlGXbssvsCcpDGbfk7mP+XhiEQcLKzKE15aqwCw8Xk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l3NxjRG9dl2cbFgy1JxR3BeEJYo2gGbbw6gXLLNZGIrq/lG0m6O9RjxiUxRDYzdSVV1UwGMcp2d78W8U1+E1SC9OfnZZiiokgXPs6TQJyjSLNMI6UBAuQPosDZyBfZaRPgqFb89zoSSrLSTqtLCDmDKK+E/iK7MKkMfQDMZ1Syk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=V1iMjWt4; arc=fail smtp.client-ip=40.107.92.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="V1iMjWt4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VKloY2CXp15TnzHpdkYe7TcPn6l2b9SW4dSVglITXxoBd0iJc+Cz7KwrCgen9fjw8Bu2VxPaFLMSnGRyBloElZtCk94my+MKmPg2stOS06lbmzD55riAcqtQF2HmcwtrFCW/wa5UXPhxWebzuloqZE3Fze6Smu0381wbs57GSEAWhT0hF20pSEhcj6WSGWBweqDDC+9aEVFj6W9rEVzX6+mSBFxWfeurCxSCHAoT3+HyWv2O2XmF9A/8uzGu/Zi4eU7SCV4d8tvXZrbX200yAmOCOrc3NSJik5/+nF/Ixg4PFTJxBG4A7C0PuVldyq60/j9Wrvfx4NgJg7i0dikWdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=lbQogCNzWeAwSmJmwPOieRaXtB/5V9CyMgc+6FeYfV0=; b=j3CeMUeYsUjj22JsmQF/r3RpfHkt8P0JIDlpEpcBNttlWxUdQVjY1tHMoPF9ol8ohvj5jrUng+XBly8dZ0exqNF0Fwqufqtc3fotTSe5TrYbKPud1glgsCVTGp3Cc4J7ML0saWF55HGC8ui4ez9mPaWbn1B09ML4I9Acf533jKNq1W0iYyQ7D3GDjorYeMkFDHSy2N4ZxrSflsptg2JFfD4IqkOhI258AjVNLNWTc6iSTk1O9fTMpwQws9I7wYjFLGj498l3PO5yov7mCcMamF3u4rIfiWvXX9D1jfMYSk4MXiXljaaWD4faLyNKGDdMoTUTpAMbd8+1Yix5GDS25Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lbQogCNzWeAwSmJmwPOieRaXtB/5V9CyMgc+6FeYfV0=; b=V1iMjWt4LH8KC2KHGpLM7MSN92muTX8CbvIC+F6+4EubcEHnPrMLEzUOBcKRbRJdtgTor65BQ2EV7geX0OH4rfFfLiy+wa15gHfcOZ5jwf2ENvGdVhRBStUrHZgVGhTuLcrWZKO6piqr2BLWkUbxXGpL3L0rEIwjqQGDpeBe7Dc= Received: from SA1P222CA0064.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2c1::15) by SA1PR12MB8142.namprd12.prod.outlook.com (2603:10b6:806:334::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Wed, 28 Aug 2024 13:46:00 +0000 Received: from SN1PEPF0002BA50.namprd03.prod.outlook.com (2603:10b6:806:2c1:cafe::d1) by SA1P222CA0064.outlook.office365.com (2603:10b6:806:2c1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend Transport; Wed, 28 Aug 2024 13:46:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002BA50.mail.protection.outlook.com (10.167.242.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 13:46:00 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:45:59 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 28 Aug 2024 08:45:58 -0500 From: To: , , , , CC: Edward Cree , Subject: [PATCH net-next 5/6] sfc: implement per-queue TSO (hw_gso) stats Date: Wed, 28 Aug 2024 14:45:14 +0100 Message-ID: <35782d70ad89c72d5dc819f9a12b2e5b4e742141.1724852597.git.ecree.xilinx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA50:EE_|SA1PR12MB8142:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b238878-a1ac-4570-f2d1-08dcc767c0c3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: mKQzmyGkxF+XMY3tHwTpbT9J8Nt829chJ/vx/lxLPE7BHOLxJd9dMbI7TL758axZOulYVQA8PYJEFXrGCq69HiMB92CnaEEFsGrEqYutc2hvccY2WFae+dVBbCX+1o58yMO/iDRestgIdd9lQjFU2+VD6EJxQdXg5arFhhvkHJu/cm4LXn8eGfESCrcdBHCT68At8JmrfwPYfBIkkulVXnXigr/102m19tMxQv/K8jcvDzwwFjsshUdiC0aBQm4Ipw6Ju+Et0RYsZsKuUnVDeUiHE7nJlLhmlvuGV2Jp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SHEohhZ+BApYY33zRosc/rU7VJXjQ8uD3u+wSvRw4AO8DYmNvNUYkR4mD9zeI6/3PIEzE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 13:46:00.8612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b238878-a1ac-4570-f2d1-08dcc767c0c3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA50.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8142 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Signed-off-by: Edward Cree Reviewed-by: Jacob Keller --- drivers/net/ethernet/sfc/efx.c | 20 +++++++++++++++++--- drivers/net/ethernet/sfc/net_driver.h | 4 ++++ drivers/net/ethernet/sfc/tx_common.c | 2 ++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 8b46d143b6c7..bf06fbcdcbff 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -653,14 +653,21 @@ static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx, channel = efx_get_tx_channel(efx, idx); stats->packets = 0; + stats->hw_gso_packets = 0; + stats->hw_gso_wire_packets = 0; /* If a TX channel has XDP TXQs, the stats for these will be counted * under the channel rather than in base stats. Unclear whether this * is correct behaviour, but we can't reliably exclude XDP TXes from * these stats anyway because in EFX_XDP_TX_QUEUES_BORROWED we use * the same TXQ as the core. */ - efx_for_each_channel_tx_queue(tx_queue, channel) + efx_for_each_channel_tx_queue(tx_queue, channel) { stats->packets += tx_queue->tx_packets - tx_queue->old_tx_packets; + stats->hw_gso_packets += tx_queue->tso_bursts - + tx_queue->old_tso_bursts; + stats->hw_gso_wire_packets += tx_queue->tso_packets - + tx_queue->old_tso_packets; + } } static void efx_get_base_stats(struct net_device *net_dev, @@ -676,6 +683,8 @@ static void efx_get_base_stats(struct net_device *net_dev, rx->hw_drops = 0; rx->hw_drop_overruns = 0; tx->packets = 0; + tx->hw_gso_packets = 0; + tx->hw_gso_wire_packets = 0; /* Count all packets on non-core queues, and packets before last * datapath start on core queues. @@ -694,10 +703,15 @@ static void efx_get_base_stats(struct net_device *net_dev, efx_for_each_channel_tx_queue(tx_queue, channel) { if (channel->channel < efx->tx_channel_offset || channel->channel >= efx->tx_channel_offset + - net_dev->real_num_tx_queues) + net_dev->real_num_tx_queues) { tx->packets += tx_queue->tx_packets; - else + tx->hw_gso_packets += tx_queue->tso_bursts; + tx->hw_gso_wire_packets += tx_queue->tso_packets; + } else { tx->packets += tx_queue->old_tx_packets; + tx->hw_gso_packets += tx_queue->old_tso_bursts; + tx->hw_gso_wire_packets += tx_queue->old_tso_packets; + } } } } diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 25701f37aa40..2cf2935a713c 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -234,6 +234,8 @@ struct efx_tx_buffer { * @notify_count: Count of notified descriptors to the NIC * @tx_packets: Number of packets sent since this struct was created * @old_tx_packets: Value of @tx_packets as of last efx_init_tx_queue() + * @old_tso_bursts: Value of @tso_bursts as of last efx_init_tx_queue() + * @old_tso_packets: Value of @tso_packets as of last efx_init_tx_queue() * @empty_read_count: If the completion path has seen the queue as empty * and the transmission path has not yet checked this, the value of * @read_count bitwise-added to %EFX_EMPTY_COUNT_VALID; otherwise 0. @@ -284,6 +286,8 @@ struct efx_tx_queue { /* Statistics to supplement MAC stats */ unsigned long tx_packets; unsigned long old_tx_packets; + unsigned int old_tso_bursts; + unsigned int old_tso_packets; /* Members shared between paths and sometimes updated */ unsigned int empty_read_count ____cacheline_aligned_in_smp; diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index f1694900e0f0..cd0857131aa8 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -87,6 +87,8 @@ void efx_init_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->completed_timestamp_minor = 0; tx_queue->old_tx_packets = tx_queue->tx_packets; + tx_queue->old_tso_bursts = tx_queue->tso_bursts; + tx_queue->old_tso_packets = tx_queue->tso_packets; tx_queue->xdp_tx = efx_channel_is_xdp_tx(tx_queue->channel); tx_queue->tso_version = 0; From patchwork Wed Aug 28 13:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13781304 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2081.outbound.protection.outlook.com [40.107.92.81]) (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 12F17188CAC for ; Wed, 28 Aug 2024 13:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852766; cv=fail; b=iZ2IAOVhRmgBQMjjrxatXMLytHeO2VVGd1BotGraWIINLPwXS4z9xP/0mnswv+YQY1Atzu4gqHCfSqBG5NIcgqDSVXsAEmWCp5EEZ326IGOg/QRYgE3ZquVccVf25aRnkFc8CX6CmEKA82OLJUs7eSpzr746SygvfyrR21DvL7Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724852766; c=relaxed/simple; bh=BkqzjF7u7nQIbQ2L2lbRvun8QIoAlqi12VueZS8zQDw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DPUFbrf7BqHV2jk+I7if7BFtDdfLPsZGL2ERg2zUZun6mFbpmjmmWc3OTesq9tNd//q/SyYEf1wgEnuhkTRqwa/fC6TtzXhmCp3MLYfRPTWo3qqqtJQYTO2QdNT/XnFgI1gWj69xrksLb9dlQQzYwnNwxy/RSBbC8NJSSyba2DE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=fMqY5Zxu; arc=fail smtp.client-ip=40.107.92.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="fMqY5Zxu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iTIxVKeVZiwzZfKmgP8OuURR2Mjm77G9ZGwE/OA6dEGbAbgjxj7+pg2nx9dm/gZiKP6kWEag+jyUCZr8eSn5NuEas7FmzbgPr5xvXWjcKEuDjBObOnU28L5jyZBwyM2sq5K5ThGGwD0SU1088hy+wk2YU2k5t0vYN2MqBn2GILVCst5UT9JNatT1TbNtYzEG5iG4+b2rIxXhSsDxIOu6/ocMaABY4wWZ6DEui+8hcR/l78yw2UTPNLfWbCT7QVIwTAfW1Mcpju5FkSloo0mz0ElQC8uNXuxNPUNUIGKR7qL8txI41C9e/lndLf+j8k5n27PBKmom1LP/8nIU/GpVSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0YLxYkfwuAQ+K5oJK4ma80+49Lg1px0qurjUxzWpu3c=; b=AdyGBj0jbwnHLFV4SmQXIE3uP6S9vN+0xcpKX0ELqRpsOF73/ccM/JFsGLnt+ijsBV5/3zdSg4UuwtDZXualXTxa13ksWmCiES73h0BwQ2ruPsmyuMjZfcCbVOj01STfjVf2jNI2bP+7eGa/NpflbZ6Atj6m5BIKjpOu+X7836xxzFzv52DM6RB/DGWUaqsV3W4FkReprwgbhQp7gk3i4iFuvyVhiMW5YM+U1sqSD9MVKNciWs2H99C4y8JRyEhoDigfCYweKu5OJzE9DFNGfOdOZ53XbpTVy57ZsYOy3nrbAFD7DPHSNa2y/8i4eT/m4V6GjaFp7vqQ3bKtABvIxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0YLxYkfwuAQ+K5oJK4ma80+49Lg1px0qurjUxzWpu3c=; b=fMqY5ZxuK3PzuBhQq3CabGGDYAocimqm4FzMSSlYzouKVtsAFvosVOFifqNPbRyGtwVOJPDZQTqc3Deqmb8pzR/clCGU5QtEXyXRbmLnDQgwnO+6kyuTqL/ShHxkLDwy2cVahYnWhbXPT7UbGWj9TMyUDukKHEsI8QlVmcYi9+I= Received: from SA1P222CA0078.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2c1::25) by CY8PR12MB8068.namprd12.prod.outlook.com (2603:10b6:930:75::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 28 Aug 2024 13:46:01 +0000 Received: from SN1PEPF0002BA50.namprd03.prod.outlook.com (2603:10b6:806:2c1:cafe::e2) by SA1P222CA0078.outlook.office365.com (2603:10b6:806:2c1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend Transport; Wed, 28 Aug 2024 13:46:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002BA50.mail.protection.outlook.com (10.167.242.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 13:46:01 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug 2024 08:46:00 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 28 Aug 2024 08:46:00 -0500 From: To: , , , , CC: Edward Cree , Subject: [PATCH net-next 6/6] sfc: add per-queue RX and TX bytes stats Date: Wed, 28 Aug 2024 14:45:15 +0100 Message-ID: <9695a02a3f50cf7d4c1a6321cd42a0538fc686be.1724852597.git.ecree.xilinx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA50:EE_|CY8PR12MB8068:EE_ X-MS-Office365-Filtering-Correlation-Id: 03bed6a9-876b-41eb-1447-08dcc767c147 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: C/uusDqsMO1qstUxkDtKGXfvWEujiWf06vW4ddFRDBVOpYYTU496kVgcGdw9qCRq1zZxdYidsKhpuf1eONVaJ0zbBWYwS1tgetigfK8Tl1mJSEsgPzhnJruBau0OHwDffngRHr7LWVrTpqMNcI2mNsvnmIufIY4ub3lwNW+DAC4BILfFV8dQq7i4REmWa6xotreh/ZMVmnz2k+1Rl300xAVq6Fx/BfA1/3Z1M9ntTmUU8M4G1H6hAPxy10x8CxGDhGcf3LaKqAfxBTiBtWhFhZIqWLy2EXfVcS1IbVgYSmfElKoKGhohnaAiWl3pwYztU8qaeE0MC1pfwP2dSIgSwDNFNcOc06L4botdn7cPq6ECssnBwzxGlqGQg+pLWJTOMGwPZwkrDijOQb9zPOKDhFYWuszgtbGgETpahZet82ZfvS6w88AsAUyk3v2ZCq8+5CwbucZVZOF7FCyg5mW2rt/v0pN+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SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 13:46:01.7050 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03bed6a9-876b-41eb-1447-08dcc767c147 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA50.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8068 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree While this does add overhead to the fast path, it should be minimal as the cacheline should already be held for write from updating the queue's [tr]x_packets stat. Signed-off-by: Edward Cree Reviewed-by: Jacob Keller --- drivers/net/ethernet/sfc/ef100_rx.c | 1 + drivers/net/ethernet/sfc/ef100_tx.c | 1 + drivers/net/ethernet/sfc/efx.c | 9 +++++++++ drivers/net/ethernet/sfc/net_driver.h | 10 ++++++++++ drivers/net/ethernet/sfc/rx.c | 1 + drivers/net/ethernet/sfc/rx_common.c | 1 + drivers/net/ethernet/sfc/tx.c | 2 ++ drivers/net/ethernet/sfc/tx_common.c | 1 + 8 files changed, 26 insertions(+) diff --git a/drivers/net/ethernet/sfc/ef100_rx.c b/drivers/net/ethernet/sfc/ef100_rx.c index 992151775cb8..44dc75feb162 100644 --- a/drivers/net/ethernet/sfc/ef100_rx.c +++ b/drivers/net/ethernet/sfc/ef100_rx.c @@ -135,6 +135,7 @@ void __ef100_rx_packet(struct efx_channel *channel) } ++rx_queue->rx_packets; + rx_queue->rx_bytes += rx_buf->len; efx_rx_packet_gro(channel, rx_buf, channel->rx_pkt_n_frags, eh, csum); goto out; diff --git a/drivers/net/ethernet/sfc/ef100_tx.c b/drivers/net/ethernet/sfc/ef100_tx.c index e6b6be549581..a7e30289e231 100644 --- a/drivers/net/ethernet/sfc/ef100_tx.c +++ b/drivers/net/ethernet/sfc/ef100_tx.c @@ -493,6 +493,7 @@ int __ef100_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb, } else { tx_queue->tx_packets++; } + tx_queue->tx_bytes += skb->len; return 0; err: diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index bf06fbcdcbff..b3fbffed4e61 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -638,6 +638,7 @@ static void efx_get_queue_stats_rx(struct net_device *net_dev, int idx, rx_queue = efx_channel_get_rx_queue(channel); /* Count only packets since last time datapath was started */ stats->packets = rx_queue->rx_packets - rx_queue->old_rx_packets; + stats->bytes = rx_queue->rx_bytes - rx_queue->old_rx_bytes; stats->hw_drops = efx_get_queue_stat_rx_hw_drops(channel) - channel->old_n_rx_hw_drops; stats->hw_drop_overruns = channel->n_rx_nodesc_trunc - @@ -653,6 +654,7 @@ static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx, channel = efx_get_tx_channel(efx, idx); stats->packets = 0; + stats->bytes = 0; stats->hw_gso_packets = 0; stats->hw_gso_wire_packets = 0; /* If a TX channel has XDP TXQs, the stats for these will be counted @@ -663,6 +665,7 @@ static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx, */ efx_for_each_channel_tx_queue(tx_queue, channel) { stats->packets += tx_queue->tx_packets - tx_queue->old_tx_packets; + stats->bytes += tx_queue->tx_bytes - tx_queue->old_tx_bytes; stats->hw_gso_packets += tx_queue->tso_bursts - tx_queue->old_tso_bursts; stats->hw_gso_wire_packets += tx_queue->tso_packets - @@ -680,9 +683,11 @@ static void efx_get_base_stats(struct net_device *net_dev, struct efx_channel *channel; rx->packets = 0; + rx->bytes = 0; rx->hw_drops = 0; rx->hw_drop_overruns = 0; tx->packets = 0; + tx->bytes = 0; tx->hw_gso_packets = 0; tx->hw_gso_wire_packets = 0; @@ -693,10 +698,12 @@ static void efx_get_base_stats(struct net_device *net_dev, rx_queue = efx_channel_get_rx_queue(channel); if (channel->channel >= net_dev->real_num_rx_queues) { rx->packets += rx_queue->rx_packets; + rx->bytes += rx_queue->rx_bytes; rx->hw_drops += efx_get_queue_stat_rx_hw_drops(channel); rx->hw_drop_overruns += channel->n_rx_nodesc_trunc; } else { rx->packets += rx_queue->old_rx_packets; + rx->bytes += rx_queue->old_rx_bytes; rx->hw_drops += channel->old_n_rx_hw_drops; rx->hw_drop_overruns += channel->old_n_rx_hw_drop_overruns; } @@ -705,10 +712,12 @@ static void efx_get_base_stats(struct net_device *net_dev, channel->channel >= efx->tx_channel_offset + net_dev->real_num_tx_queues) { tx->packets += tx_queue->tx_packets; + tx->bytes += tx_queue->tx_bytes; tx->hw_gso_packets += tx_queue->tso_bursts; tx->hw_gso_wire_packets += tx_queue->tso_packets; } else { tx->packets += tx_queue->old_tx_packets; + tx->bytes += tx_queue->old_tx_bytes; tx->hw_gso_packets += tx_queue->old_tso_bursts; tx->hw_gso_wire_packets += tx_queue->old_tso_packets; } diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 2cf2935a713c..147052c1e25a 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -233,7 +233,11 @@ struct efx_tx_buffer { * @cb_packets: Number of times the TX copybreak feature has been used * @notify_count: Count of notified descriptors to the NIC * @tx_packets: Number of packets sent since this struct was created + * @tx_bytes: Number of bytes sent since this struct was created. For TSO, + * counts the superframe size, not the sizes of generated frames on the + * wire (i.e. the headers are only counted once) * @old_tx_packets: Value of @tx_packets as of last efx_init_tx_queue() + * @old_tx_bytes: Value of @tx_bytes as of last efx_init_tx_queue() * @old_tso_bursts: Value of @tso_bursts as of last efx_init_tx_queue() * @old_tso_packets: Value of @tso_packets as of last efx_init_tx_queue() * @empty_read_count: If the completion path has seen the queue as empty @@ -285,7 +289,9 @@ struct efx_tx_queue { unsigned int notify_count; /* Statistics to supplement MAC stats */ unsigned long tx_packets; + unsigned long tx_bytes; unsigned long old_tx_packets; + unsigned long old_tx_bytes; unsigned int old_tso_bursts; unsigned int old_tso_packets; @@ -378,7 +384,9 @@ struct efx_rx_page_state { * @slow_fill: Timer used to defer efx_nic_generate_fill_event(). * @grant_work: workitem used to grant credits to the MAE if @grant_credits * @rx_packets: Number of packets received since this struct was created + * @rx_bytes: Number of bytes received since this struct was created * @old_rx_packets: Value of @rx_packets as of last efx_init_rx_queue() + * @old_rx_bytes: Value of @rx_bytes as of last efx_init_rx_queue() * @xdp_rxq_info: XDP specific RX queue information. * @xdp_rxq_info_valid: Is xdp_rxq_info valid data?. */ @@ -415,7 +423,9 @@ struct efx_rx_queue { struct work_struct grant_work; /* Statistics to supplement MAC stats */ unsigned long rx_packets; + unsigned long rx_bytes; unsigned long old_rx_packets; + unsigned long old_rx_bytes; struct xdp_rxq_info xdp_rxq_info; bool xdp_rxq_info_valid; }; diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index f07495582125..ffca82207e47 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c @@ -393,6 +393,7 @@ void __efx_rx_packet(struct efx_channel *channel) } rx_queue->rx_packets++; + rx_queue->rx_bytes += rx_buf->len; if (!efx_do_xdp(efx, channel, rx_buf, &eh)) goto out; diff --git a/drivers/net/ethernet/sfc/rx_common.c b/drivers/net/ethernet/sfc/rx_common.c index bdb4325a7c2c..ab358fe13e1d 100644 --- a/drivers/net/ethernet/sfc/rx_common.c +++ b/drivers/net/ethernet/sfc/rx_common.c @@ -242,6 +242,7 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue) rx_queue->page_recycle_full = 0; rx_queue->old_rx_packets = rx_queue->rx_packets; + rx_queue->old_rx_bytes = rx_queue->rx_bytes; /* Initialise limit fields */ max_fill = efx->rxq_entries - EFX_RXD_HEAD_ROOM; diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index fe2d476028e7..1aea19488a56 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c @@ -394,6 +394,7 @@ netdev_tx_t __efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb } else { tx_queue->tx_packets++; } + tx_queue->tx_bytes += skb_len; return NETDEV_TX_OK; @@ -490,6 +491,7 @@ int efx_xdp_tx_buffers(struct efx_nic *efx, int n, struct xdp_frame **xdpfs, tx_buffer->dma_offset = 0; tx_buffer->unmap_len = len; tx_queue->tx_packets++; + tx_queue->tx_bytes += len; } /* Pass mapped frames to hardware. */ diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index cd0857131aa8..7ef2baa3439a 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -87,6 +87,7 @@ void efx_init_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->completed_timestamp_minor = 0; tx_queue->old_tx_packets = tx_queue->tx_packets; + tx_queue->old_tx_bytes = tx_queue->tx_bytes; tx_queue->old_tso_bursts = tx_queue->tso_bursts; tx_queue->old_tso_packets = tx_queue->tso_packets;