From patchwork Thu Sep 5 15:41:30 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: 13792649 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2051.outbound.protection.outlook.com [40.107.243.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 9865119D8AF for ; Thu, 5 Sep 2024 15:42:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550956; cv=fail; b=uoBRwux2OL6sD3nzcsgNwukYLpLnvRSZ0Ab+BGATsWvMiQ9gbEce8rv8UNegueqt/FETb7vKpK8cOepeMN/OA9tGXXOF8lHm8aIrOwkoONiuEyjqRDV3cnjD+hq6pamrvGO7EpSrKJhuWuRDFdFFuHqWkW8CdAXKZxTs2qUa374= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550956; c=relaxed/simple; bh=X2BfUyal9bJX88ry6rtprIFduubuwovJQD6j/b+Sh6g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ac7mhvKk91wuEFtRv0q7fi5KduYDs7rorkJIQT6qKQqqGRhCDjU+LI9tCul/0o3md8FMDzQ/cam0y4EqPog387M84Ww1EldvAs+PausM5xbWREXn5KJFW2k8MwZ+yYUWPUshZWNtn2lOquMkOkvx6D/RhX9RJ1gLNGAPAHhvI3E= 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=yRMcbqdE; arc=fail smtp.client-ip=40.107.243.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="yRMcbqdE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CoFVCV8Dkwa8aeFHuka4m04OfGYx1lfKN/YlXCTYKeAskQysUeXFleVcNglEkIDOOK0OIVV8CzgDNW2tcPDqIl/yZlbtl/nZAVp0mG8bqQuUy6ibWyMpyB4ef06w2kxvGPjGYHD/MuosgDMYjE+GVHkK6LMyJQ8CxRlX+iiNETIkNG4XlR6gXptr8bJcBx7ss50TfxoWptn4LwTh1iz5o0A09NNZdg2C+xkwMRO7Q9dPE2PchwXPrP/iipaYxp1ZvjzczoPOS9yE+WAtOrxcXyzSpsfow7FC2F7oBtU+4t6glyopGWEjDS50eKsn733m4VY/Okxy5MrwGfu6lMAJvw== 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=/f6RCqIx5Jt7heTaIeRe0YJcQByO90wG6XihwTtiEc0=; b=STwHpkeU+of76lB8rziulkIGT0MTppmv1nx9iW7M7heUVs8DQM0DT+HdaTy3ASYFVe3RUkLE6FfCU2xiInwfT/in+U/PTvtCgyXZcECLtuEEWy/cBaxwNNc+HU+GAEBb2wNgTxpn9spfyGm1zRM4mM50U34wI13WBTbFUZHT/j/OB0lloBfDHDn7EoBa6E+H3Ncr4i5OnCkQv/ZaxL4scS/TUIWUlloNbUkxGYUhzlTpq0zWEK5spkdqc1lph0XVC95tBEQWXsXIFjoIRDx7oi2nkke1yhDwnKwVqCwT6IB57iKSioF/VHQy/GK8AH2l2Gzca64Q3oBeGTfLd0l9OA== 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=/f6RCqIx5Jt7heTaIeRe0YJcQByO90wG6XihwTtiEc0=; b=yRMcbqdEozNwUsaUM65qDVwpOFgiBG+SIc43cdPkIr37aZj3yja3SwyQQZNfwXz98elC0++y2BLxrkv61/7sSrTAcMT+pt+K2ZcE1sOczEc0jOBSiovcoeaRBApDNnYxdxXw1xGwuhbeFceAvh+PUDPJH3k+pdd5dDf273CGfVg= Received: from BYAPR07CA0088.namprd07.prod.outlook.com (2603:10b6:a03:12b::29) by IA1PR12MB7590.namprd12.prod.outlook.com (2603:10b6:208:42a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 15:42:30 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:12b:cafe::b9) by BYAPR07CA0088.outlook.office365.com (2603:10b6:a03:12b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.16 via Frontend Transport; Thu, 5 Sep 2024 15:42:30 +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 SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:29 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 5 Sep 2024 10:42:23 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) 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 via Frontend Transport; Thu, 5 Sep 2024 10:42:22 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v2 net-next 1/6] sfc: remove obsolete counters from struct efx_channel Date: Thu, 5 Sep 2024 16:41:30 +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: SJ1PEPF00001CDF:EE_|IA1PR12MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: b91ff6e9-953a-42aa-3191-08dccdc159e2 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: DWMmh9wv4pVpqv+/LnwGd0RNiLhWnpwNdy8XhgwJTKXwVxZSgQ/0XEtCKY2Mb1THGNGaVJ6L1K4DSJVxBtJA4RPMaR5ua4a44AQsnwmx9TzCkxXsHdENL8JScwHz6VCeM9AMWipTo1upP26MLIJMJRu17UoJaYTqzdCFXHrJJka7mcN5P+2nqE/r6tULhlnWywurBYFKSbiu+YB/+Q9PXp8PKKkbM8/wIWgi2y5QPSefuDiBTK7tdv8RNSyVIaHxdJTXX/ggqhhhTCnGvqC+zznWlkpjhQBZNKScXTfqRmW1Gms0FZvrXk9urwaRToEs+NWjHoJ/PEmQouk4Ge8M3yYaLnOjnB7CKfwfXPDNRBtKVk6RmifE1PoZzXR0mT2q9XTUQ4R8QkW4b8MfADXw4aHFlV2UNw5+yvUFBBo6A5b4BTWqcsU63/zk7GAV1tZq9/w6E2p3cluRQVagWvt2n8cwQIJtse86dmmvUklKTj0jMKDOqwtrXGIM3mpbTxyE8roZjP8y46RNRByMU6IjQbOk+mOCaeqGhYxhw4zCfvfw8fQps7qOZ2n87FydgGOA+BSgshUe3zDCTnUfCucC29eMzvhwvc/NynmOCuYAcR02IWyJGYyUrsBP9ycyLWpYle98iWJRSl3tnhH+x0a7IN1VpzAWG8T/7FuINGOSZeTrq650Ne0gGqeIy4z8B+FsY7ViP5XS2HPwR+VngjVsctQjdw+UZlMPnI6i/Sv0USNO+ANlCt1zaHaLrXjtNsVYeH2NcPLMwg6HLrJpCWz1ebzuN0WwjrLd+aDgGclolbIEypn8vs7Gu3ipCU0JvI7LIamq1IKPZ+w79UyxDvmrefQX8Ke18ZsB/G//f49CZBaDxMfJkJ0642g4OshXmzHrBZT9kyCaRlJNoaogp+MS31H/XypyeQvnZYV0vMRF+DwH4NDHRgkmRPtmEjrwvzxP1Dud6uCYrpQOAG7i9nEypAZmKvZ300EdouY9b47wWhH/m6Fazx8LVSKqONxczApBrDmiQxHqEZlf0xHGK12ZCKq0PyktGX8+VzxzfAoa/KvNyPtDtUqjrlb+8+suzb1b84qBbjBhO6c3Hx/ByuBccMbIvqruDrIPW8VAhowZ+hivlamw/vRsLEprgz472FfDxvLzcf1anKPHRqy+axRM4FjRaBxVWsl1sMjzy5w3sff2CuKR/5qPMm1CFM1tvJx+68bpiAB8ft0RFNmNuDja+lJ5SjPVxelgL7Ve4AgDt2NKJAG6qoNMRbu/h92lkz6ONB5DyvjI2J15W2CrnOkCx7GAaCTjI5SLv8SUEuuDtxX425eSpdzWxw+ieVcOfFYcZR0Uw3oU2GBJsHexP0bDZy6bSz553J1uPUde8g1BVs98S3LQjBLVtXd/ogknZ/S2DFXwaFr8/2jp8XY8UvOI+DTXiuWppRAOEf9soNqVSsVo0t56mifJyvqJ6HmRfHts 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: 05 Sep 2024 15:42:29.8739 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b91ff6e9-953a-42aa-3191-08dccdc159e2 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: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7590 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. Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- 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 Thu Sep 5 15:41:31 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: 13792648 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060.outbound.protection.outlook.com [40.107.244.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 65AAC19DF7D for ; Thu, 5 Sep 2024 15:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550955; cv=fail; b=sPOTWxZQYxjY55gqVvcSEyAQY76W2k1ky956CpGOiC1iHa9fuENgHBUZcZXfFtxZTMMQat6e21/zjJVcyuHGv4RAFH2YAk+fAzPy8StlGdjnyoPGU5eee6aM7wGH3tlP+KtKTrgU808x11yzaFLwU20HGKzXqT6bHDcus7D32v8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550955; c=relaxed/simple; bh=8VOEc/NGYwPSiFlsth1x0apcZW2NrMfMRB9J4X5wMvY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RBpSgghXvHhv1+7dkGUW/9ZoIXyLfQpPbdV2MHd88jNo86DJ7lPy+EvW9pe2PeKxhvpQ7WcLpaJOFqzOG7n5MQNJfHPdChj3bSgtZIuu7cb5l292qVrOAnw1cjGNL7aUE28ibGJjKHryeYQbNZju6HaozcKi7vMIAu4GzCOoYdI= 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=HQYCmPj5; arc=fail smtp.client-ip=40.107.244.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="HQYCmPj5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HhqycskQeK3auGCGC7wW+yh6VaXQG8+BVilxxZ5P4tGhPPIzUl2e7ofEQ0DDHsL3cMuw642c+Iabg2iROE4Lj2Zef5VKeKuPbKBHAs9UarICCmS7SVyyzZ3fLGqLMB6M7lmZPwL5FyRGI0beCd8aG7cqISoYGUSHGdIbJzf3pC34CBGt01vlWwHPZK1linCF09h9CYihbRPuYelM4lam5z0muFSNIfcI5sJFBZP5hB00+U2prUtxVnAVwo5j/1kfTgpc66px9XOR7Fs3/i5Wqc9j4K4kDOSKljXF3HQUQVWTwmN5xtt9+h3IyAC4sJ9/uBH/vS+GLoEcct0GZPhR/A== 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=5eO0/Lp3OKzkRZU6aHIQBb4nKw9snp7RTwkk0wPs4AU=; b=HLFbT3n3cKEC46ZEifQEMW6JtYNk1QZiFnZq7aUHm34KWcyyvFQZylorQqQ728D2GexngXzIc0HXPibSOci4B5x4LzPAH8Ha4HdNSKBuFsdc4PGol7jP0HWcElae1ySuUFAlfTemR9gITcHEREaL4S3I+DYzjFMdQewCjt7G7vqTcBsV3k29WCS88yQS/4zznciUZgqRWRR/a/ch8o+qioJpAsSY7KhoyKlVWD6M8OfW2dGI5IIuyWvfTrXjrHaTvkflK0ehFwJy2xjZyQTc159xP0lVdntqEaiKiKF/QmOCbbkiew8E9uqmn2kO9Hu5hWF070OhqYHCP/z70GBiTg== 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=5eO0/Lp3OKzkRZU6aHIQBb4nKw9snp7RTwkk0wPs4AU=; b=HQYCmPj5uwTG+uIVLcVqVDzdTq0tDHQ947DScrykpTQDU1KOkyQdauIp+K654Db2/EtYw7iBAM7AjSWldMBvMs12P/lL3f93Rirx6EP3bXgTAZw7fdlZ9NRJPrx1PJCaYDDqeZv5b08F5GbBO9Rw+GmYecRJO4SrR032d5plBtg= Received: from BYAPR07CA0103.namprd07.prod.outlook.com (2603:10b6:a03:12b::44) by SJ0PR12MB6992.namprd12.prod.outlook.com (2603:10b6:a03:483::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Thu, 5 Sep 2024 15:42:30 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:12b:cafe::77) by BYAPR07CA0103.outlook.office365.com (2603:10b6:a03:12b::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25 via Frontend Transport; Thu, 5 Sep 2024 15:42:30 +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 SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:30 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 5 Sep 2024 10:42:25 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) 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 via Frontend Transport; Thu, 5 Sep 2024 10:42:24 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v2 net-next 2/6] sfc: implement basic per-queue stats Date: Thu, 5 Sep 2024 16:41:31 +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: SJ1PEPF00001CDF:EE_|SJ0PR12MB6992:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c80ada6-dac1-4e4a-8e23-08dccdc15a60 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: ayeRCtXDJ04aZMYZQ0wWiIGkaqa6zyEgMKJXRfgb6jTJsnjhp1nlgfn7qdbSgVsnAuekttIFQRaQPaIS18utxZwMlwxjw8WuSbRI6ngxsYyKeJ/BLNn2ZDjqJDhe5b0TRrXA6Dc/FBaFa6iuK04BtxDYDPid6tYbDxvbsStaKxPrK2Fuv5dzCz830hFyX4g1/Om7+6UHiWECjLUDq336ZrVgulG6O2XNeXkZwksUPfX5NwtUjKc/G+cUu8K2s1EXDEKeTi3h/RtGCr4UP+IOGso6g72QnLOQlAVXN6wh1XoVs4gkq6oD3c6lgpujrVvwHHgHZze+qXt//ICW0woLXCh0YkxrU+VNdt84tVQjX9u/3YxNEuIc0PWbHIMT6HFpJ0QaGx4FaFXEDgF3B3f6xMsoYNzme0yQXZLGRczAheM2QShxnVs346SILma3RRZsL8oP8870MHw5EBo/9wwbCFCDIS4xh2juwMrCEY8n9/6rWB+oS1n/9hRdOVayMIYXre9AdUtpb+IQpg5vasx9rh6LsIzxQefxAGjtGeo2q84GglZmF+iaTTc/k46ovCJnaqpxf23gimMSnSYxDNNp3v/NxzQCHpx0++HWQlhVF9VZeWKqaFTKJ9yJiGgFrJQwhT+3RWfbPbtgrUEotVT4YzqZAYf49CA+zwR+jvxoNXMwfowqirhHVQKfMrmu1QQbRSkXHycCVSqASOQSYXOrQnHSqdNQJzfa5vR67HgO7lHOiUm3fcAoisdnmDhZkr9vm/5hSTyVnaUwmaaQcaIXOz2dldtUa6tXkGOnKI2vjeTCsOCZ+CBn4XOC/z2rNr9m0xWBflSeenRQb7cRnddbK45r16GujTTDvS5UE5Q66PLw6KGgakWU42KhrvoTeot91MA0XVCNo4UvqstadSO61oxgs0ES03lPNCGph/IKTOgXz+l8y9t7n5jNgLYp9bAUUAb5pluQSL1Zuhm5AYk0Vs3ap7b8zS2ocBZ6XD/ETwNj2jNPCaO91Ipx3JIFJwFIKsGNbcNDVCbHe2jl0Dr87bkqQzPL0jI0+J8WIpa5Edf40WN+jc16EMoN1SI0oX5A+aPJ66byxRNUlRKiCeXr/r0v1z32qZocn/VQ6h2JDOjFV7jp/jBHX3AZmk55iuABeNs1SXi3bRrybvWvv3NgjPzk1aTST8Y6YIO/ogYJKMtKJrwReo2pcqhPJY+705lbG3GjWMDOKWjAT+sieOseOHj5afqsh6idyzZVinKoqUAd31Edpa4S2m93D+Vyx8tGGj05EL/1poUkB/z5RQxZrpXh0GSN+chCF5MtfSE7o+M3VEbE9osuyu6WngVXgMdPHkQgpueUd7J/31wgJLEMa/62H8QGsTBk6nMXYGGHrDhLvMWGU2KvjnE4EwSJNi6CT2A5/1mHZqyvOsUzCYoxt+K1DSWgkxOcYv/tBORq3zLciZN3jRrdymrAlkG+84kB 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)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 15:42:30.7021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c80ada6-dac1-4e4a-8e23-08dccdc15a60 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: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6992 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 | 74 +++++++++++++++++++++++++ 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, 88 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..9b0313cecc1d 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,78 @@ 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 + * in base stats; however, in EFX_XDP_TX_QUEUES_BORROWED mode we use + * the same TXQ as the core, and thus XDP TXes get included in these + * per-queue stats. + */ + efx_for_each_channel_tx_queue(tx_queue, channel) + if (!tx_queue->xdp_tx) + 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_queue->xdp_tx) + 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 +789,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 Thu Sep 5 15:41:32 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: 13792651 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2082.outbound.protection.outlook.com [40.107.243.82]) (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 CB9FF19E96D for ; Thu, 5 Sep 2024 15:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550958; cv=fail; b=VdNZtdqvHeeNGylohTV7fwYKPp4aceWGgr7u4lR7SMHaTcshWM6jLiDOlABrpse+oP1Hk3JXmXBG7WAy87EHx5zNtYxXYvl1im12YN0BZ6hvg2iKSVOAqDno+Z26Pcu2Ony6TKiQSZ/LYQCaToiOuEDkcjaXiPP7n2vO775UDWE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550958; c=relaxed/simple; bh=Sv2mycHhzFpVHsrctE7MCekDFFjNnnCL3dK4OGEkgkQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ixIwhwlAyP5q34m/5gCLGdMuzDf7CfWY9Iq7sTtW5e4qAuZAh1Kd0jM8OEA6ddRDHZ5P1A2DPWM6t0D+O3pUBH3Mq7CslXaZeZIi9TQq8ghSGkKuW0WQq43xgldIba6E4sbmXTzv/26bJs79+ZUgp/qf5OAM20BHgax45OJZhsY= 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=jw8ENd43; arc=fail smtp.client-ip=40.107.243.82 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="jw8ENd43" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QJD3kjZ3sHxf1d/IDYT67qSjrDWyql6XT+4q8ZNCXtEfqD8HGIbntdZ78Yz9DVZYZHqAy3Cor8NPBinDlvoxIEZ1Dk2LIYwKpD84FcLkrRKOFSxtqayyretGjjdbjsO97AbELB4ljQDjWeYhSTcOEj6EJffTDctFWGsxOf1c1ZPRh02cRBfm4Kq3rVeONFPFAHeGnk1Ile4bISWxwUEvn3MWm/YPGNO+lBUr5A8HAPpH5bbHv/qlJT3si2zT+93SbedDiFUzH11j+QKER0ei7ERqKu8ua5gEp0/PW1xV2YIvTtxoezNr71R5/zi4+N8PQ15LWy/Nzqopi2Iaius1CA== 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=9zISJWpQ2SpzB5m7k/RMqxVfAEusBDzbIBbzcmBv56k=; b=nh8BOpbanVKImvwjZqqGxAStICpplVB5k9/A1MBNtLDXebSl23KqRPe2h5Mf/EHcVW5rPweH4fBpZqKYN6vmuql0nhjLwfGUsNJs/BxZ9qJ27AOnhQhb6Umfb4JO7Xyi5f8CB2HT40IoIfVPsGYInza5kiLOAcpqrdBfBfnzcBeU6lYe78bM3/FEV9QOT7rm5p8NBloFB7soWNltb16dsYn/UKAVIkcHstZzJdcGjLoQwd48BxM4eGffJShssXohQEzrcZqXN65TXIsz7tIWlCLajFmtHjJTjRVO70kzls2DCEhKpXBKwnItwSfwAh4fdbgLlnT/90YjEY4F391DQQ== 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=9zISJWpQ2SpzB5m7k/RMqxVfAEusBDzbIBbzcmBv56k=; b=jw8ENd43kCp1i+AIw9Ln83dMe6hao67JcibZx5NzBLICQkqDLBsqlmeuhgmppmKuudB3DMmFTKgo7uwpyMaXHefePIFLSe84pykO0yP22oWbGWvzOeCg8nzPwv2ld62ruzv9qVru87NUlifb8GdX262fKvqQ/8EIuEN/PhPiQXE= Received: from PH7P220CA0044.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::22) by MW4PR12MB5667.namprd12.prod.outlook.com (2603:10b6:303:18a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 15:42:32 +0000 Received: from CY4PEPF0000FCC3.namprd03.prod.outlook.com (2603:10b6:510:32b:cafe::d6) by PH7P220CA0044.outlook.office365.com (2603:10b6:510:32b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:02 +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 CY4PEPF0000FCC3.mail.protection.outlook.com (10.167.242.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:27 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 5 Sep 2024 10:42:26 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 5 Sep 2024 10:42:26 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) 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 via Frontend Transport; Thu, 5 Sep 2024 10:42:25 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v2 net-next 3/6] sfc: add n_rx_overlength to ethtool stats Date: Thu, 5 Sep 2024 16:41:32 +0100 Message-ID: <45db8b32bfb5e92a63d32a6482c1234d42481a5d.1725550155.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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC3:EE_|MW4PR12MB5667:EE_ X-MS-Office365-Filtering-Correlation-Id: bf54099e-729e-4cae-e6c0-08dccdc158a8 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: xwnHzxu9+EWbN0P91CGPucWtTfolvYDAOnEFlqCDmZDPY3Ew101/ZUVoNNO+t3M4L1dICQiPlPe2Y5ablLuzNPkz+6R4cBiLQIB2b49GB8Luhw1GHX9HRk92G680hFbQGw4wh1EfkX0YiSC9aVwH7GdmaJDsHL1ffWINWSqf8WQSPHm/ZwXZzGWFfLUnkxG5uehdOgQOuml3a0IvYGk5HHheAxZcXtBt5wJIbej2EO+w9sofW9SDeSpHYDrsA+w7OyClUsxkfXYdUhsysMVeDn6lhxD1dhFaxewAbF8jgDRALiNTjWGW2QMMOYzLfC0wEEv2zP03yOG4yxXruqAJ90Fi89Ib9pK9KNStneVPyC+cd34oZJ4cs0jfmMDlkAMe/0cWmL5AEKwVEvJr41MFDlA+u1FlORMI0AApkc3hQ32IZnCEhjHMFE3sx9USYhuK2OnxYz3SfUc3bUwUcTquQfmGs/uGtCrbemPUkfqibm4C0c98RdxADI83eVg7PnbGlX5bQcJAvI4VxxwpJPhfKDllsV1fmrldxWaqtHR5A4BbGc+p2zHlvPM+nut6RP0VltR6O2EhHvPbXSf0/f5vycIaRC4SXx/DCz3cz5Y/I2lsWmBlaD6diySYBIsHWIRyQDyHwbGUaZDFRqjZeh8hC9yBCw8crO1pZqFdu+E52ja/lGcxbTOATQ9Gl9LhKYU8JsUwlnzzWcRgUJHu08lLNINHwaQHM0VQpeRP8M5/LkVNZOz+Tu9QbLYTx9wQM2u+jmib6KBb7yg2HgVfueB+3ffLFVGuT3jfQ64W75AbHclKxfR2SBwm3gVhS70/Sd4F1id+csGQ+Tb/SND3PoiV7f2i2skqU/bAO5xRWab+sNzX69p+amXUA4XA3XDxvDgjUj82hg7JpbMNYuVMNjHIF0WuKXO351+A7L+YUyjs8nkQZ1q5K8w3n58auRngwMxwaTSphAzvub0i/uLDuufNytw28RHSS0Jxx9828LzEzfEnwlYhdGSYrTgipeRM4BUk1DWHvkt0A8eeSehzUqZ/nkF4YgFhaPi6APmZywKJB32isZz5aPwsPIXB8rn39+MhEYtB97MqXeY23PtpUB/tVdhnzwOICwCnRn212GTWnqkbsBiEn1YjhJFMCIIjy33d/PVopY/usjzG8Wgrq93K7DAJuaGNqGkz9TZMwrV5yOd87jRWaxExUI9kmCDvpNYE94fRAq5xztHI38snnhZexr++Fizm6ulLYWwpXJKSpHYfxwGuyQ51mZ+pJfhc93h/GZf3RDa8FaNtx/ImHKUXSwb2XSmjmOkd5ueyrPbeuQqzq0yXK4peX6TEgubkcgkNRSYPVNgsaHsU3mSeEwfnkbLc9sMhzmGPXa1eWWORrUw4VniWYxrAQcodf/F1YjxoASxbrw+P0Smv68cYBqrUygTTeeKvQkx31Aj/ZQ7Ia0Iv+cfNxnw5FuIIvdwvUKUd X-Forefront-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)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 15:42:27.7895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf54099e-729e-4cae-e6c0-08dccdc158a8 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: CY4PEPF0000FCC3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5667 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree The previous patch changed when we increment the RX queue's rx_packets counter, to match the semantics of netdev per-queue stats. The differences between the old and new counts are scatter errors (which produce a WARN_ON) and this counter, which is incremented by efx_rx_packet__check_len() when an RX packet (which was placed in a single buffer by SG, i.e. n_frags == 1) has a length (from the RX event) which is too long to fit in the RX buffer. If this occurs, we drop the packet and fire a ratelimited netif_err(). The counter previously was not reported anywhere; add it to ethtool -S output to ensure users still have this information. Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- 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 Thu Sep 5 15:41:33 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: 13792650 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2041.outbound.protection.outlook.com [40.107.244.41]) (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 8D1B019E7D0 for ; Thu, 5 Sep 2024 15:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550957; cv=fail; b=JSIHDAH5pxZOyMnSmmCm+7lt/C+1j4vxa2RqruSSAKovmzN/C/LPG+r1mlXA5Xl2V9uBAmdHUAks4r3EwIAJ62YUkvhzoKCxsNOF8HMmVB65lq2X4p0v5D34RZXOuonr1uBI4zQbdaGaFJ67ZabrndeYwG4J8KrFTw80DZBYER0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550957; c=relaxed/simple; bh=SUTWoPjmsI3HqwTAMKZdg+Y9pj/sr6dVYbcFfSCO3mE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kbSpOcHg9M11JFOi8iAvr2Pmu13UoJNv1A2okfl82uanPQMiQHNuhTJF1f2khghITfaFKzDsa/7L7gDsfgT0zq8Bid+Sc5zdiwEhwpdvBABW/s8nIyDtJLJmJlg9XEvOHM2rzmn+/NBPlYDyfzgMhtB4RSnK92a/KHBlTAD1QSs= 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=2h1rqSIJ; arc=fail smtp.client-ip=40.107.244.41 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="2h1rqSIJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZY0X30XmYcctKOxiyLwXak2paYCFK0JSAra6qURW6QeOmQGysq25HITvQIrPoGN89z15v9OPuueInqVsFW4YT8m8PPMui8lfyblACRhh6FAuL4D6v/mtUEeuQvW6+XLbQMkcMOa9UnuBjlxb0KKXK5056BQeUg6hpixdjoHK5uM3S5Z8HZmXb+y83uqUK99oiiypUS/9tFT28oEfCgyae+A7AnUGUMUIiLUaGULatY/itxhIWB4QxfJzPz4lcQulvo3zu+blcJle6XvfW0f3T5rNfG9CvE47mFKFD9bnuIpawe9H0Cfid39vBt0FYAwfXj0WjDedGBTPvsPvd3SAOg== 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=bkC5F2Gz4aIksx/jXmKqyiI5nHUsyxiOoeB9l+1bh7o=; b=QmJFE/X/woHON0JP9VjYvUDZRrliQZT6r24sTux+AtlrskgUSJEaiYqNn+B7TqD128NnGAbYVeWIsH/oTj1GxZa3IyWM/Grj3tDeLtYC2zXEvGSHjaiEIZZQl2nBjyxIl5KTXOyfBoPLWIQwNe2JBHARbmlkemqJP4XICPUx1AqDj9NUPH++xw5WA042oD8wG38xtDDH4Dlaf/bisbX582++a8Ps/VMhfleP129ujqkutz7wggi9lz8ieokEmIU7tUUmCrk4LvpNaMiSx3ocL1EPf1STt2cLrq2nq5A8rRPOhvcr0DktjsFABu8OagIx7X3rPYkVKq/TOr50IL5oPg== 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=bkC5F2Gz4aIksx/jXmKqyiI5nHUsyxiOoeB9l+1bh7o=; b=2h1rqSIJNIZsLqJyLhyr+XtmqOM9Mw3HqoYkULGQPpSgGsMYQsff6mX8JM8IcaoOflyf82CsgWPnIPZCfGf7NWkuED3p2bu7n/8639kzBAwVee1PW6YmR6paS7dX9vZxjQHipo5Sp6+dM9BWD5wFVCDxKS4e/QqYw4JzHeto98I= Received: from DS7PR03CA0071.namprd03.prod.outlook.com (2603:10b6:5:3bb::16) by IA0PR12MB8695.namprd12.prod.outlook.com (2603:10b6:208:485::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 15:42:31 +0000 Received: from DS1PEPF0001709C.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::1) by DS7PR03CA0071.outlook.office365.com (2603:10b6:5:3bb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 15:42:31 +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 DS1PEPF0001709C.mail.protection.outlook.com (10.167.18.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:30 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 5 Sep 2024 10:42:28 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) 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 via Frontend Transport; Thu, 5 Sep 2024 10:42:27 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v2 net-next 4/6] sfc: implement per-queue rx drop and overrun stats Date: Thu, 5 Sep 2024 16:41:33 +0100 Message-ID: <1224bf8e779980f37ca703be91610411ed340123.1725550155.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: DS1PEPF0001709C:EE_|IA0PR12MB8695:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c64b179-979a-402d-6c61-08dccdc15a7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: 7/nJTolX1TPA2u4ACTxxbCJwS8qPwKlZjWleGsVmcjNcm+bsmCyzgZXP5Y+C7vVxA6jJ4kt2m7GnNUOSQBb/1K3rxMRbLVcmx4lUwqrrX4N0tkAhOpfPDp5Rl/lCJutEs/MHMDUwfGldo/E+mL8PbLEZsI0TJXWzt3FqjcdZDwPDkGeE/G6349wuus6jCfedmMMZWdXo3hDD+igX6+fY9wiwMJPhJN/doBvJ4QKv5KNVBTsCzI/DIJchYtz/RcBLHIFuVfUcQVY54qDfhAzVFaTAWSlhKG7Rfzinp73IDxeEiOE45IpGPaqZ4x7uZGtsgnv2IKZT70hYU2fSPXHQEFCzVUCDOjQi8ol8yIoGoF2u7hm8jtLS6G3HcAw6WEMjV31uqeOqj3k+3qdJufArkM1HCKZgegB9JMmS+9p9kJomep69dcaAm7dhsupulx5OEvD43n1E3Quj65WKZvXBgVeEcxDl13qTCIstaTNOtApu5A3ZP4sGDVYtw+LITXI/K8QlJOl98Y56jM2KMu5Ri576o/U6he2SPkosITv+NLagf+BAImtoI/lApObreTdIuvV/kDZdg47Nz78SWLHHxXT+lCSo03ue+T6bl6c1wrB6B0JNeg4C5OEDwRLJ5pLnws2vcVDrmnRrG4mZm9t9N4k7fJu5Z/+GqxVCucvoMLN1w4h9p8HSvNtf3L0Pwyp9MuPn1cDBQVQp/KlMxWcWRHHdAJ9nnFw9jn4aSCaO1ud45VqgwzNce0jZYF6ptDP4yrevGLDr7CMQ34ipiz/YkUUOaaZTtFWUZU9kffYvPFu1XeDxcm0p3N9dXWEqoesoIKVfsUMhVd9Qp2jPFx7FSKrDC8qdu3ZbzqjLqONdJ+OGYIje8Nkk8g5uLDo8Hscu8fc6J/YEfJYH6VhM7dOj71Pi5AK9tmiA7l+RrPAPXJs9c/ipHRzwv9oi1neG26ewfPcLF0MH7bmJkK5pBTOFbcH3iE0Csja6k6xCPLHT91Qc4bwOxf2PgUj+bSu3jAuzt9kZGXTHgrzBvCxacUQN4z9aKrL0cU5whd6FBn3NOFA5Sq9avMScWlTOIo3rHzlXWY8PH/8vG5hF13smKd/DLjMiiqx9/cE/2x7jV5QgCLnB9NMKXxx40gul/9YdMq44Ie0BmqFvxkTGVr1SF92aB+qCGHqa/0QD1tzn5sV0A4n9w0PVNaKPjzZ6ILTs/cLIlqCxPK244CyIbtU55ffBzw1/AS6ZSR0oHptPWEXUZgeoipRZfwhzD5zLc6GJy/QLDNIAiBlrJcPM7W1ykZVBmuEQfnd+wEsQnzjAgsAWNsEKVuDmx/k+Igj7vgy0u7P7vD5WIzTeSrkxw3erzj7eWr8MUAMhYyx3r3iZKSyH58CQFJXwCFSPFojDS7MKa8fln+kBrZIcqu1yXKiI20osbOO7bmE7i8szx2hOPhWC16B5wFGER2Ma/pkghVw/fZbu 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)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 15:42:30.9094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c64b179-979a-402d-6c61-08dccdc15a7b 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: DS1PEPF0001709C.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8695 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- 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 9b0313cecc1d..a442867ebdaa 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, @@ -670,6 +674,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 @@ -677,10 +683,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 Thu Sep 5 15:41:34 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: 13792652 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2087.outbound.protection.outlook.com [40.107.92.87]) (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 CDDB419F408 for ; Thu, 5 Sep 2024 15:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550959; cv=fail; b=KYE4S+N3VapYd4YorBOlqO8ViEDFHhLQbgrB7cdFRzqIEA6C7kaPnF4AAbbN1G3hDwxhZSHXJX58HTmvqc44f6npKFMm/08wSZJ6eXtyJ13M+XRy8sKniPumPCWKZ3/kxbP7zQ+eFI7AtGq/HCqNAZVRkuZESIeTPgduPcoAMJc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550959; c=relaxed/simple; bh=iynTbeW0Snx4ZKoce87n9X6nqJEjdlrOOXGpD1msBXc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rGdZfUt4ufdIfvb74iuXSjl85e/2FlYUj7C+7gSzSDZ+KgkusfgMqxNxkjw3JGa5eAghdOJ8toTxpkdYNd3RvMzp2QX2feg8nJV3AWS1boUmnwyi/SyKPBR5JSM7OsL3UaxFSsLYWg+pc6NWSf1TDoKar+5H6qRFMPp+tXrUb/Y= 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=RzVA3Bfc; arc=fail smtp.client-ip=40.107.92.87 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="RzVA3Bfc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=STc+qMxq95NvgoCUK1/f6hRrK/Rj7m4KPT+oCm5ZbkLuq0nA9K7M6L4OQHPkyIp44tcHWZLNvtvt1F1koX+XVggE0tQA/jQWsUP0zATPpKGQJqe4HYFcHnxbmCHq55uF7FpcgsWP214YN0fyxzSYCpbujhPTV0kc6Ltxg52J7Ju9hDEY8AREM6zywLAIhBgjtuxNBYyd7iAo9S8FmpB+3OnR+2kCUSwj3tdRu8PIjFmfEusY5gDRnz0JCdC3YxZQvNxM0cyiOEQw/FOPG4TnwphYqDbY+be9+ZmFFSP7t4LtWxXbFtKnggDZj5pBtwAoKbjlMGtIxKD9hCheoSKJxA== 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=Oxkq5GMSa2q5FcOHKx3GyIKBAwX4n39W8u3O8D18//s=; b=PLJLsQMaGtBzSShgbCa8Hixj1IV3ds6uyMAxI1kv11x5KqbAUW7chWgiQLtXvJWaVIcZNxhKg/xpQlTDaAp8quZ8b4JGms3Pda7PazsfqQQas+4gcmtZv5xV5hG7M55T7bc9AfwXHQLUxmD8sqjl+woD18icb5xTrfb5F+ICXw0ueNzsN8P+abRzE6n8KsJsChY2ekRQg8cio+pUOINee9WfGh5/aiTDT7rkOaa42vs/+BGR3gJVFaggnj9UGMXUAaVxEJFA2D3Eg9oHNZyXULpleBtrv3Shk5WuhPbokofti30j1YYtzBODdji81PB803OBqM4WVUzR1gAfjOHqDg== 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=Oxkq5GMSa2q5FcOHKx3GyIKBAwX4n39W8u3O8D18//s=; b=RzVA3Bfcpr+gZBQ6EEO8mrsURiS/6tHbYfF3fzI8dykJY1aakY+OkCKrsNDrgNq8U9BtcDVGqdPcaqLUfJfFQ/ZG07Jbm70ierUMGsDwAtoinX4tUdoXnMeycQ+6TMvxKvNZtbstq5iuZFns4nCqYdq/klO2XvcJkUu1l7ObVgU= Received: from DS7PR03CA0068.namprd03.prod.outlook.com (2603:10b6:5:3bb::13) by PH7PR12MB5877.namprd12.prod.outlook.com (2603:10b6:510:1d5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 15:42:32 +0000 Received: from DS1PEPF0001709C.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::53) by DS7PR03CA0068.outlook.office365.com (2603:10b6:5:3bb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 15:42:32 +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 DS1PEPF0001709C.mail.protection.outlook.com (10.167.18.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:32 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 5 Sep 2024 10:42:29 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) 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 via Frontend Transport; Thu, 5 Sep 2024 10:42:28 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v2 net-next 5/6] sfc: implement per-queue TSO (hw_gso) stats Date: Thu, 5 Sep 2024 16:41:34 +0100 Message-ID: <1cb576697367358868fa611d12bc8a01f0fec974.1725550155.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: DS1PEPF0001709C:EE_|PH7PR12MB5877:EE_ X-MS-Office365-Filtering-Correlation-Id: c0a581b4-58ae-4b41-b35d-08dccdc15b24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: fBnRTx/yib2vDCiF27Z51owDky8k6wnzUErqFZQUx5Nf4mIuDeKAFgFfmWKcUH6gOj8J5f6z2QG0Dt7K8rTXOpljh+222boRMRTjfcYI1wdmscSCiAggm9MB1HMtHzNbYgpFQQUjmIRVoucvBMKsnpUYVvLUkVbfb7pgVQTP2RskDT1D4ExTmD6uDlm65jKc5+QJ+gJKyzD88JMBx7b66BDMqZ2fKIrAheBRJF9kAqSJV8r7D77vr5aAeYsZFSt/lX70uNy/WvH01a3yiUllzl5+sfyi740vVPEnfg4RJ4qGxNtUHB/9ebuv9FP7tXiyQDCAfF16clQUA2iqdgeNY5hfm8iNd9AZyG7SWbyYpTis2a70bk6RhG6gi8kjywK9n90Cf0qv9nIlbtTBBMojWPMwEJoq70T/U0vA2F55UpDn9UnL6VmqCurCzu/KpuobLXcuuFE0Y42EjNusLiKSNdL6G7ifQw+PjDz3W7b9cz9oI8f4QKIOSasGUyyCimQYvqSwpgfSn85MXQ8PRpXbnbPeNqotWjbLAmLbdjZgpxTBtRBldvJTvhTCiTuh3t0ZiaJEtbXhjoeLYmsbDTFU86K/uxrM4oEt+/79YgH0y4bn2xLvRMdLjKcmQu/GhZ1C87wp713BJNjYj1aPpYjEjrhzkgjTOer0xUP14QNQr9B7nbmR5ehA3h4LOrtussVdJKKQToYUOTPCj8OhnoiRXzwQgp18xjE9DLkwxFbPOrdMcHprigMPMlD/uI/DFCER4zAtubSHAc2kvlHgMKmw9u2VF1Ei8O+65pQ82RE3lSgJe7wMS9/7kBrh+RXkRqBmspyU1Jbv9+LGFxwh9OtP6+8Vqs0vHN8JVhXSBfUSnroBwPE0ARegeFOFy86AKQoFaIRcDYvmpAZVJtg4fE9FQrD0NWDx+2raqfCR6GkVIbavd3uud04ZniKh/HPC41UdLWjGL/BYHu6GFzzd3CiF8eomLZqn2Zt1EcpGAs5g58+cH4+7zcywkpciTNjMEzRTE/fGKRnEd9iYTzU36JFGgyrgPn0c1ahfS/dhB1uZvmJbHd9XPE5nMHS3rI0r7WkZ6XDSckJPTIeI9vJSE0lQD5WMe/uCzAwF2yCMvHCyIh9vEfb5vW/EygutftBYnxQjHFXlyp9WbAA3cVtlkKlXAiDrn0YVzzpS67BXL3OzKf5xura/6w/vfQpw4pA+3dcmWxYM5s4hL63qV9A3vhtQHNGlDnikg7ex/Iw1S1IYRyj+8qWpNL5XWlnaPsQaxXFLucXzCQO8dOXRg+ylR28CjsCS+KOBsJJcDEAMrXUw6jKTTSB9nrkkK4P2j6aCsAb/Wqumu9zPjaIF30tHvRrcwP7fv1psVOYvzrwXU7g12Ny9+uyfCkal8J2K8lfP22m/kb5X0z/ZtNKxk5dssHWX21vMkNytNbPbeBCYmPWbnp4= 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)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 15:42:32.0188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c0a581b4-58ae-4b41-b35d-08dccdc15b24 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: DS1PEPF0001709C.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5877 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- 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 a442867ebdaa..4b546f61dfaf 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -653,15 +653,22 @@ 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 * in base stats; however, in EFX_XDP_TX_QUEUES_BORROWED mode we use * the same TXQ as the core, and thus XDP TXes get included in these * per-queue stats. */ efx_for_each_channel_tx_queue(tx_queue, channel) - if (!tx_queue->xdp_tx) + if (!tx_queue->xdp_tx) { 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, @@ -677,6 +684,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. @@ -696,10 +705,15 @@ static void efx_get_base_stats(struct net_device *net_dev, if (channel->channel < efx->tx_channel_offset || channel->channel >= efx->tx_channel_offset + net_dev->real_num_tx_queues || - tx_queue->xdp_tx) + tx_queue->xdp_tx) { 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 Thu Sep 5 15:41:35 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: 13792653 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.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 1F88F19D895 for ; Thu, 5 Sep 2024 15:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550962; cv=fail; b=P55WS0zA9eoIE8ctQ2gjHX3myb4bR2wBFAEPcWHh+ICCYZEXzAqQ6DWXms3PoqlN1+lo0mswIF6bzb2TWPu1jMeSKa4SA3i1n46XKKjbXwZAvbnY/FEAJHvqItxukYLwEFOLu3rEo8OcEXbwbewAmuZrHvAcCHvpM/KBOE12uPw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725550962; c=relaxed/simple; bh=on5fYF16aFJwZ8siTecCrKCVc4xheeKEl6q2x+u8iQo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=db7a9pZ7LJ0Y7z5op22og3r93rVLbMOst+aafZUD7pwrel0CBgkGyJmRf6F8u7+/9gQEdoN0kuXyZjWe52xxf5x57k4tbP7AzXN6SDu/uxYuCdcM1prSNSp0wGMfGOssCtoLMejTc22Fv3S+9Ew4r+tOxGFdxhB58wVGCQclJpA= 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=mGN/93BB; arc=fail smtp.client-ip=40.107.237.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="mGN/93BB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V/Mnhjy9w1AOhgQHhpn45Kn/ooKv96W93HX/B6pfaQHnnq/JhTSImSjNjjzy4YOdtyrBwPcGPV4KTOoH85c9k2Szy91JNjk6EpvaFdoyLWR5oPl2JBfsxlM4Uq2UKAo8Xdvue4nn180wY99RMIYfOW5ZlOCgki0ZavH/jlyFs8Uz33cehIH5jXOsBC4NRf8nsRRHaZyPWBpS47A2MRC8vTdvw/A/mJW7javTU9skvdEP2O0gICynxP3IKFcsoCZnTyXsLosXbwXyn+U2FdP1QDvOz5/65Ky3g+15PAVtHl/yDHwRX70FK+ISWtb2mUdBEthVwXaH5MWPvrw4HCAufg== 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=pT6CByYbaiGSza8Panu2Twm08oVI32j5QqKA1qkzDCM=; b=QPbnCthq0COvVFh8dtKemOyJPvAqOA8Bhubq+FH1lOr6Ud3KSXjAVcYwtRHCvYZ3q1E/Ke1vG3F8ZjvSd07Uj/wazaFKYMKMmw4+GFO+NnuGeLr/Tw6oZbPnEigELS2f4UmaPawUGmDL97DenXB39JnPICM6C0dlXnRnIac9B15RrEKLISkleA+8QHpBLm6GFA7vEulnSiIhtvo1IOrO72CMp/L8vJQMnjFYEPI4ZHvUL0dwKbKHHETOMIOddVb0i2PohxKDcrKgf7dNmYIIZfmNLOY23Ij7VEAKhMnY78Y19Nygs7IWePwLMBQOe+greBnMZLQjFOI3GWqdmGCO8w== 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=pT6CByYbaiGSza8Panu2Twm08oVI32j5QqKA1qkzDCM=; b=mGN/93BBkbfaA8eivuq8LYjYx9np14yAjUbtGjuk25z1m5DOMnPLOMUPhdrFZAHhP7mz+GaMD9ZpJnQuTDyrbpjdILPWTmBs6+7GCFf+/VTuvzL60Y97zzO6Gxb0TZPxllNyJCG3U+5a9uboaYc9JayhLoAQs6FaKAl1FeGOM1I= Received: from BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) by CY5PR12MB6407.namprd12.prod.outlook.com (2603:10b6:930:3c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 15:42:37 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:12b:cafe::4f) by BYAPR07CA0096.outlook.office365.com (2603:10b6:a03:12b::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27 via Frontend Transport; Thu, 5 Sep 2024 15:42:32 +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 SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 5 Sep 2024 15:42:32 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 5 Sep 2024 10:42:30 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) 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 via Frontend Transport; Thu, 5 Sep 2024 10:42:29 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v2 net-next 6/6] sfc: add per-queue RX and TX bytes stats Date: Thu, 5 Sep 2024 16:41:35 +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: SJ1PEPF00001CDF:EE_|CY5PR12MB6407:EE_ X-MS-Office365-Filtering-Correlation-Id: c8e5e01a-d0f8-41af-9874-08dccdc15b2d 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: vig36wj7kHavGepxoc9AyCzQjS/ncuzs7Wf2NMYNpHn/YZwVHt9UJbNloZ8BOL5E+TdbrecAE5YSy/Cwnq1F20215xTpBbQ6U5wkkS/deORSBNEGPg8Q3xcNm7awIkBWCrzbKJSzf6YONVyhc6Gq9B20kIdwnD3nenWdaA5bEItROiIHTLYaJycT6EYtIxe1Lc/exXFA8GUmINENzq1hhYm0B83BQwvM0k3VG1VtiPWpWpLC2itbC8Hq2397eWCWGfFopZdUIvxKUH5D/0nFH2ADvEzcpy780uuCs99Jr5MjRPMpc0GI8/VyDd+6YfQ4ij9mqwrZA7ZhuWDkPzbvDX7kgB9TfInEPbJivNveAavDukUaZl4dc0GVgeHHbYjbDjSTgvE9RlPjQ5hCEzD9ojbSyBpLiSg9CHtTpMXe9Ve4yj+CJhAraDCez1Hgye5obY+JRG23RrRnmgS9Jd+D7VxUWsPIXUDcTYQKlEs8Hr71GksQp5c/kegBrYTPugtGU8rfLByfc1iWIdBpZYT2wfso/y2Sm5I9QeyGJJrCfZczJ52gt4qlMIQNdSDZxf2lStOylm/k/QqX1BD4/tLYUC1e6CEDwyXuG2tk8zTL0K8MoRQW8F3CxbZAizFf1a1kmiTVdlK26moz5tEsuQVjaBu1N/HrmPJNEyl7jUT3KH5s0ZqDpS1M5LeW1HpNEFiPtMNTXT528fR6y4pDZRykRm2KzI0rMj3Px7XdMlmwJh8pS2TaNHtHWIIiG1NGGYqpqAzTpnGPvCBrv2QrlZC7dX4ljRlqU8iDUj1LqAQH4QRAlbErwqNmOE6AzIUx3GS3SxssElDX3++E2PzOi6gsYf5oKKY8AZm81rQ0uQvByJJWO8qOveYmK9lx8Xjp55o7J+695XrQ9wJffIejHUqYh49dzzS5FCjozfsc6L9PQNcAPllWyp8rsAPVbEnOtU3tRyQgIi91RG7pGH01gVdqEYitX6GgNu0X61SDmczznYGKIRnLXqh9xulrAWcM/h568NPvXM42PCPJV1c7tfS9qbzySMMi5TujkoOwkEy4xWvWBBz0K3dtE1KyWyh4tokhQHWi+DWF2//b+0opIwfcl2BkXsVDXN3xWiRHPpXkL9SBooJWFigjwGloA4boGB37fVYRtI29yMj3+CTzcc7xpVmgy9z2szfmCxW4jeynxPkTkY558IyMkAtdXDz2x4BBQpzhrU2bRXpsiphkDERAFpRiGlGWf6MVhlBxdBCorigLj2fyhm9pfManzdnOD6WinZaGJ9qDJcFF2AVO6MFQ64r1ACqXdlHJRkO89iX+rikOZceLF+68PpeDsXZ/am4dOPsDOARwjuWOOC7s7LYU9AR/OOBes487Eph93J07VbTgJNKtvvMmjmJvyZopm7tRcXOu+SSGXMqPz9UtAppUoelTYXNGzjAyhdfoIAUsZPxBHnAytIwWTVLN8m6ywNdh 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)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 15:42:32.0458 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8e5e01a-d0f8-41af-9874-08dccdc15b2d 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: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6407 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. Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef100_rx.c | 1 + drivers/net/ethernet/sfc/ef100_tx.c | 1 + drivers/net/ethernet/sfc/efx.c | 10 ++++++++++ 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, 27 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 4b546f61dfaf..6c709d92e299 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 @@ -664,6 +666,8 @@ static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx, if (!tx_queue->xdp_tx) { 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 - @@ -681,9 +685,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; @@ -694,10 +700,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; } @@ -707,10 +715,12 @@ static void efx_get_base_stats(struct net_device *net_dev, net_dev->real_num_tx_queues || tx_queue->xdp_tx) { 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;