From patchwork Mon Sep 30 13:52:39 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: 13816515 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2051.outbound.protection.outlook.com [40.107.220.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 1D99B191F6C for ; Mon, 30 Sep 2024 13:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704401; cv=fail; b=M8qjwoPE1F69SwtsdZ6iVuaBz/xx1oHI6jGeCLhsaqRaXIlq9gROQNw4e/5ErCDg3PlNGXdT4TdYhVOY75P1f54UWCNzvm8Ftew0wNpOH0yekDYHlnNQZ4D/bvUWhokhslhrTdnL7EPwUY4RoN8SLF/0Xs91zc5f2bJPCObKSUw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704401; c=relaxed/simple; bh=X2BfUyal9bJX88ry6rtprIFduubuwovJQD6j/b+Sh6g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Iy0q/zhtrlLc4vX8CvAmbtWEVJ4XrcJ4ucORGgRR1Gh1hLi7RODsE+JYF4x40D5/EdBllJdnzlF0zqkRMurIo3tVdI6oloW9n/mHPAOqSSjsAdY4/io+PMBsgwQ/IHsEQBs+K5yG3RNmEZPz0PMylsQqnWGfLdw36pLKe/AnQlM= 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=qmIL3HTP; arc=fail smtp.client-ip=40.107.220.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="qmIL3HTP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DyPgsmH0/1+2Q+Yz0LSQqzcexL6VLcU/dNmerPaj7mOmYLd5FImYwd/R2SY4lHm5Wf9LUPBEBmRJLyO0cC/n7lp2YMmFazzDziKlsCIemMdPRljCLkvDG1Hpurns+0u5adkO5xDIFdHKWqZIrk6xBOU6ANWZR7tdvvBWoOibhdJpNmAs6y/MkuRzKu3D8V23NA3PtQ8TtuR/1l1Bq4kaOdy4Gn8W9B1FxG1DOfxenOHgUx7q39GibP1nnvBmFQZHFx0GIsQkqxOlG1eEH8NBCuY/e3Uy18/pxzS6d+wT12eEhnq4gHzrUmFYOaGgTccRO4wLCVwXwSk+t44/3EVSOQ== 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=CMzZokn36ztTZeacfAmYQuxXcs5H8QWKXL2qlTrlSZKZNxRFhivXCY/A6wJf5QizAB8Y7oT2espCL+hfKZtFhZWRPZJUIkokCl+3BcS8tTvgPjbBzgIVQKSxl15Jm4v5f3hDBpDLQrxyTtj2uZPicSnMCZWOl/tCiCogF8PJ/YEUEg7s35qfAOUGBFOokEjhnLZCKINnOWL1HdkxhL1yhFKabDPoQDuBrihGy9I0l27WgQPerhqRNWp48/F/onSKUMSlNbMhqxUkEcKKOlKXG2IZ8cTamK/GRpSWIgQLkK78HKZOZelp/zrfd+l5mMkDLDepP9cn0zJy3bDswZ6w7g== 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=qmIL3HTPHcXJ4DkKfkqkJz8OGhJ+zEj/jcKM2Laa6z5zu0mek/iFhziitpHFpdrKoB0ZQ1cBbzUychXA+71WAxqf8VUMoqHGWWbrKKcVD6fVK2QN5vjIG7IG1Tk2jEmm8dgcaT4XfKnDCatoda4QqFTN2S0WZYj9cQAjwCeXn0k= Received: from CH3P220CA0019.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:1e8::18) by SN7PR12MB7933.namprd12.prod.outlook.com (2603:10b6:806:342::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Mon, 30 Sep 2024 13:53:17 +0000 Received: from CH2PEPF0000014A.namprd02.prod.outlook.com (2603:10b6:610:1e8:cafe::d0) by CH3P220CA0019.outlook.office365.com (2603:10b6:610:1e8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27 via Frontend Transport; Mon, 30 Sep 2024 13:53:17 +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 CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:16 +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; Mon, 30 Sep 2024 08:53:15 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Mon, 30 Sep 2024 08:53:15 -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; Mon, 30 Sep 2024 08:53:14 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 1/7] sfc: remove obsolete counters from struct efx_channel Date: Mon, 30 Sep 2024 14:52:39 +0100 Message-ID: <68e29384cc3b50ebe1922ae495c7d9de7aac7fdc.1727703521.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: CH2PEPF0000014A:EE_|SN7PR12MB7933:EE_ X-MS-Office365-Filtering-Correlation-Id: 525229a1-f4fb-4b45-14c4-08dce1573c3b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: 4C++LoPrOd0dFoL2z4GVHgp1s+eP7rSfObVp5qmr04DxDb7FC218u7Uy9jSDdT5lTFhd7Ojg9gC1InB4bFGlrd9I0IFtcCxJmH1IvP1vD3m2c+0I62iQsSwSGOfMPxr6vLszz8jShp1A7Wi7kK2ZX9K4prQlSShh08Mu5xJnnuiYQs5EY+/WBH5orN3eQBMiJx31qD5DmJWIxJQeV7FvUJVFjD3VS39HmKFdLcBeqXYKQfrHdee26p3lI22OFrnrS4BMxd+bqWvpzWdUQ5TkiNt8YD5XSygFji6iaeI6AbaBlL+bT5tYqasprHzAnwOZXFfkrXiyMN/KCcyBZEa1MKtTu5ZjNZVVXD4tw28vuPwzBjhBg7TT+qQlK7o624OUoX2HBDRWi3GfkqZW3LB0monUZfZ/30aHZFRQEd1CguMsVhYh+FpS+61fyfwPOW6o2pc/9HqX1zC6Hj8UdxKiHjSfDMh0ENvxSgW8jRyjtSMFw7b4O+cvFYuU36CaXmXIJZv2Ly9Qn2dcPybcZqRNkqc3i0hG1tnWF5C55Jgs16oxfiV7ZDohgavcs6mS/jaKVM8QkxLpPwORPmLlagxrUZPPjcfSIxvTeqv0/W20knaDnj9OzkrseZgClrbQfogPPJfvfo+0OFcYbvxmgUjOXUjxgpNVFXmg5nlaIIT1NFHkanrhYUZe/mKlDttaci5VYTVVIj+Cm7feY6aJDy9MVud128rqpC6VaAKUPvNJvgbFISiEJO/fS5LM9n46f0uArL6SUwpvl18P3BD4sQRgK3sKSNlauw+oTBJpHP4T4Ru34+LIa1Krs7RbBCWjfTmLCQGmzm+289owhEwUbSfu5Y9mTm/2axJe+DRLJvG1g1YdpSRVC2i0s4YQCzvOnyOI8ChFjaUvs3gMH8PvmeBYB3gzRcNz7OJFCwqHy/PDmaILZtLHf/oCJTjyWjiV3be9J/EuzliqLO9+6JkgtJsPSAiTpDsWn/IoF5LZs5kVVPmwr2uLzxU6e6QRT36SiThQwK6V7T5EHJnq6rdqFbAAqscrJsTZn8w+uktfTA73UvuWaiT7pdPbRENl6mRKz8SFZMz64NjBhAcB6rKKo1YJdiwWnoQ9jcixEcJaNb/is33QV50Ve9yxqX3UjRVchVgvUTZ7HAKJC0vHNuJaQxPjWSYlz03Ythu+OMJruwMmb6GtySZzBkX6KadYu2YvkBZxc+FGJ+AHBVV9Fk6LyB7Fm0bsJJ/4oOZdef8Iov+zeHAASK3+zsuRXFWgWKEBKRyqzKqZrwXGYetum2zygbW1P1SsWF9BiAdBlZYdOHKKtWTyFCvHr477fpdE74+ul3tsaEUBYXCI/soRCelaTNHvrc9/34nVLxc9U77E87oMx+4= 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)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:16.7739 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 525229a1-f4fb-4b45-14c4-08dce1573c3b 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: CH2PEPF0000014A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7933 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 Mon Sep 30 13:52:40 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: 13816521 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2066.outbound.protection.outlook.com [40.107.220.66]) (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 A044718FDC3 for ; Mon, 30 Sep 2024 13:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704423; cv=fail; b=WS+a7B/W3tRmRh9vQbty8hlVcdaB4DKFfJ+rLhTdYFzMcSMY6K0igDLUlFpyjQlDr9YA4xnpYyibG0MDrtuurA0VCB9RTBZGx/IGkyHEn3Y19Hq34TPlA20m0Mvmpu/yKWQYHFn/+IUdogwfxicp9KkPa7VnJIzlMpF2QWAXcaw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704423; c=relaxed/simple; bh=Gf/1smqKic0fiAp+2C7CYv7gGvmcwUFshob5EwldZPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Xc/1AdEUQce/PlHA49Aem1Aok6iUPFX3igDpr8B0/M6moJ1UOowK4GTe7puQ41RhuHk5z4QwZ9CUVNTeXaIYz4hvupEhatc4KWglR1Jca2R9CA6FGpsZA9uPYAzWNY4nFVR1Mr0TX7kbM6jtM9l1arF9onWgR0li7YQj5sX0jdE= 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=f3B+K92M; arc=fail smtp.client-ip=40.107.220.66 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="f3B+K92M" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A++37dKIpzGfwo6bo0rEdc/TaHsUAD7N3v5gq1CxgPpGYTtP2SixMD3YAL5yd481AcDDcO61V/uvGDS2vTrV1wRT5LCWGJ1ETPlRfAIUY55SySPJB9zNigZ3JOdi/IcXKBFmd6GxGhHSbmE+ubetE0n3kbBhFuZCUH/LoR2OkCWaeu0fy7odVYrFY67zVPrdqW9xhJI/4HVgtMDk6qKzaQT7PK2ElF5YTCJ6VKyHcTPA/+XZDF4pXX2LA+hfyNV/1ravto2OW2rPYckb7lQzDbZSPORo2DmytLXoakDarFP24czKBT5H/1FO4V7XI+Q+vKwuVhseHB06tSS5gFTzGQ== 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=/NYz787yAgl6vpZd7V5kOwziXwKb3nKPwDYHmV23RGY=; b=d4LcQbpsGf2Ir44OBi+pl+ntYdF3A2sbi+MAZQ7cTHSsNbXOesob+kJI4+Gzl7kbh/w8UKT0gq8hIXnRFVA3Oh105Ojngp4odCeuyotvJwRfz5X3HMElAwshgmOa7KAhkA5YrF/3kXLoUMepSDb9+5dMp5Lm9YPkrG/K0opCk0sc1Gt0weyVaThDLz/tIf4kkNiZmqSfyghy+X9mgOo3ANXa2PJl2ufbHWmzgC2iY4iIC0XUL+N3hLoR3CxI7PoOcgn+nC2crAbp9p8Vlp1iCs/daSlX586+kuKJKPxM/pMpykJGBeZgWoASOvX6IzVj2ztcpO4d0036//xiNeWdgg== 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=/NYz787yAgl6vpZd7V5kOwziXwKb3nKPwDYHmV23RGY=; b=f3B+K92MoW+aveR7TaQOzHGKKIGqFNjx7Ubqt9VqwRDYRnqKmfxz7nmDqRhQfp/grFaT75BLJ/BVGu9hlAqT0K+WA7hPEZZ5Y8LGpHaZgM/cddBnCKeveEJZY8kvMTHSDfDF+dDv7lCY4zlBz3wjX8uqviRF06rrXQzrSDdsNT0= Received: from CH3P220CA0008.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:1e8::19) by CH3PR12MB8994.namprd12.prod.outlook.com (2603:10b6:610:171::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Mon, 30 Sep 2024 13:53:38 +0000 Received: from CH2PEPF0000014A.namprd02.prod.outlook.com (2603:10b6:610:1e8:cafe::59) by CH3P220CA0008.outlook.office365.com (2603:10b6:610:1e8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27 via Frontend Transport; Mon, 30 Sep 2024 13:53:38 +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 CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:38 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Mon, 30 Sep 2024 08:53:16 -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; Mon, 30 Sep 2024 08:53:15 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 2/7] sfc: implement basic per-queue stats Date: Mon, 30 Sep 2024 14:52:40 +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 (SATLEXMB04.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000014A:EE_|CH3PR12MB8994:EE_ X-MS-Office365-Filtering-Correlation-Id: 288b86f8-60b1-40ed-eed1-08dce15748f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: HxF3VLy/ujnmSPXzJ45cQ5USDv0X5WbnKpHH9YL7GotbOUji8e/YI3m7Y8b4OmdgULBDD+SF8xe7ErZ8MlrzAx+R1spURsV0s/pi5lwMYdy9l1vFFJNX5slo7QaCQaFbpBDY27tW46LtzPDIDEHpeFFWLPDDLSPaFQVp2wYCiAkQBJ1rXAS7sfjIXaTQbGi1SZJ4//A61hhGHzBwpLN/BubQOl+F+Rry6NWOxvG8BnU4XtkyxIio1kAiagj9q41f7zpTZyXGUgnD/zWrApofquZBIgqXtu9gunQaOBLF7Fta8c8ECS8UMSA0OFE5fb5/fzDqS4lvQ1Ayfd+SIU0W/A0x0He7h6DWRnWQrJWmigv3cfscv25iA60dc9Sa8pCigbI16wOVbmjOfhHWHvWN7NVUmP/bkGoDdKkzExumatn5t3Pru+Mt+gW477gk+JBJEkYP8OiqI+3fx4iJg/z4YDek/iY53uleJotEiLv7DQgNuSILwagsYf+eQX3cWRpCjllVuRwRM3YCpQ/2D4R2zlj7H3Nqy46BsQqvXE8T4wYTwDlnhoWB3CFgS+uucwDpXJzkBPKVTnFYZTota0Ga+sqqU+iiYVKFZn5zGgRMmNBu4oIKkzSV6UFyJ5dXPuAiBTKdbRWYFB/nnWQGg8s569+2nuYcIp0M3VsKN/7WNKr0Jj0hHEdaR7/UUCLia0wQkZJSdpCpdN3i2vGC6hCITYZPujytmq+Ix4EyFL/h0+ZuUaUJSi8idZPveCMCeCd72SowjdUNoicwg129Sh9T0ovufMN6mmVBE/GtUTi2MdsZZNl0b8I7AEbfpXDq0JozxODkTO+NGF+uDxui2KaR8jqAS2HzsMGRlLVB3YRGD7ipMt8GZxi7KGMzfJY7JMWqGNZvRQ/awDVnnxdgaPLwcnl9rvsYeNZ+CPihAo6pAuqH4m9oVQRIxlkcsb7E9wc8thi16TsodOFu3nMsYKRNWTl2TzaQJgw2QXGqWzbRyzl4QY+YK9vilIts9UEOZVQcxA2MlxRsFwI7AAs03XQyNGz1XgzwY/vtrGa9OMNKA1eIXbTI/PdoxmAmuWp0/Zy50bAvXp+nkZIdKdVK8fBT8p9QYfU+s2nozl7MY7lPb1o8Uzmpx07C+Rm3Sn0/Jm8a8XAEi7fYHPFrLl/BPl19VXJvuA3AddXPOthSKCXBAwcSTTJJMfzq3ykXMIXvKUtihFB2gzwfsvXIhJe7+JAaNanV5AwzFTcDXNZGwzNO9DoHN7hXFPvyWTeGEENt86jzZa2fG3yYMyeOItAt6pUkYdPdixR+r1uDDM8AI5Fi7KkfJ2Zed8Rh1xmzfdc+/3VJNHCWkgFmM0qKzAqye5RQrkbTHnZp8Tf4UV6P6UvK0H8= 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)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:38.1180 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 288b86f8-60b1-40ed-eed1-08dce15748f3 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: CH2PEPF0000014A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8994 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Just RX and TX packet counts and TX bytes for now. We do not have per-queue RX 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. XDP TX packets are not yet counted into base_stats. Signed-off-by: Edward Cree Reviewed-by: Jacob Keller --- drivers/net/ethernet/sfc/ef100_rx.c | 4 +- drivers/net/ethernet/sfc/efx.c | 75 +++++++++++++++++++++++++ drivers/net/ethernet/sfc/efx_channels.c | 2 + drivers/net/ethernet/sfc/net_driver.h | 22 ++++++++ drivers/net/ethernet/sfc/rx.c | 4 +- drivers/net/ethernet/sfc/rx_common.c | 2 + drivers/net/ethernet/sfc/tx_common.c | 3 + 7 files changed, 108 insertions(+), 4 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 36b3b57e2055..21dc4b885542 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,79 @@ 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; + stats->bytes = 0; + efx_for_each_channel_tx_queue(tx_queue, channel) { + stats->packets += tx_queue->complete_packets - + tx_queue->old_complete_packets; + stats->bytes += tx_queue->complete_bytes - + tx_queue->old_complete_bytes; + } +} + +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; + tx->bytes = 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->complete_packets; + tx->bytes += tx_queue->complete_bytes; + } else { + tx->packets += tx_queue->old_complete_packets; + tx->bytes += tx_queue->old_complete_bytes; + } + } + } +} + +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 +790,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.c b/drivers/net/ethernet/sfc/efx_channels.c index c9e17a8208a9..834d51812e2b 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -1209,6 +1209,8 @@ static int efx_process_channel(struct efx_channel *channel, int budget) tx_queue->pkts_compl, tx_queue->bytes_compl); } + tx_queue->complete_packets += tx_queue->pkts_compl; + tx_queue->complete_bytes += tx_queue->bytes_compl; } /* Receive any packets we queued up */ diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 4d904e1404d4..83c33c1ca120 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -193,6 +193,10 @@ struct efx_tx_buffer { * @initialised: Has hardware queue been initialised? * @timestamping: Is timestamping enabled for this channel? * @xdp_tx: Is this an XDP tx queue? + * @old_complete_packets: Value of @complete_packets as of last + * efx_init_tx_queue() + * @old_complete_bytes: Value of @complete_bytes as of last + * efx_init_tx_queue() * @read_count: Current read pointer. * This is the number of buffers that have been removed from both rings. * @old_write_count: The value of @write_count when last checked. @@ -202,6 +206,16 @@ struct efx_tx_buffer { * avoid cache-line ping-pong between the xmit path and the * completion path. * @merge_events: Number of TX merged completion events + * @bytes_compl: Number of bytes completed during this NAPI poll + * (efx_process_channel()). For BQL. + * @pkts_compl: Number of packets completed during this NAPI poll. + * @complete_packets: Number of packets completed since this struct was + * created. Only counts SKB packets, not XDP TX (it accumulates + * the same values that are reported to BQL). + * @complete_bytes: Number of bytes completed 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) * @completed_timestamp_major: Top part of the most recent tx timestamp. * @completed_timestamp_minor: Low part of the most recent tx timestamp. * @insert_count: Current insert pointer @@ -232,6 +246,7 @@ 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 * @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. @@ -255,6 +270,8 @@ struct efx_tx_queue { bool initialised; bool timestamping; bool xdp_tx; + unsigned long old_complete_packets; + unsigned long old_complete_bytes; /* Members used mainly on the completion path */ unsigned int read_count ____cacheline_aligned_in_smp; @@ -262,6 +279,8 @@ struct efx_tx_queue { unsigned int merge_events; unsigned int bytes_compl; unsigned int pkts_compl; + unsigned long complete_packets; + unsigned long complete_bytes; u32 completed_timestamp_major; u32 completed_timestamp_minor; @@ -370,6 +389,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 +427,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..6d47927e1c2c 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -86,6 +86,9 @@ 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_complete_packets = tx_queue->complete_packets; + tx_queue->old_complete_bytes = tx_queue->complete_bytes; + tx_queue->xdp_tx = efx_channel_is_xdp_tx(tx_queue->channel); tx_queue->tso_version = 0; From patchwork Mon Sep 30 13:52:41 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: 13816518 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2073.outbound.protection.outlook.com [40.107.236.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 D01A8191F81 for ; Mon, 30 Sep 2024 13:53:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704406; cv=fail; b=UYHnkELy6ewmccOtCUEbiLkoSGOp8nVdTDJm2cDEj+4IgnMGtqM1GmvSM21VXwblTJkW8a7QUJnhAd/IonDa7+bMZLivY3fCnJsLU+hz24fh6nC9P+B9pD4cX0wqBDvnXjVad/AeYSLs+1EI7tHsxpr8oqpe81yJ/xOFMIgeCXE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704406; c=relaxed/simple; bh=Sv2mycHhzFpVHsrctE7MCekDFFjNnnCL3dK4OGEkgkQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JsxGxtdxNyXyQkjRXbJxTwdm69e4Wj0NCWfKWYlFLRd1tP9L2VVu2X4p1Tb29iqk32dsF/1GLF/3KyUvFPhoUGI1BnBLOd/BiRbHWjmvpuCqw1Z0dDq3tzi9IwvBv5RBvm7y+eWSq0BiZxOILdPAhh0hK1Azt168RwGWIY9hXVI= 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=0zFMj2wM; arc=fail smtp.client-ip=40.107.236.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="0zFMj2wM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T5CPN1Cjn6EENEGzvWZrqWWCmgZbTg3n9fZbR1oq6eMN5W3MmAI7zDgxTJjehVrCyLDqrhgOWAWodzMv5+HPi77PiF+aS5XUGuc5WwdJSC+l5oP++tCpHdOD9etbdFoZBZT7mkKkXnmRnJwu4ODC7qRZDODkUhosAG+R5M2fjdD2tBYrvJJ3cKLRHdEC9uGOmyTZqZklHl4UTSl4Wd68+obn9PofVkdlGADyKpGQsRX6AJeVCB3stOO3z+P8jYDiCv8oaoPvpeV/P9dEXqIyJa8ijddQfbn9Lo2rKer9UP+8/QgSViQ8l1NCBy+VfL/rmZMqEWHijJ7KTH7J9nIknA== 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=AC9x+VYpSyXf7UxnkADPhJF3Ugk6OLghpU9VbWarDQShFFYJuyLP/1MLADp5UXgW7CVy0TsWLxCFFem83vJfFSI5fUtK7kb5s4MmIBtfLBCIhcprXC2wJ49AlbDyicAFgglSbdJ7Qo4t7yChxeP+lQIqAhwb75QOklNmO93kK6bMtPOx/F44TPUPTpV2FcUkMho3cw+YEJEwK3BHA1WqZ3WlAY43P/CFtJhLLTk4weviLtdCd+DTJap199pdoEm92sssjlmw60ZsjvwCnkq+7P6/T3rAW3z/Gy7pLp+KsCAZ5Fqc8w1NdMTY5TXgdjHWWkQ2Kf6uPyl8i3wj7nV1/A== 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=0zFMj2wMjx9skOKZ0DtQRgP8f1jMtIh1MVRNMmXFjvigcWLEecvxpu0K4wtMUV9LRREJRJ+i2maKlJOVdx88l0zO9W3APi2021gSaD9rjxrj+dh65mmhyvzzjAilkQ+R6PBkAvhpnUU/gf06z1YzdkbuD1/eYs+BYxnWFS/d1IQ= Received: from BL1PR13CA0067.namprd13.prod.outlook.com (2603:10b6:208:2b8::12) by DM6PR12MB4354.namprd12.prod.outlook.com (2603:10b6:5:28f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 13:53:21 +0000 Received: from BL02EPF00029927.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::18) by BL1PR13CA0067.outlook.office365.com (2603:10b6:208:2b8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15 via Frontend Transport; Mon, 30 Sep 2024 13:53:20 +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 BL02EPF00029927.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:20 +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; Mon, 30 Sep 2024 08:53:18 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Mon, 30 Sep 2024 08:53:18 -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; Mon, 30 Sep 2024 08:53:17 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 3/7] sfc: add n_rx_overlength to ethtool stats Date: Mon, 30 Sep 2024 14:52:41 +0100 Message-ID: <7b1009e8f49eb27f9d07935c3e1a90b765354098.1727703521.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: BL02EPF00029927:EE_|DM6PR12MB4354:EE_ X-MS-Office365-Filtering-Correlation-Id: d2f8bd9a-00c0-4dd7-80cb-08dce1573e89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: 5IFGyBsd93/ZkMJwPx3wUAPh5X3UrKx6L7n0DQjA9grQhzZer5FfA/RIGfZJnTHMwiuzNqkzwEm96QM8BY4uCkgxxD/JGpZnDclGexGCxMzHR7GgajfbG5cs5Xj31l4bbuMGLZ5YKC1aY3aUPZqMlLZj1kAixsTjSL42PP8Zi1FaNNrpXUPdBd97JYvnF6Au+GqX18h1Dk9Eqj/SdYTDntqtO5BIPbbGe3bHOTcg+Sx787PQ+3jv245MbGiaAUNc2FuxQjlG9VVHOtXV3B8e72yP/gweBxwaSedcALKY3vkSvyop5jZBqBFnTPO5cIV2PcO6RTlNlargiaJMemih2LLpjE2B1xnFsf3FwUODE61/CBKU5CkwHWEJtK5Lt8FXuRUdICSOyvB383C+bkpMKaWEXFeHSPR22X6zp/24K33WBQlwL2S90YuGuF6R3PNRO69xSFP5D8EO7GkH+bsaddf2qm6z5iQtCstqyiKJnGmsdzlKYVwnYuSeR3Ul+f9B0y9egnv3zuY78OmnnjjPzY+dNK6SWq8QLsRNkr2MdMyGchZKwKxtpr+NomqrBkn6OTZ2EhC8TaOPjRU5K90FjgCnYc8yCK4n+AZo/pROO8LI8kWq6XZZy/o5P/Dg0O95lFsg9YZEnlTnJkzIFlqbeXb/yDakXDNOO5l6jNkJ66c0JqzpW6+pgjBJkLBrcXk56k3tWB6Kt24GZ8kqni68LCBNP1SpMZ9JdWftiFpl9/T7jwZHCaG2JgByoa20JC97SbUPDwvJ+ZWqFTKAGrY4FHKEnzvpfTWBFZfjWChQscVWbqpXUmT98sr/5OHu7M2sjJSOEzNSh73/SYrAsYUEyUj7tluQ7ZjK5lf6g+CYZFV4JJROSaSLWATUCjmLivxG5ByrmOki83Dt/9p5BhzhOBx8P0h8+2j8SrCNe34jwEheGpmwNIzIDohTyyYJpOl//Hac9HVJAxhL5XxTxjKW21btQ+cSGduuFDVG064Pd9a4plthQJDiADOmy3zKFQw4rbNR7dh0iQvvM5Uq3NS/trFkUcfvJoL8R9bexfnQbk5JaPsuTFzejBHF4SSd/ttiRXCaSvicVot8b+eAWcME2MlAbE6szHyfWOa68tyrV6DgIQgJQe00IdIRE1FW6jrrHBcUyfCY4PNU5Oo8b4uzvkcLVNDyH9O+CTYzPleam8grv9NppmOS1dmslZHK6P+FRBRlN+sjDVhSqMb5rcdu53NVFlj219YcQoYCELUuHb6ude5f6BxZm+GZYiuygJyLsrX9n1u1cpGMIEmAr3eaRV0lzdwT2Na4uTuPC7gFrhx72Kyzbn5izoXQ905+zIxOQVd+7CveZJWgu3Q8QKixJ9p8iJciZJqC4bCnpfng80bJRFazVCDr6z9FOPqSoL0YGGQGkc1zRUjbIpacgvSalusbGHb6vDNb3tUbwIUnukiJxlIMOlwgt8OdceekLFHn 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)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:20.6589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2f8bd9a-00c0-4dd7-80cb-08dce1573e89 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: BL02EPF00029927.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4354 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 Mon Sep 30 13:52:42 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: 13816516 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) (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 8D91B191F79 for ; Mon, 30 Sep 2024 13:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704405; cv=fail; b=ic9/7k2YvHqBmvzTbuBzEuBdJB4v7Z0J+7ZvAglYLHvWJ2oOKYIs0QtlowWUriwopL19fd0flb7+B5sWhrRt4MTbFVZMYxYnwDbaQAW7SqNES0drVZmW1dIY0xNASZia3DICJ/Ak6K7sHbW07shKq/OMhVun1z5wEwyoxcIJ/SU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704405; c=relaxed/simple; bh=pPWTYDmixPhRLCHcZ9rpS3Wp2A71AXolnz/p6VSl3NI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gXG5Vjvt2izZUiSaroZzEZMYN7JE2HeVJL2jSsZkjg8BEQpwb+rGV0nPwVA+dU5O9UZ6e7buEN+5AdUjhLiOy0rjHZRrHBT+8qfelfxZDcn2EFvrKthx1c10q+odCjPSQEUo1OOJBGmAIMDLc7iTVEL9EcB6UxFosePMMgNNEOg= 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=CyXY92W2; arc=fail smtp.client-ip=40.107.94.83 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="CyXY92W2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FHKK/scnIFuSXAXBvcAVkOhg58fIgfZH1Yr/xJkqC1TAPPDJIjCe7GtB5I+gdAKzsCBkv0gL3H6xFtvsopIDmWO2B+p6FLcbuXPaRp8aoBKqlPhe9rHoRsiIdhOeVaL/PH9i1A4vYlE7jML2f0I1PQET8fnEcFCJa7sLQ8K1YaSiPiDfblc6rb4+o+swc/j1qRWyiGiBn5wBuBfHW2+SDhBAngtmebEySv6/SpgruGZohteZlJgpo7XiXSewYh34rbvCpy9HGgtWYe4atYi+UiKF9/2PCsHvW6zdT507yZL9+x7He1u6rylmZP04e6Fz9zVh8YxqFbTUONFL+z+0UA== 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=E9gwSEhRQ2tT+qiziVBTJAtitlov9TWKdhaAeJE+2YQ=; b=xRYP1oqdWP4zlEsfsSF1RR2dGUiENmG33vfUTft5K5VF91ofTJOti0Wf1s3tgJuoGE2Yj2ROXDYZpALIr3blrf1OCXA+fzUYm/NVUj4iu6ebSztzXI9c7z0zhfWzEqscAeHiel6Nz7zXe7B6LWon3p5730adxwMKcpOAkh3QbCxHcyzOl7MY8Fii3GoWurxas9tMLVOj7dWRu0xZ6zUmDf0ZWFILochTau+fpYiGnP0xRjjx8ewVWvGG81yTtDVED4HOxocotFP3VOAuCxNboy+LDjt3rwhZwvF1sPfJDj+XxgJDntz3QzZD/lOnR83CFVa0Di0oekM5cfMShvyIYQ== 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=E9gwSEhRQ2tT+qiziVBTJAtitlov9TWKdhaAeJE+2YQ=; b=CyXY92W2k2wN7uNi7Ti+JoTXgmqOgrocx1YG8P0WwQtwa8dNo4vJFGRxUp0T1w/gcQg4NVDcGmV0bBFdSEyIazF1hN4If+FGEhKf0h5e3v5QLhg9XfMNF6IdwyuavlOr81zpsJu9znz0ZHsY0sWdKtiAiRsUP+iOZqbZ97TARtA= Received: from BL1PR13CA0067.namprd13.prod.outlook.com (2603:10b6:208:2b8::12) by DS0PR12MB9276.namprd12.prod.outlook.com (2603:10b6:8:1a0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.24; Mon, 30 Sep 2024 13:53:20 +0000 Received: from BL02EPF00029927.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::2e) by BL1PR13CA0067.outlook.office365.com (2603:10b6:208:2b8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15 via Frontend Transport; Mon, 30 Sep 2024 13:53:20 +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 BL02EPF00029927.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:20 +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; Mon, 30 Sep 2024 08:53:19 -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; Mon, 30 Sep 2024 08:53:18 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 4/7] sfc: account XDP TXes in netdev base stats Date: Mon, 30 Sep 2024 14:52:42 +0100 Message-ID: <44d77cdcc1df6d2606945481ded02ba824d9d507.1727703521.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: BL02EPF00029927:EE_|DS0PR12MB9276:EE_ X-MS-Office365-Filtering-Correlation-Id: bc71d179-9306-4882-49ec-08dce1573e31 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: o8K9xj1XVUMbVOYD8oA/TOX2Jhh8dlKCiZEKMKjR0VcqCgw0Xna2AqBEoFNBCtmFxtQei9pp8Ms1h0Hm8/wcpdc9qamPHuWWUqrbj4RxXKYzHOuCAgUSV/uHFlY/gCGw8AaxtAsaFO26ZCtJ/CKOkKTLzKf6O8psBYP+IGDyX6UI4WNkLB4vZIyL+M0TyVAhemIhxo6Ujg334cofR81HXAvqZAX45ZMI81EbQWyvGsV9hSDPMHn3AZ3Ou1zDV+HTztwINRa5idzK4NWgXXrK8dVdVRdpzllYyt2uCb0RYfiBOVZ4FIX5bHJWij0TtzR1hymHYSiClv8c0bNkkLkWCMXitiRNebK4CtLoQ2Q2KywJab7qR9E7N1hFVyQKh1083WxPAQqkqvG1NfLG69Zet0SQNScjyF0zsGFR/VnSrJkHf2h6fMd9K7UZ4VMHIPBbOVMnETaDPi7MYzgoX+4bsdfmAm8npL6Odkf42NQrpQkveTsfo9tZbj90hM7InPX94A1+CKOb6Kj7tRd9heAR8kc788mKoJzVcPC740W1YIz/VcVjB6OgoKJqoCs2KKLreXySGdu1Ftz6P+KLxSBqyJmhDsmwUCTcl3rVEiCz7g16AMWRiL4pOO1bk9oGnowlSk0udKDdbDox2N3c4jQ2orCPAQYGnynoQ1GGXb/1W6DREObwHwT2AVULBItLnqAvi8MKMd6geJ84v6xYF0B8DT1PdR1j1UnwR3ly+D7ecymVl9JbjrpmE7z+qateEJZxjG4Kv+rycEOp/xjg15il/gQolJrdC9RIliXCg9kVHdEeq4YWlLKrDE3ivc9vdp4P3iYco3ksJGQh4s1HNm2K0R7OY5keVxRSQVJ6hCDSIUD6ACJBAgnRieQlOmh0J2OFXGl1Nm7yCCTH8+R/cs3Di/HnnPRrbTE2wtxuGeE858n8ZXg85nlLFKFcKSFVlyfshuF49VmtD4WQQKpuNY7I4NXcHy0twlNsLLnG8CWTIcIdrefQNKXt3YbkxYFRhCuzqo82twH/18J6H3kAzdyoUXmLqHCnHavMz6BzWPUdmg6XzqMqvpGvofUY+qO9PRlE5yT9Hn/ZLyCagCo/g1XLknw/PhV3lMepox0EGFVwxXUasXjxSrSFv/5KEOGYsEDqla3h0Rw7Unqef+SxBweElqG3A+bHtYJ+RYcSLPOnaoCK6C8hpHt8iwqWkWDSIDaQrUMjNWTbDIgB8ctvE47YdxKxj7Mh3bLp/yJttWb3hAjItvbqp8WGLzJXBGizWASSyBsxSD0E60Sw9aGGjp6//s35wk/wFViR8ngvQrDIDdxUNhiIsy6ty6elbYCZvmohemxTDm4U4D0Vzt3hBlL71FmZO6QrIWJSDLh+l1HY7b2z1rCIqDigA68Nxy2GfK9hY/VciPbt9icNv9Ek6rPAL/BjihdSJjBaB9rQzoP++9eGlDhCAFMkKi4vuH83J6dA 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)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:20.0652 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc71d179-9306-4882-49ec-08dce1573e31 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: BL02EPF00029927.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9276 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree When we handle a TX completion for an XDP packet, it is not counted in the per-TXQ netdev stats. Record it in new internal counters, and include those in the device-wide total in efx_get_base_stats(). Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/efx.c | 3 +++ drivers/net/ethernet/sfc/net_driver.h | 6 ++++++ drivers/net/ethernet/sfc/tx.c | 6 +++++- drivers/net/ethernet/sfc/tx_common.c | 28 +++++++++++++++++++++------ drivers/net/ethernet/sfc/tx_common.h | 4 +++- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 21dc4b885542..ea1e0e8ecbdd 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -690,6 +690,9 @@ static void efx_get_base_stats(struct net_device *net_dev, tx->packets += tx_queue->old_complete_packets; tx->bytes += tx_queue->old_complete_bytes; } + /* Include XDP TX in device-wide stats */ + tx->packets += tx_queue->complete_xdp_packets; + tx->bytes += tx_queue->complete_xdp_bytes; } } } diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 83c33c1ca120..aba106d03d41 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -216,6 +216,10 @@ struct efx_tx_buffer { * created. For TSO, counts the superframe size, not the sizes of * generated frames on the wire (i.e. the headers are only counted * once) + * @complete_xdp_packets: Number of XDP TX packets completed since this + * struct was created. + * @complete_xdp_bytes: Number of XDP TX bytes completed since this + * struct was created. * @completed_timestamp_major: Top part of the most recent tx timestamp. * @completed_timestamp_minor: Low part of the most recent tx timestamp. * @insert_count: Current insert pointer @@ -281,6 +285,8 @@ struct efx_tx_queue { unsigned int pkts_compl; unsigned long complete_packets; unsigned long complete_bytes; + unsigned long complete_xdp_packets; + unsigned long complete_xdp_bytes; u32 completed_timestamp_major; u32 completed_timestamp_minor; diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index fe2d476028e7..822ec6564b2d 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c @@ -553,6 +553,7 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, void efx_xmit_done_single(struct efx_tx_queue *tx_queue) { + unsigned int xdp_pkts_compl = 0, xdp_bytes_compl = 0; unsigned int pkts_compl = 0, bytes_compl = 0; unsigned int efv_pkts_compl = 0; unsigned int read_ptr; @@ -577,7 +578,8 @@ void efx_xmit_done_single(struct efx_tx_queue *tx_queue) if (buffer->flags & EFX_TX_BUF_SKB) finished = true; efx_dequeue_buffer(tx_queue, buffer, &pkts_compl, &bytes_compl, - &efv_pkts_compl); + &efv_pkts_compl, &xdp_pkts_compl, + &xdp_bytes_compl); ++tx_queue->read_count; read_ptr = tx_queue->read_count & tx_queue->ptr_mask; @@ -585,6 +587,8 @@ void efx_xmit_done_single(struct efx_tx_queue *tx_queue) tx_queue->pkts_compl += pkts_compl; tx_queue->bytes_compl += bytes_compl; + tx_queue->complete_xdp_packets += xdp_pkts_compl; + tx_queue->complete_xdp_bytes += xdp_bytes_compl; EFX_WARN_ON_PARANOID(pkts_compl + efv_pkts_compl != 1); diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index 6d47927e1c2c..2013a609f9be 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -112,12 +112,14 @@ void efx_fini_tx_queue(struct efx_tx_queue *tx_queue) /* Free any buffers left in the ring */ while (tx_queue->read_count != tx_queue->write_count) { + unsigned int xdp_pkts_compl = 0, xdp_bytes_compl = 0; unsigned int pkts_compl = 0, bytes_compl = 0; unsigned int efv_pkts_compl = 0; buffer = &tx_queue->buffer[tx_queue->read_count & tx_queue->ptr_mask]; efx_dequeue_buffer(tx_queue, buffer, &pkts_compl, &bytes_compl, - &efv_pkts_compl); + &efv_pkts_compl, &xdp_pkts_compl, + &xdp_bytes_compl); ++tx_queue->read_count; } @@ -153,7 +155,9 @@ void efx_dequeue_buffer(struct efx_tx_queue *tx_queue, struct efx_tx_buffer *buffer, unsigned int *pkts_compl, unsigned int *bytes_compl, - unsigned int *efv_pkts_compl) + unsigned int *efv_pkts_compl, + unsigned int *xdp_pkts, + unsigned int *xdp_bytes) { if (buffer->unmap_len) { struct device *dma_dev = &tx_queue->efx->pci_dev->dev; @@ -198,6 +202,10 @@ void efx_dequeue_buffer(struct efx_tx_queue *tx_queue, tx_queue->queue, tx_queue->read_count); } else if (buffer->flags & EFX_TX_BUF_XDP) { xdp_return_frame_rx_napi(buffer->xdpf); + if (xdp_pkts) + (*xdp_pkts)++; + if (xdp_bytes) + (*xdp_bytes) += buffer->xdpf->len; } buffer->len = 0; @@ -213,7 +221,9 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, unsigned int index, unsigned int *pkts_compl, unsigned int *bytes_compl, - unsigned int *efv_pkts_compl) + unsigned int *efv_pkts_compl, + unsigned int *xdp_pkts, + unsigned int *xdp_bytes) { struct efx_nic *efx = tx_queue->efx; unsigned int stop_index, read_ptr; @@ -233,7 +243,7 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, } efx_dequeue_buffer(tx_queue, buffer, pkts_compl, bytes_compl, - efv_pkts_compl); + efv_pkts_compl, xdp_pkts, xdp_bytes); ++tx_queue->read_count; read_ptr = tx_queue->read_count & tx_queue->ptr_mask; @@ -256,15 +266,18 @@ void efx_xmit_done_check_empty(struct efx_tx_queue *tx_queue) int efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) { unsigned int fill_level, pkts_compl = 0, bytes_compl = 0; + unsigned int xdp_pkts_compl = 0, xdp_bytes_compl = 0; unsigned int efv_pkts_compl = 0; struct efx_nic *efx = tx_queue->efx; EFX_WARN_ON_ONCE_PARANOID(index > tx_queue->ptr_mask); efx_dequeue_buffers(tx_queue, index, &pkts_compl, &bytes_compl, - &efv_pkts_compl); + &efv_pkts_compl, &xdp_pkts_compl, &xdp_bytes_compl); tx_queue->pkts_compl += pkts_compl; tx_queue->bytes_compl += bytes_compl; + tx_queue->complete_xdp_packets += xdp_pkts_compl; + tx_queue->complete_xdp_bytes += xdp_bytes_compl; if (pkts_compl + efv_pkts_compl > 1) ++tx_queue->merge_events; @@ -293,6 +306,8 @@ int efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) void efx_enqueue_unwind(struct efx_tx_queue *tx_queue, unsigned int insert_count) { + unsigned int xdp_bytes_compl = 0; + unsigned int xdp_pkts_compl = 0; unsigned int efv_pkts_compl = 0; struct efx_tx_buffer *buffer; unsigned int bytes_compl = 0; @@ -303,7 +318,8 @@ void efx_enqueue_unwind(struct efx_tx_queue *tx_queue, --tx_queue->insert_count; buffer = __efx_tx_queue_get_insert_buffer(tx_queue); efx_dequeue_buffer(tx_queue, buffer, &pkts_compl, &bytes_compl, - &efv_pkts_compl); + &efv_pkts_compl, &xdp_pkts_compl, + &xdp_bytes_compl); } } diff --git a/drivers/net/ethernet/sfc/tx_common.h b/drivers/net/ethernet/sfc/tx_common.h index 1e9f42938aac..039eefafba23 100644 --- a/drivers/net/ethernet/sfc/tx_common.h +++ b/drivers/net/ethernet/sfc/tx_common.h @@ -20,7 +20,9 @@ void efx_dequeue_buffer(struct efx_tx_queue *tx_queue, struct efx_tx_buffer *buffer, unsigned int *pkts_compl, unsigned int *bytes_compl, - unsigned int *efv_pkts_compl); + unsigned int *efv_pkts_compl, + unsigned int *xdp_pkts, + unsigned int *xdp_bytes); static inline bool efx_tx_buffer_in_use(struct efx_tx_buffer *buffer) { From patchwork Mon Sep 30 13:52:43 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: 13816517 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2083.outbound.protection.outlook.com [40.107.102.83]) (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 37860191F7E for ; Mon, 30 Sep 2024 13:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704405; cv=fail; b=ixyBj7XoxnkQtoy9v6deCHCOJe6O/k8KEY/Lq1KeSHqkwQUS/QN9CKVo/KyGINDabDllyujDUQp4UxjZEGSfHm2pnXD6xetn1shv9U8wRkWWdq0EKSiVbDlrfbx/UTZPPZzj1Zjz/nQSkn2/PJtgYqbWPCeXhFR0qj3zLfojqdM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704405; c=relaxed/simple; bh=wg0yEJ8qRagYgQcGnFNeDtAVK2u1kSRCVY1mv2+MDAQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sQlNjJ4iOwq+pfWNp+gDEeaZTNEXE/rm7Y6K0SeJLTvSgA0NGZ87lKW+ZBfu1j/TbHslzrswryI+QMxbas0GmjHS//ADPUATq3DNHBq7jSY9ShHCjWkC1H1IyHE6AS17rUbu9I5eFpWtJP/2P1gRXzTKV/jDwJuO9i5BT98Q+II= 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=D7dQq9bz; arc=fail smtp.client-ip=40.107.102.83 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="D7dQq9bz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SUkwN8tg9WguIXL9BBEqsIjPEhNiqPwmu/97mH0KFVtCpdMe7gUGdgNDv5cRYyaLTlryi8S0ajlgbjZL5FuwQbsEB/HFnCLdcqhTezsCik5tFm8DLmmg3QyUPe3dJTQe1OsNqb/F/9NI8Up6F3fqVXcBIyPad5vhJ7FybqKrIFekzh9QVjKGbKJcBKE/AEVC2NFUk8FounpE4ImnLF7xXKNcuR6339MsnKrO+EoyYgpV2Ov6GdrOo5E4zh4psF9znEKCb4QCul3ub2zLRKDboSa/KXtpe6tKom/Ys2DHdpIAJjpfQszBaR/WpMRFW49ljfckKGToxPJOpFGK1ytyDQ== 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=hXx5JbZemJdRw1Lv6XGS80EQox2jzRpGqE5GpYza0xw=; b=kzISUdAs8E/ve5ASAHU5/zOzfG/GFNFQcmfHM1f0MkjXs8IshkVssGp0A1I+Gvz5dETqUm9u/xjlHK+XYBMogXXrrGOp88IyGpkHdPO9lax1e0T6lYXRfRUgOV19r7dGNyVT0TZgyfkeBBVY42iMW35rax6hpH9aSsFvJD+JPuTZkVxHThRJnYNuuQV7tVUid3qqVrULzSqmQ2kqCXHr7DBes47aUFwbX/0Vn/opLCxk/Nl9/dE6Ppzee8UMfmZAqvSh3I4PFdsnrLjl+YCiXyEgcGzn86DODiM0W+7WFXQIgJIgV82QnNJXtwsTMTtZ1PUdO1gzjvHO6Dfct9AdWQ== 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=hXx5JbZemJdRw1Lv6XGS80EQox2jzRpGqE5GpYza0xw=; b=D7dQq9bzoOHeKo3Vf0v3t+xR9K2zXEMqE47uVk05wmcWBLLkZqcyeedXvWgVHSzozDFCJ9ev3YJxpAIw0oO44bb6sddPcczUspt+Z7tfwIoergWaG7GrZ0FfNXCKoOLC1Y66tddffKCyyKObT8PoDDEwYW9FD+/f5oyIU1NeUeg= Received: from BL1PR13CA0084.namprd13.prod.outlook.com (2603:10b6:208:2b8::29) by SA1PR12MB6971.namprd12.prod.outlook.com (2603:10b6:806:24e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 13:53:21 +0000 Received: from BL02EPF00029927.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::39) by BL1PR13CA0084.outlook.office365.com (2603:10b6:208:2b8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.14 via Frontend Transport; Mon, 30 Sep 2024 13:53:21 +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 BL02EPF00029927.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:21 +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; Mon, 30 Sep 2024 08:53:20 -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; Mon, 30 Sep 2024 08:53:19 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 5/7] sfc: implement per-queue rx drop and overrun stats Date: Mon, 30 Sep 2024 14:52:43 +0100 Message-ID: <626495ebb966557dafdbfa712a27d9a39051a280.1727703521.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: BL02EPF00029927:EE_|SA1PR12MB6971:EE_ X-MS-Office365-Filtering-Correlation-Id: eac63a24-5cc5-4a41-b7bc-08dce1573ee1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: Sw/uPuC4ImHhhziuqGXEeKPRIm/Fsjhae2LRxXIOo+BRisifg5cb9PdjDgBO33tFA9a5ahaLXB0kN4hHxAoOQHSUyijw+g7+HmIn8zxLw2JUb3fqJ/d2D/54pTeuE4H+akTKsfVupFzTp/UK15uKSliInTSC+XJQAqpVzu+W3x/LunWWgMPSoDSHpebcT3TKMO0NZS/rhqwt+HuguaubhTcPPp+oxMmKahewWF6kT8/lrcAmmMAW+btwZ7fiRjIInt+c6FPJGs97A8AMRD7R2uQf5kqbf+lcMnth6NcvaEOxiuRvnsPLSViMD8lJHWUIGvqswosHFh8p7RNOeYdJuURUtboACyR0ScvNaskO31GtAaPbesUZt0edOk58WdTxfU5Sh4ftTktX3erzQtRr5V4lC1nO1RUiWquYIhd67g+Q/O0h1TTsHhE6ct7/jzocjUmWi+0DjZUmU9T1tD1bz5kmComaX59vx81uGgH19jJwaJdy2c80xgVZcgiJallb3iivHkvFG9mE50+CcyNIlk/gkDiHjYtcH+oRoTwMiiVdTwhLFSKwR243WEQqW3OFHXV647eAB78SZyUNlZzjNH4KewLFTDCXVbM6ouL1QLPTgTuFVcD0Z7KI0RjWTPGvYxWMQiSE2ybu80VQiBzcwyaejMazTJhrAgQNUi/0cOx+0B+/qIbJQWqelZRHqWS8u3Fgcpst7+CVoPRkNbPlVhDi2Yb/Dju0Z5v+ihL6erziYJpgZhOJhb7bKjFNoq8mD4BrqdyI3GoBwhPYJBkRTYAD/r7j2ppPfuuf1oJmDl9oRb4zBOWbzd85lx8WAX8BtPmIDEK0ZeMw20e6c9O2kbd/Hct8tgYfr3ZbOCLq2HohUTWjS0zmQ4dMyMHQSSYPRv5/mUrHXIg4eGF8JYLchFDRdC7hzulRfT7dhAxzdpFASSBsdnUbyMmOFBQ8o94Y5b25jLteFTDNAgpzwFK+yzX7E5EXFFEZA2DkzColzEC8YBtYOj7uHhNsMtTVdhZwI6eKKj9Wx9JY5l0klD9C+hCE7sZRHKfR6ZTLB6NALahaAQ/Ymu3TNZKXHZmCRZ+lx7JWjelm40LS8r8e1DnflbVhRgTQSQ43vSLi/K6n/Bb5FuzVh0q60CPRYdwy5VgbYWMQrlNatxGD1VulyyVLYV8z99joMZBIXSqN5X0GRRBAV8bY3N3gerrH5ZqkhPjk0PRidqMtUODpwN7kNg12TzeenH7d0vyoRRY5nOwUHUBILNWwyYdObogJVU44uv/uapNhhYe3kvHDjnQZ1za9LPX7LlLNIcCuR8/oeyzEFuoLwAPlsZThmxtcOM0GS4bFlmWWsk93GylAllqBO5/U4BaxfECB7/d+EgOy+714ZcSErtW6Ncxvw65Sh2OxUyEr3twtxOmALAl5j6aF6YnDTqCcU8xtllx7IZP/F5vdYxh9LSrFnc7vSeEwVDOepBK0 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)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:21.2370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eac63a24-5cc5-4a41-b7bc-08dce1573ee1 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: BL02EPF00029927.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6971 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 ea1e0e8ecbdd..b0ea4ca82cd8 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, @@ -668,6 +672,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; tx->bytes = 0; @@ -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 834d51812e2b..44d92c0e1b63 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 46b702648721..547cf94014a3 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 aba106d03d41..f6632f8185b2 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -494,6 +494,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 @@ -556,6 +560,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 Mon Sep 30 13:52:44 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: 13816519 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2059.outbound.protection.outlook.com [40.107.220.59]) (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 313B9191F98 for ; Mon, 30 Sep 2024 13:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704409; cv=fail; b=JLhYzsmqhYo+7I4lU6IsoMBaTdwLFh71dUFpXB9hBrA2sa1GcdNXDdVqThlLEQLY51MjMWI6vRdesIjhei9VnDJoieyp1bPNVwJW+gr+DCvZy0E8RkeSqAAhThO2ATaCLbEHput00trdFetDQ4Hp0kwJFBsS9h7EOl44tFf/6hk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704409; c=relaxed/simple; bh=0/70hIQQICgzkO7E0pa6R7OVvuAqhL/r0D9ioGXmsZY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HeHomkdYj1lDop088PTVl+WZTbIbVLnD5tm979+p+S39Bqg2w1OwE4j+RkyQHAgDJlIy7feu2XeOlsF3EyzJ8N2ZEKzaxKXMRv2iOUO5UTVutyUBwemg9YrGOjdXwem2eO8gh/s3d+j2jRFs0qkt8myA6BDa/ic5e+9IbGFxX3g= 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=P0DHc2K7; arc=fail smtp.client-ip=40.107.220.59 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="P0DHc2K7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dysKDOgpR+ax2QoGvEHBTZptu+BNo8MYCeLpl9+V17dKrc1iWopQe60e8AruSrU6u/HmynM7PWUWOko9exCho0R7KsMk9cN3O1jCIAZXav03KPUyR5U83cigdkpt97vzXtWSyM+86wtZXjx4EBGkIZj4m5hNgBLBqt9642ZbiEIqmAFSAw0VC8h5l5+u9pvgzlG4BCaPFRpaiPaDLp9g8CfgAJKq/rb5XrWAkeHDEfREsYAAs6eIO1JP3KtqMyzFrrUjStVQ+aCsvUbRTCqhqoels8ydvaGn+1uSL9qi7Ac1HxMLvSMwfZPiaMDJY1yMjka6VWnO7ZvMYj8jI3O4Ww== 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=mCsl4DNyN0oLo4i5pw34tWd1c7vE91RPdbeEum7kDpQ=; b=DAJwzxTPrPvaLZxZpO0cle6tiEH5BNycAQoRT4ILFgGzAkQ14Mf7gMZwL0y2bROfA9MB3Oaz9CCD6GAIwb/HEj3ssyVfbCW5iTdkUWhyR1SJJKNsJNlHxbb8zAJA9PryEZLowo4oxP8YS9FiYhhSS5whVBLh6giwwvdZ3J+txdr7YcfhriPhm1b33qDs9E/0yWPL49PYbUEM8uqYN09y4gIsej8mVVduOGK0ie+oiyY/Oqckj0+5efHTYDExzIhuv9KZX9AqpgDi45v3BbgrfFyuGZapAsvgPeGeJBKgS4zaXx/C4CEmtHTCeR2X7jU6ZIbKKEytpb34TgNUFZCXrg== 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=mCsl4DNyN0oLo4i5pw34tWd1c7vE91RPdbeEum7kDpQ=; b=P0DHc2K7RhLwRFfZ+3f6cidEppizsCxLiJNcs8L+e0eQozjzz8CyNXIn7hkxKurtz+9b/TzSf3skFaEwOtI5DXJ6cXfNw6wtgnQrpBNIqyLaJPmiBvJNs1HdOcelP3N+9WYrNwA0sieYdS7HdGOKwqNb4XWs3R+9z+mEr1uBLjM= Received: from MN2PR07CA0026.namprd07.prod.outlook.com (2603:10b6:208:1a0::36) by PH0PR12MB7885.namprd12.prod.outlook.com (2603:10b6:510:28f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Mon, 30 Sep 2024 13:53:23 +0000 Received: from BL02EPF0002992E.namprd02.prod.outlook.com (2603:10b6:208:1a0:cafe::65) by MN2PR07CA0026.outlook.office365.com (2603:10b6:208:1a0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27 via Frontend Transport; Mon, 30 Sep 2024 13:53:23 +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 BL02EPF0002992E.mail.protection.outlook.com (10.167.249.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:22 +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; Mon, 30 Sep 2024 08:53:21 -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; Mon, 30 Sep 2024 08:53:20 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 6/7] sfc: implement per-queue TSO (hw_gso) stats Date: Mon, 30 Sep 2024 14:52:44 +0100 Message-ID: <8318093725878504a2bd75aa807cf8e8d6d9feb7.1727703521.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: BL02EPF0002992E:EE_|PH0PR12MB7885:EE_ X-MS-Office365-Filtering-Correlation-Id: ca6b9fbb-cfd3-44ff-b40a-08dce1573fa2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: VYxkMR1aPpcIfgNX4K5phVWZ2XsRBni9hypcXeJVkMtLA/sX1yr0RaxShHlFJxUIDR2sTyyWlo5hvlhwAgv2GMVxjQ7xuGo2j3FJ0ar833xcGH/BrbVYPXd7BG/tHgI6P7lPkw4X9CDyMxSYLRif9lzeBanJiknfbjCKUkLuQ6x2FRTOt7STCJlLcQhSEs5FRwC/g8uV1hWSZKJNSC5qfCR8sKFn4XjPbJ0yLkd3wq/Z3N9GtZeix29PT57xhM8EqMk9MoTVcWznoaWXvQx6SIRNFdJuIMAD4LRAuhL4IEYG53AM7wkTPT/0Ghirsgt5JMYIN8Lum98PaURs6oFxRGQZ2648NyP3E/wSAT6rT+llk4QFfNZS2RJAxm2hmDup2jv1RK5cnJGd4/81L6zwT4Kqkp/5i7vacYLMCbmEWZ/4n8zLkotonnWKeH2/ifVgy9+wqfjqDOnrtC5yCUmbBls2vreUjEf/srLZlaJc/+jQF2qBL594vk3nhct/KeVr9q23wPmiV17Hy8NoXKCu+J5Q+o1jUa1P4PepjK4WyiygqItp2mCJ7t3Xmc3Y4Jq6IUSOLQlgsAKonJrmMXxm7dIboIL6sE93zUi6LlyFyp2IEmBnj3frrcwAF9CVM2cMhJGFp376liL4blbX6QsTUd93ZZnVaBQ5ZELUnD7Rrio3nCxytC77pg20PUSO0Cnzc/ELoprTF7Sr1gHFIxFVZseA4ZA/XzDTR3af9qi8fY2vJpp3N4F90JE6wGTtbtIhckTWwx8ESrXlGQ37BekAVmXUER5OKY9WE8k0zLsi0l6i3IIjCI0mAuFouKo4G9Jncb9Mp9F3UdHxuLUJJ0e10+DB7LHUoMwZ1J92Q6AzoI6XXYCmSjypeWGeK4O6+b/I0iGmG8Ft6pd7xKHbCGK55u+E+6wjuOvqmc528Idn9X2AvbEjiC0wvHmNg9td/ekICCmbWoRI/M2TDE7kcc6WpgkegdB3s/iKJDoBcPdhwgEl4Ho+ySVYlIVkV3KU1ORl9x0HwMIiJyvOZ0ul9CNIzR0ExTTm8aYmUguRb4jrWy+n/xFO1TFHKokzP+yNepNqUsM79kqgOcTQP1P3CfOf+lLaGA1UerXNs3quCiCVdJ4gGCgwrxFtrMZDY1HWeYzVSAuyD09xu5iVa3eadoAOQu6Kv7AQLbEg32ArvQ8Hg0yt2eqj66P72Ak1zpGS4cAYi0iC2hbWjWjDiKP38Ll2BfeTvbhwB/H7p3hd0hznSkJsEqIrt8/+sTOPGw7RJgcBpDEigBZQzLY4ZmJi2gr0AHPTWGGRVp/Z3gWVlspEqhMGG7pGC9yZB5o/AbpXyvVxFfzoHsLW3DxLBC/QlAMG0w0zzVIfZkzFmuEl4Zt8BDkOWzR3y/hFVTLvc9bA+iGrWK0udV70RTlp9jZpEmv1szTbB1roxGL72AoWYib6/MY= 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)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:22.5174 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca6b9fbb-cfd3-44ff-b40a-08dce1573fa2 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: BL02EPF0002992E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7885 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Use our existing TSO stats, which count enqueued TSO TXes. Users may expect them to count completions, as tx-packets and tx-bytes do; however, these are the counters we have, and the qstats documentation doesn't actually specify. Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/efx.c | 16 ++++++++++++++++ drivers/net/ethernet/sfc/net_driver.h | 4 ++++ drivers/net/ethernet/sfc/tx_common.c | 2 ++ 3 files changed, 22 insertions(+) diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index b0ea4ca82cd8..68ddb28d3141 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -654,11 +654,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->bytes = 0; + stats->hw_gso_packets = 0; + stats->hw_gso_wire_packets = 0; efx_for_each_channel_tx_queue(tx_queue, channel) { stats->packets += tx_queue->complete_packets - tx_queue->old_complete_packets; stats->bytes += tx_queue->complete_bytes - tx_queue->old_complete_bytes; + /* Note that, unlike stats->packets and stats->bytes, + * these count TXes enqueued, rather than completed, + * which may not be what users expect. + */ + 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; } } @@ -676,6 +686,8 @@ static void efx_get_base_stats(struct net_device *net_dev, rx->hw_drop_overruns = 0; tx->packets = 0; tx->bytes = 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. @@ -697,9 +709,13 @@ static void efx_get_base_stats(struct net_device *net_dev, net_dev->real_num_tx_queues) { tx->packets += tx_queue->complete_packets; tx->bytes += tx_queue->complete_bytes; + tx->hw_gso_packets += tx_queue->tso_bursts; + tx->hw_gso_wire_packets += tx_queue->tso_packets; } else { tx->packets += tx_queue->old_complete_packets; tx->bytes += tx_queue->old_complete_bytes; + tx->hw_gso_packets += tx_queue->old_tso_bursts; + tx->hw_gso_wire_packets += tx_queue->old_tso_packets; } /* Include XDP TX in device-wide stats */ tx->packets += tx_queue->complete_xdp_packets; diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index f6632f8185b2..4ca48db3e168 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -197,6 +197,8 @@ struct efx_tx_buffer { * efx_init_tx_queue() * @old_complete_bytes: Value of @complete_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() * @read_count: Current read pointer. * This is the number of buffers that have been removed from both rings. * @old_write_count: The value of @write_count when last checked. @@ -276,6 +278,8 @@ struct efx_tx_queue { bool xdp_tx; unsigned long old_complete_packets; unsigned long old_complete_bytes; + unsigned int old_tso_bursts; + unsigned int old_tso_packets; /* Members used mainly on the completion path */ unsigned int 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 2013a609f9be..a22a0d634ffc 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -88,6 +88,8 @@ void efx_init_tx_queue(struct efx_tx_queue *tx_queue) tx_queue->old_complete_packets = tx_queue->complete_packets; tx_queue->old_complete_bytes = tx_queue->complete_bytes; + 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 Mon Sep 30 13:52:45 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: 13816520 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2055.outbound.protection.outlook.com [40.107.237.55]) (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 012F2199FD2 for ; Mon, 30 Sep 2024 13:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704409; cv=fail; b=YC44aKGIauDv44lWXuwSU4SjEXH/j//bXU4SgzKvshDwyQDmPrl9NqKVa6+6+lFldZeqvJ2tF2jd6eWSrq8zwko316hg/Bu8CqR7KBH81dVaz2nR4Ku8E5qSyOmZewpcxcYdLck82fEgubZ9zDDarVvkTnOKrc02AFXmTF5VAqw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727704409; c=relaxed/simple; bh=c8s/UkSYgBeYUP/zUyJ/sGRGMzy+uDkEoHfD4PtSliQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IQSvYq4W6YSsbqg/aE6ii1VV19pNhuBZTgphePYFUCqF6xQUEbGowzDRkguaDrv37oHZ4talQxjfMv1ZKSGISUVmsMB7S9je8Wd1lT1hbeasr1ifcjTaYAQJDPloTaSaBkgF2c4BCC8vHF3v9GSGahC1wtjgVC7M9tr86zaTFpY= 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=EI4nIpIO; arc=fail smtp.client-ip=40.107.237.55 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="EI4nIpIO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oLauarVuumaarU/661hY140lDHfMWqHKrnK/+y5PQJ/udNAaLSX/u2t/+yQnNMeMsUKCgX7PgesZ9V9hne0Zpp1cBCU1oA5nPF9Q6LIZh3N/1C61RW9c3EIvABAFutbzDF4Gp8xBg2yXBv0WJwhXLXZ8SBDUz3vvv8+nLHVU+gZlZEwIAsON4wvZlY4vGSIuAixrZnrCky7P4IWyHLGP3D3M1X9jcPqGvBohpIBQbmFqYceTfSyYeV4fmYwhwyx4rPCLyoCHd4nz7xIbwerAlG33olo2KYCpxtQiYPLSZVULYel25G7XRJ6Fsx8EG8TCqlEpXOToklkEXkiSZcgVVw== 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=X4IYNfrc0R076S/IYR0vqDcrJwEjrHHFjbncDZPA6W4=; b=ZUZfbeVqYXsN0uhtaSCqdf9HcgaMKQhZAW3ney9U16XF32hMGWaf6+6ug4c84QfwODNQLjTAOXiFXjuFDCNCt5OZk1TMskCudtBZhWvydDPQmNDXLXWj3uMfMe3a3oPQnvzw7+tnj1GNReJUJnozDafxMDATRbb3iCHmkQWDzWCzEbtw24XzaK5OIvE/3gzSZPoSrGxTkXE1MN5g3EUSa6cdD7WbkfIT4Uc4UCmolm47KrFsagFWirZEXOhzvKNZRomH0hXL1WJSIMxmw9Xez2HRUoIb3DnnBJpKQNq/XEEQnqjd/fKfJkaPFD+WIkp28x1kntwjas7sx7rOf7eMew== 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=X4IYNfrc0R076S/IYR0vqDcrJwEjrHHFjbncDZPA6W4=; b=EI4nIpIOp3OHoV5kFDPVgSIYgQw3W2CXAN/SG0jFPvl0Xn3iihxKHPtwBSri0Mq8kFk2G2ZQVP+xCNJcIQa2GDxwDGKfrBXJQ9EozTfEGjeXQguXiWGks5lo2ZVjSR0VPWA66OHXLUBIouOziOZNO2WBpwASRd1QuKKt3M/tbak= Received: from MN2PR07CA0005.namprd07.prod.outlook.com (2603:10b6:208:1a0::15) by PH0PR12MB5630.namprd12.prod.outlook.com (2603:10b6:510:146::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.22; Mon, 30 Sep 2024 13:53:24 +0000 Received: from BL02EPF0002992E.namprd02.prod.outlook.com (2603:10b6:208:1a0:cafe::85) by MN2PR07CA0005.outlook.office365.com (2603:10b6:208:1a0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27 via Frontend Transport; Mon, 30 Sep 2024 13:53:23 +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 BL02EPF0002992E.mail.protection.outlook.com (10.167.249.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Mon, 30 Sep 2024 13:53:23 +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; Mon, 30 Sep 2024 08:53: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; Mon, 30 Sep 2024 08:53:22 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [PATCH v4 net-next 7/7] sfc: add per-queue RX bytes stats Date: Mon, 30 Sep 2024 14:52:45 +0100 Message-ID: <49153e93bb07d01e81447be655007e3a8d4da81d.1727703521.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: BL02EPF0002992E:EE_|PH0PR12MB5630:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b30580c-6cfc-4b5c-708b-08dce1574061 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: iBsURwrr+oDtm6gc4vl/l8LAvyvhGMR1gnt7QjEs8zRCf4IcEEOaGWINgorPbQxQZqwCGopRu+gwSQSeriY9HqoR9cJ48+XBrJLNQTpDwCwPoRki3q8yQ5f6e7pjxX+0iJC796fpDxefljklK2P9u21dh/JFC9M4FNP7imuQddxMUSUxrxa6UUXr2sCe4Fag/vrpB7U10ujF2I8oqHs/cVbGwys0ySDPO9NFbaYhGBXIXE/iSxnkVQIBaucyiyllWO0/ag0+2lBHhmzu4sguCVugRpcGLwvyFRnXuXnGJxLLEaLwmfH9m+RuAkNAfjIA/miitOj/7XixLIYilop4/5y/c1UUmuZbcmxBKwTIp9FfqtmaWSMl2jbhdTvrNNn1635mWXkhLXX71t/5bXPP8AzCljgtMxLQ9G1hAyvHtukBtHmLQHzvbjOhUkH+bbu+ZeG4ocxRwjYOD0ocCbgZVSrl5xBSdT8WFQfS0Gi0uEXBcES9ynAr5jm2ib92/cgeOQU/iUx3g+XyscJm11Q3hYdJmUmh65RSz01ZZIz4TEkNb3XgkE2duUAnERhLOdH7nxlSLWnBBqrS28EBYggLwlpF7/6bdv9Vd6qJ9tStTrFhHHn5Y2fLPM5ljEDV1es0oo/VMbiL1zAZahJWVB7jFsPAY8qUdsKDWkTBWqtVDZFhHTnbaWkNjWBrfE1WVo274/F1FrxeRJTtKCa1H5p+hMkFvNCgLKMA4zmeyUK9vKcmHqAH4KgZTvRdvbbPkBz2bJ/4n8va0t8dgVaN1XnmaK45bj7V5ATCPFRXHP6IhLEZsyTPrF4RdkqWoMzCkkcyYriAP3aDAtCmVcgnRwn0h4CPIc9NhOSbPfu1VSTL99N54sz7e25Y2ktpFzBOG2diA/ikqRXWNC93kEpo9EkVDYhoSMXhMjytC4+o5Q79ED/x1euXRKXo02PPyjT46gt+078Q42Fie+O4Q4PCn1CYvYSGI8wZ23MJrTeoq9mpQi8QpW6/PQ3elRwdlO2pugXaxhM89OlrOc8L7OJ5cUV/zZGpsMYDoV1k5FyXdytGIY6W0cgF+yB264jsJGQ/MSkRNYjkh40lRxc4G9OMoU7oHpj0ALlMUa8mRJs5rOk3yPvKbH/J60DpELhN4KE5h9KZW0SeJSi1bMBFubGsIOzoAHI/4I+pgKsaRknoQOC5fn4pHqkG0tRBPLl0Muu0RO+o4YKkc8JmcZL0a/RSIaiZ0rMxD+KhZkz4qHXXT/fZflKkVR5OmAUER+Cd/CQyH5PdiX8UzsU2hRpIdBjVQ54bmJt1DQt3FgnW06Yq4kUXeSOE5tVbJ3N8+nUlw/l/bE57boC7lpW8+sjIUbC+jE/YoMyxx+/v+drexNOKT8PRW9+NGFVZ0pLy0cArQB50VJPFgD5aGx4Pyv9d1ZLbVZQlGFPowqlQFBEQncr5OKzBD5BHQcIuJGPSkMmu7ild3cpg 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)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:53:23.7674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b30580c-6cfc-4b5c-708b-08dce1574061 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: BL02EPF0002992E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5630 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 rx_packets stat. Reviewed-by: Jacob Keller Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef100_rx.c | 1 + drivers/net/ethernet/sfc/efx.c | 4 ++++ drivers/net/ethernet/sfc/net_driver.h | 4 ++++ drivers/net/ethernet/sfc/rx.c | 1 + drivers/net/ethernet/sfc/rx_common.c | 1 + 5 files changed, 11 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/efx.c b/drivers/net/ethernet/sfc/efx.c index 68ddb28d3141..90bb7db15519 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 - @@ -682,6 +683,7 @@ 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; @@ -696,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; } diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 4ca48db3e168..b54662d32f55 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -400,7 +400,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?. */ @@ -437,7 +439,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;