From patchwork Wed Sep 18 16:14:23 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: 13806999 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2040.outbound.protection.outlook.com [40.107.95.40]) (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 647B515A8 for ; Wed, 18 Sep 2024 16:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676281; cv=fail; b=Oezja3Yg1ctf/nD30Xc0WF2p/h/cn7qNem3p0Ak8Fa6IAnzS1C18a2BEsYZ/Qo69KZpSyE+TJgIoKRb+scbsQD3o+Ha3QkplbnCp3uBXS22l5A0IQR1YVpwn05QKWZWS+ujHj9h6TR/rlMEZgwmTGla00ulrNWwVIkYIFcy3L/8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676281; c=relaxed/simple; bh=X2BfUyal9bJX88ry6rtprIFduubuwovJQD6j/b+Sh6g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LKtmC4jNzRIdwheYjCk9v55cTxDdBui5+Qi3OnN4WV+FIpuVQOtuX3/bAOeRUzetMueMWeBQo/y88Ht3Oo6g6c0KmLHf5lYcKbUM6Hl66+1lvrL10tjV6hgxdan1Iny0NkP3W+Og7QKUYnXANaiJOAfqEEFGy1dzS61CdGKqly4= 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=wflalkOJ; arc=fail smtp.client-ip=40.107.95.40 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="wflalkOJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p/BF8DbdKuKE+FjBr+oBgRFDurn/4WRA2MGRusIZHtjfqzFaKh+HK+nDtDkIoGM0Ysr2gTatDkXbb3Mt9IKVZQrBau+FVO4I6GYdfqM8sflrZJbS4XCkv1aGpZ9H01i/F12htjiBuOP/seS5jOkFzKhjrXOdvmrZdpCiN5Yg42jXptxZQlJ0o+OOSIDWQ2AsXXk69cKChJNpN6uZ5Wg1NwrkUyhufCXpwZtcagsiJNIoyMETQw1amYP9Mj4C05EkkM5RnQINtR1LATXUe7seqNGnv6JqpggMCLA99h+96+wHcOnB4HLlNx+ssaLfZQd1sSJZZySdDEKVf5szcT7zUA== 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=r0KFnw6FL7fDAZHqiV+Gu4SKx7IrQPfE5OX9FOw99XUaZ0V3khbervWKxSZWYvxoixx6xLcVgnkYae6rn/mepYZpXNNLGNqh17jJkty/+79gZ+baLvez6CabsZzh4jy41U1niMdSByBhIQxaaD8m8sCtWQIWW/ySWPIahVReQctTyAwChnE16RWnSYs9CCd3evdcgEpyYTw5vDi21uJrT0rr6gHSb8fW4+YadRu7irVO9ILGMc95SmlRQSFysGPF3cpXSFATOwlFEarX5yne7wJsVHCjQhISNpj1UpteujKNPtEr1vZW3wGa5qy7IpdO9khc8zCOUjdOtL+EdZTlvA== 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=wflalkOJ2ReFVt8UR0vKpPdQX9FhJp66drpYifuQKfZNeVQdwVuNsibvXLmFXNI4wAMjgthnTkgNyALmhhcp4XLXunxfOpliNSQFp3xZXS9pXbTqVWjofDN5K4nEFTF5pL8aVjrYzaYsExLOrwt28W4ZG3f1CKs687E0S84c3hk= Received: from MW4PR04CA0276.namprd04.prod.outlook.com (2603:10b6:303:89::11) by IA1PR12MB7591.namprd12.prod.outlook.com (2603:10b6:208:429::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Wed, 18 Sep 2024 16:17:56 +0000 Received: from CO1PEPF000044FA.namprd21.prod.outlook.com (2603:10b6:303:89:cafe::ec) by MW4PR04CA0276.outlook.office365.com (2603:10b6:303:89::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 16:17:56 +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 CO1PEPF000044FA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 16:17:56 +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; Wed, 18 Sep 2024 11:17:54 -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; Wed, 18 Sep 2024 11:17:53 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 1/7] sfc: remove obsolete counters from struct efx_channel Date: Wed, 18 Sep 2024 17:14:23 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FA:EE_|IA1PR12MB7591:EE_ X-MS-Office365-Filtering-Correlation-Id: 55ed86df-4243-4dae-91f1-08dcd7fd74cb 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: pQGsMeK5xLkR4MxOawVYcqTaf1lGcZg+9CBhFWcvwb2VwSl99jq4uJ5ktBaFnoEd/sN3QuF1tCd2Dku+ufe4AiiNzZtnQU0BtO1mV1WpOHkCUpy+MQNsYllvcrbz+mGozaqWTwFef2aWpJI0rTDmd5g0Tj9G7Q34uL9Pc4sfITAbRsk6v27ExkxOt0t2p5tDZBErCy7st8iiNsvj3NZZV5142VmFHVsAp/9VPHdJ0cIARrZuYmpssE276g9faBd+OHPG89oPcr7Bz9XaPQbuEtCrfG/hPtMmkn8t36TaLU2RlDePNpzKFZihohndaSNOswR8vbEJEltCJb7uIY6t7XB3j68NqqHgcJXWAMUXxJI2+Gqg8A/KuCQjWXOQrp7OKa+KUVvB/SvAhzErqXyrokwKLhh4Xb8ptTJuJBp47eEQRwBYhqbC82707Qp9AnZOA4+Py1rjmJWHzwZl+0B1WfCGd9oZCrLffC5gaY4yJYQJ75bw49uq7uaEM9s3z1px3pnj8JVDTfhz1qQvlJO4LXfy4RMQy6pnxjzMuSkf1B85HBfG6U6SSAD+5GcoPVCRQznWicv85OlZWBfhfQ+ExOb1NUia56TrX55/t3EE9gpuFryExRWWzR+uPOso68akdzaLYgRLick5puc/2OckXah3UwjE/tC1XR776XHF0cBjTPMaIzafT70wbhVJf7tX4PUQrjbARimAQ311CqQQQFqBskv6dFHs4FqtN5XIGcHyNteLGODLpC0R4hSuyM1G/FtELa6PoSXF65aQbYqx5x48n3qX8Da/bUdAMPLH6GzxUfiT+E+WyYOsoNopTT8qHgGTPFZ+Ho85c2jewr36ly1Iigoza1P3q+DVdFwnJjhdKe/i6tL85opY3dx6/TVnvj1GeHd/rsPBKGUXc1hdxS+sK//hrxgDqsJ4UQl1KJ7pCnIChuiTsc6g2wdU+hYNvsVNUM9ypwdH630ERPQNAfJGkmTB7voruW13ycZR+uiN1zth3fbsAbErctnGIIv0tFBhrqWSgSQvP3Wc6rSd+ekJhfDhNMrz0IbzPv1JXRyTywU/ebW1BvC8SPSGhSceEuwxLPkK1YL+1XWauXQhzQX2c3WBmhF9ACDl0PT1loYVDQHEyzUv0uSxTWHTOdOY2FQD6gTAa+svndZci7Yz1Gg5uNMRYs3WW9qjkOMt5IW0+dsfJrM9OiuB5ss2T2ySj4SF+PVeIUNu7EcJjdZjk1bMnQ4kkSWaM5uP9Py/BXtTAuTWDocrCbth9iYcqwe/qzXQYa3Oe5ie/s4Img2eiOuNOznloosATDeUMN6iDHhSJeuYzPzy6KG+fqnzz/HJ47AU6M2xw0Osn0HA/Nm2qPQPSYnA1IPvazg5JC6F3qA= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 16:17:56.4401 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55ed86df-4243-4dae-91f1-08dcd7fd74cb 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: CO1PEPF000044FA.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7591 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 Wed Sep 18 16:14:24 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: 13807001 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060.outbound.protection.outlook.com [40.107.237.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26D4B139D05 for ; Wed, 18 Sep 2024 16:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676283; cv=fail; b=RnmocIpjZDWCqTvx9Be20rJAXyBdp9OBpoSMIzlBZaC8uvnVcvzIoAcywPKxlEkm4b4E+8WjMwKNT9PYIijsQGnAHnxfPDHlm5xLKh8CTM7gZDlrqUAGMA0k3HiLDZSmNRjFKTRcLWx5yTDgLxx7gpUpZJBjcfHMTt+cX8kio5M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676283; c=relaxed/simple; bh=Gf/1smqKic0fiAp+2C7CYv7gGvmcwUFshob5EwldZPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qZ2WGLtva6XnOjvV34KnTcLgf49/iEygdF9xPyd3WZlLdBMDrdbEgQNkpa2a3CWYg9Eb57hpqRlgWrqwJwqwyPQYXQrwadpbZHAXzy/n0eIZrMUELufcyLnICpu74ajikNg3UXFoK6yT2UTDULgLN8FE2s+0Hp+4Y/hzKFu7wXQ= 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=DsTb6i7A; arc=fail smtp.client-ip=40.107.237.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="DsTb6i7A" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kWzMT9S9EDRu7jXiL96v0Cz4rFsSo9OuqJdzhLSaXy8vDpkx/gDmJVZvX+0FqIEgj6rmOuxkh76zpSVcFMYWFB0WZQs2jyPqdzL3jBcLPEGtEVY6jjKoZNJIaUGVmja7Edw6R+l2AXjYMKdBvPqaROuSYgfRo3kqYK9NPBdoEYjIRNhw5ak7cAb/OXKMmaJKSKQSbkQDy127YO6sBpvTUj5/UipEmt72c36SNA5rt4046p4uI1McUJgiHBpoENihOpxH4KkiXI6FNPOBA872XwbKBF81ElCHpZ76QhP1hDAdG9Yid23uv5wIQVLwVh25MY3pStoWkLnXAO0+ga9t5w== 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=p6ELSPyLHdCELMP+Dq7h+5elUVi4uwDXSh7ZISRS83NRJ5KpC55dp2XlW1k+qCzIXKoeYwzoQzw7bzbLjmrcIyT8U1dH64JVUoEo6ihSnzGqjvRSl5ACuk3rsnb3co6p/fnuTOz+oDJGt3YxcQsBKpLLbPmSITj1nlD4mPcGa/cqhpqKYf5lYaoivNbrbeXAgAtetQCTOCae7GrUpOXZzawwIEnT/rHUOzrZ94mxzENmD8rtvsRvt4dlk36viousdywqDPCAwKeeSgLroME9zHMFICf+ZFSanGjv+vKFAwH2L30N1t05Cn5yAmzqb5rQ7VhzuvS/dbSS4ZU+c9Qreg== 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=DsTb6i7AYXz9tyEg0lctu/NKn5Wy6n3//BMF9Hak1df9P2hPYsQM780Scwvwqq0RLFF/Y/LGblbTSpMgzIOITFXdnGn4023dVZgvZ16p4FwCEsFreFKYTx3L6s1ZWc6UoYszNnQUPYSkwYzDIq9ThJaEP85iJFQhKX3CbXjNrPQ= Received: from MW4PR04CA0299.namprd04.prod.outlook.com (2603:10b6:303:89::34) by DM6PR12MB4449.namprd12.prod.outlook.com (2603:10b6:5:2a5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.25; Wed, 18 Sep 2024 16:17:57 +0000 Received: from CO1PEPF000044FA.namprd21.prod.outlook.com (2603:10b6:303:89:cafe::a5) by MW4PR04CA0299.outlook.office365.com (2603:10b6:303:89::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 16:17:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000044FA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 16:17:57 +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; Wed, 18 Sep 2024 11:17:55 -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; Wed, 18 Sep 2024 11:17:54 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 2/7] sfc: implement basic per-queue stats Date: Wed, 18 Sep 2024 17:14:24 +0100 Message-ID: <20a353f5cf789bd98baa8f09a50e5f2300609a3f.1726593633.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: CO1PEPF000044FA:EE_|DM6PR12MB4449:EE_ X-MS-Office365-Filtering-Correlation-Id: e6f2b3f4-a9af-4734-ee82-08dcd7fd7549 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: Z9H1+fVjrORd5v4WSNdd0EtD6uGZ470LD3lgg8049E53C6pHdVR9UM+cSKiIDdcCHTe78X8LJ9qwIf2HgPBd9W7Aoq+mX7b/4lUlL18dZDnMOBnatPImFSWbgglE6DHJSAj2+0xYz86bAWC9O3X6A6mHTtgchIKBsWeGiXWV0dMdH4yAu5oKNLvNF0owRpqDm88LBb7FkRZb9acFqgP0k8SHWuvizJ4Ig1z7OONbIC5wd8MkvXDN7gPpci3L/wbPjNpShXKZceAE1qaMcWrZdjkSD8RN9FVIYZWNYgjV5Ipf92ds/evBysaJP70LjdgeIlXeKTz0R6W/gZ7rWqL4FLnSAzTtFxceQN9GxuQHyTfrYHtOu7HmX//5BClXE/17oC5yrn5H9vr1HJ2XQKlwyvphMtUEuOtqUzUK0QXp4ZwJwA56OSUPtc53JjfUiLZt5UvQyYwTnpGmSi4wXRg2RPZOCUud/6aJDjhXLCxX5ZShkz33jTpcpsgJcgFLnbEwkJjhgzHK8VcApoHjpsx0fvfh0ng3XO/isrX5TUXNqjrcAUPO0Fn9SU8T/efK2S0w1Re8JzxYxpd+4i2NybNSGAkEgaxQhNPWJ6Fi+any8KOlxxTiHQdYfUP2614zxWzaJyVOdf24FYjU0vus2TTHdv0tAkiY1eCtIVhnOJ6R9lZO0oirMSPhtM6aPrvb7Ys4U3Z1nNhqJqlQkDA30YKZe32HMu9x71VnVQyWZ0qEBaqfYa/f4JR5q51lmGNNlWvkS4BnEbbKDmiZefBVOHpeFDDPGqFFuSTBV22xRgHTi+4AEteaQCwzSV68thqWMuQo/aV11OmFkfEcXo2JRhOzQQGpYJzJZGhGEVRR5BFRdhbWgUF8SGA1LBsi+TB79LNAcJsyaVAWOavTqR67pHTFg6iSidjl4yZS5QXpG9DWVbAAwGnbVwZ/VlHMLzP3rRr/wn1kvknunr8aDMsXm4SgltynV9+x+IAYKa1kgP/fJuH1s+WRvw4ZMrokPAa0FEoTPRo3DTKdpUaw0u1sNqpJzsztMTf7P1+AXoV+bKDFLV30/HcLUgHezqFeIxJGAnkfBOqQAbEOD+yRI5MCQ1g5lsfTPCaq/Y5Th2OLVwFii79RLmb72X2wTxB5YbK++cyqSGNhsS3vadSiLXp1PRKwO+pIbMmk+hPWrCNGNnrLaHjw8w7Nrv4tPSMvInebstoOGVPtQVTSDYYoBgOyCHViYiyqLEbPQldk0R2G4afPlwqT7HGVPc0pLjOEK2gRSD62eepb0sVrvgGvPGOv0Wg5R6j7ltMe46joIvNObqaEsens3Sp4kTG+/Ipj+AMthmQqYtNsWfzx+sjh1lFliET6Bk+v5jwIBD+rAHj6ycnfBgJEtuszKWDl++jT27mmACiUvNj15Vnx7AFbzmRgB41oB/JY++DUOWDcEbsLon5RjpfFSx1tAbnAYwcKunKxv1Nj X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 16:17:57.2682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6f2b3f4-a9af-4734-ee82-08dcd7fd7549 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: CO1PEPF000044FA.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4449 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 --- 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 Wed Sep 18 16:14:25 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: 13807002 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2045.outbound.protection.outlook.com [40.107.93.45]) (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 820601C9859 for ; Wed, 18 Sep 2024 16:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676284; cv=fail; b=RIEsv0MQKApjHCDUJKQgCDBqqMzX1BlyLMiIIVgWwLI93Br9alBEKSxI0eVvopa/DCOIn7UVNqVYh7B4MCt/OQxfNkKsCSICyAMm3Hk3VlsfjJCdzDaYiIcWkjo3g3vBBDJ0lzR8OOYcoc3V3qCbyOW+6eNhyFzvBaX8PE3O1Ds= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676284; c=relaxed/simple; bh=Sv2mycHhzFpVHsrctE7MCekDFFjNnnCL3dK4OGEkgkQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TgkQmBkhfpWW5ekwxy5QbivYzMCdtmFDgaS/GmbOkHOGJr4v4c/yw6fBH3DRSCIu6juf5x2LQ6+5ky5Mrf/6ZrT2yUtqh1wZNF6REGzE9PJm669IHoheK3Gggc54i+AfvUd+jOjrF7N8uxjGk9PbAz9kX3NHoZucRWZMJqE55YQ= 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=udLGlRPH; arc=fail smtp.client-ip=40.107.93.45 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="udLGlRPH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oy6MTSKZb7uGAj0o3/t1j0sQVLeDVpEOekRVB7B7HkS0djNqUwjgZQFhQsVPucOtqX5z1nhuPiVwA5AQKpjQp+Dns117+l4lRPAIbfzBzPuu3T4nQECXPP6ex6zVLcQye6lJO3NReR34OO9x0Nr7YQ1W6X9iQ6pMAZ3X13rxvsgCvQ08boZ6zMBhmyQUu2QpHYQLoAw5WwU02tPpVH7PfCa/igYZTulkPtrjllZu15F0nUjHDmFGzjIJbV6F9AwmGnVEN8KiDL6NEXoQU8iR7ATf4UkNFkaTi2f22j40yhGVjxvGSM9d12FejqrcxJ3PnV10dbL2ifnJtlUp4qdAXQ== 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=LOiwSqcpyRNKok/pmwpuBc0GHa80UgXzY9toff/8D9U0/cMYl7UHQbkN3dsTEtdEh87mDdtiVQFah9Ji5Fy3+pcQd4T4wjSXag2U6Nq+pt9dsx6NxnXnyy6uoYLK25aexjIW9C9M0I/ShO3EZZLGlVU7I6GSgyRabiKoDGir9NFBoPtMHJ/KUuHh8/2V40v0Al4nfiBOpUyliLmaoUqeOpEiBqrdAyVUvZKwOZ45HeIHaIs1pGLJqV+/KQDi5G9kHe5qEFA8YgoHxAne3Y60l9+ANxchyboZIz1GMk7oTgkGyA0Y1JyO0e7GgZNxhPEsy9tyx0g3p4kadraAA14Mvg== 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=udLGlRPHZH8ECuBXZpqBW6hy/8gpygKu2ZPc6kVcbTlHZOF4FhV69nk4KhGG91hTIlSPwXxx/Pof+jKrpHWOh0kHiGDp4GHsTPDE7oUQ0xGJmNSRgkG5Ehy7XKbrAwPeW1ezEVmblrH2ssgwu2f7Cz9aQTv7GPSYHc0lnsmcyp4= Received: from MW4PR04CA0271.namprd04.prod.outlook.com (2603:10b6:303:89::6) by SA0PR12MB4397.namprd12.prod.outlook.com (2603:10b6:806:93::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Wed, 18 Sep 2024 16:17:58 +0000 Received: from CO1PEPF000044FA.namprd21.prod.outlook.com (2603:10b6:303:89:cafe::9d) by MW4PR04CA0271.outlook.office365.com (2603:10b6:303:89::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 16:17:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000044FA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 16:17:58 +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; Wed, 18 Sep 2024 11:17:57 -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; Wed, 18 Sep 2024 11:17:56 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 3/7] sfc: add n_rx_overlength to ethtool stats Date: Wed, 18 Sep 2024 17:14:25 +0100 Message-ID: <4f5c470b33c7dce945c2d667f3282d7863904a86.1726593633.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: CO1PEPF000044FA:EE_|SA0PR12MB4397:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f0f6e32-53b0-49c8-e782-08dcd7fd75e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: LDdMM90CnwyuQjDJqQ6F05YRReFRpi9xD8aF7jGiRQyqkiPY1vpVh9FxJ5vbRx+3iCH53yuVMuCjsFn3cIbierSaaEwpWCnLFkKds0R+5sTaSPP0gikgVbFJkZVyaUhNaDRFk1ALnD+koZ/i8wqluxdEJBF+f0pnFxoy1tIOy4h9WQFgB0zjvfWO7uQ5x1QSmig3/O5w2FHCffc3qu+ikeMsEPwlBZW3RBjEGfHtxlt3BTO+cVr8XqeAerxaruaga9f5huPCuOcacCHG/i96W712J3L+vyqk7/ZXHSYFiBSVgBJPt4DuHo4b/RlZLTwo0VOpbBEio0AGvkc5xWa8YFUAKC4cbiS1nNWwPndnjDCB30bLxvDf8/iU4f+9Bceymf63nIVZTC9BZiwwbUn4wLYy7fFobqPdemNxZRt2XnNoHM0+zZ6cF4RI1blXiOHMHS0eOXb8kOu/Zun5LD5VyJH14ACFgxBbnXK85AZn6K5jKfGdNOJAPhXNSumJPjdVblJF/MgbAyWkMuFPyZ07CxwMeg9F3jfKXbEAlruzZZ0VbZwdsIHx1Vjv5tdfjho6XcCgmWlVgo+rq0ANLQkmp12Da7IoCLW8tZVFaacCFvYL+VHy9ZEdYM2r3Yxbnths1AWXF+icNIEA0CeaISM3SW/HBFQBhBnYJRCw9qdn5q1dSnAqki9B8sOX2ng2jTY+GXEkmwN49296Q/tRo7phLeZoG0iy0/IWkP7rhXIZnicGk8PrNHi/jMChLZfI306pVpKG51EaapMpAZiKCb8mwIuWhhbov69G+fcY9DX/PADN0s80gwrdaS5Ng+2Y0uq53YPm1v0cmkV1gBtAtXuMn4/H1IUBxpxIUIhDYpegAO5sgtfJbzlLpKMPnNM8UjxVkhEY5LENFZDF2WzIm+FU2Rt/TIqJNFn87WwxS6kFEL6fD+OAMgVHqtp9miOgXq+9duwynZOH7maXDKIYUu2f3udYgSYI6rKrVFH1BMAAIVvVbW8pcp4ONahCjkK3McnZP+c8PVAFO3BJiPDOphrOrSovZobFHj+vZTzEHTibfvkggxxwOvjg97rL/ZvDM3yMRnVTv6y10pdL8ht1JAVHBkbg4HclrSrMlf2lGrPTKqBSO1InHjE58jdWw+gad9CqcBZPHg/ZTcMj8Hph5BH11LbPaemWHr2u4qlR+7eL7HQVWbLD8sDQmz9sE3DqNFt6Dp7ge6aB+Yktv3gfSYKgcbrCD8AoiaFDhyPhXRqcr8Bi/4K8AnaXutMARiqUybWVaXU1lbyO2HTMDEL1JlWPmfYkij16SnZIBnHs6KwHGWvLEDtTzE8A4XS/bu0RwX5Dx6WpVz1rHpBrrEHDUlD/jIb7HYzL+LOFCNgmrXnOOfWhCp2Y3Qr5WvywGIfxn12DzSvpvQR6VA+cbkc8lSEPDfkPQyRCZAzFz/H1//po2/WUgIV4iIXn9AS5p18fWUXM X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 16:17:58.2682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f0f6e32-53b0-49c8-e782-08dcd7fd75e4 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: CO1PEPF000044FA.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4397 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 Wed Sep 18 16:14:26 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: 13807004 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2072.outbound.protection.outlook.com [40.107.94.72]) (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 9A3E41C9878 for ; Wed, 18 Sep 2024 16:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676289; cv=fail; b=JUjofXQgL7KmpWL2E8kkWWfsOnWwT4144+Wae+/WTtxbf358qws3BByeH+c/6M5UbYzFfZaMeKUrzWQV7BipCb1oCz7ahJG8gVwGA3Kdsc+9vHSoIDVvUE05G6CHbfFHdTU7rreyctMs8ngVBErSif1/pY10/m10Fjl8aVteIV4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676289; c=relaxed/simple; bh=pPWTYDmixPhRLCHcZ9rpS3Wp2A71AXolnz/p6VSl3NI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ESxdwotVAFa4yxPqq/T5Z+O+mIjHz4B9ArgJacB4g92zm8RoIOY9uxvC3ZLVVh22nFs5+Cx0eyoGfpcbTjy9o3KJmfH2OmZnpWrPT/TFGlKhQhHluTMO1N9Fd14ej/B6P56VwOTse+x2rjVWO0Kxp9hbnLEIvXs2ZmnXNGjM3PQ= 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=FfO991tb; arc=fail smtp.client-ip=40.107.94.72 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="FfO991tb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lpandi3I2bKnT9M1L8PJ2WNOnMzPP1xHkRtGxbgY7FVpqufcaz6zAvnxH8VxJH1pf1CsbBPfBMaWKtVTGFc7sX88yHuVfP5nyUP6vWU0cLcgr/wTrmrdTVpQGp97xnC1Sa4pha0U0FZ8tXjrOOvSo+/Bgw1n8uNzg/oukcRvyJTQeGCpqk+lu+mRi5y2n2mw6rTlWifumDvVywzpBkqdwqp7UXF6e20StC5n8rVKYXmK0gwLy6Qujw8Ftf9ZOcCO2ETtfgElHi4/WTg675xiZLHfxIrRPPV9ZnLKrNzwRq/5nImo+stNgo7+2H+PTjmoZQJyHs4JxFflxAT8LpS+uQ== 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=T5yJPMPfOtnX6pYF52Bx6KJRsNghNyBvBipEM45UPxrXFtDdaQ4t6jeMfO1OTs64VjWIb26CPFwtytLX4SxFufDGO3ulLBzQMQlCYlNntFBPjrYh50bvPKZztNTRPRMbGIzZc6D5s6CSr3vJtU5u8bB455KeOilrvwq1crSJM3YDNMuMjB44ZgCl467/G/ZNTZH6aj/KhJcfFWpRv6a2pqNgtyx5K1m3ghIBtZDKMv+pCPSgOQZ1FO5Wbi/ziuOS5KuqgWMAfWc838wEklI0vk8cp7g9uxmkANAsFXJYlocJaMU6bBYhF6LwBG/P9i+rSRZ7zA53Bh2gT67T1YjI+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=E9gwSEhRQ2tT+qiziVBTJAtitlov9TWKdhaAeJE+2YQ=; b=FfO991tbWVoQioRf8cfGrW7B339ZDokbuAtoR4Gp/q2/F15ZoiBv+TC9TwVQDMfMNzLHNhaD7NRDUaKN/DjMAlOFxk8TwItOj8c7ElSgaJsukR073XySiR8tr2Ftf9K3H8kmdEn/Am5Mr1xkqx7qA+oHCcq1cXeOgTWUTcHfC40= Received: from MW4PR03CA0122.namprd03.prod.outlook.com (2603:10b6:303:8c::7) by CYXPR12MB9428.namprd12.prod.outlook.com (2603:10b6:930:d5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.26; Wed, 18 Sep 2024 16:18:00 +0000 Received: from CO1PEPF000044FC.namprd21.prod.outlook.com (2603:10b6:303:8c:cafe::d5) by MW4PR03CA0122.outlook.office365.com (2603:10b6:303:8c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.26 via Frontend Transport; Wed, 18 Sep 2024 16:17:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000044FC.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 16:17:59 +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; Wed, 18 Sep 2024 11:17:58 -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; Wed, 18 Sep 2024 11:17:57 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 4/7] sfc: account XDP TXes in netdev base stats Date: Wed, 18 Sep 2024 17:14:26 +0100 Message-ID: <0c9c2e2b13aa82de9cedca478a8ee6e8cf22fcc6.1726593633.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: CO1PEPF000044FC:EE_|CYXPR12MB9428:EE_ X-MS-Office365-Filtering-Correlation-Id: a2853d6b-4023-4d03-225a-08dcd7fd76af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: r/TccHaHDtGPLD6HG3EUxv73LMOqrQ2aG1Ak+sFBk5msbt5Cf+hdDjPyyHAp3LhvONhS/jrKuF/biST2TPYhkzXaX/KLtFZtrSGQ+1FEl1sbaJSXS1lY352UB+/nRiQxh2mlJNdslj4P1ltFW0xMtsaWK4iacaEvxyTXhVHFKJ7vZrEn9pkoGbmqk1LYhP2Hc55RRFITqcoNEIUwsluBhyh+qSpHoxWuqKaw5kHnPrlK7NYnavS9Xgv9pKqLtJKpv2oGzKE5PUMJr7wM9oNJlYA5vwVgRwUuw70Ap48kc5QCTA5rt8iR/JRFqkxYMs9nTe7PPe5+YwzhcnZADS2ApRBoQwgRCi/2USqukXh153oiNy2iIBbQ544DnwoVxYqCQi/0bOrE1LxRz+/EWNdFEffu11a/aaMX9nRT+RgsIcrWr+oNgYgsLjKk3EkCAjKIlsAgtfpthVjwxQs5B/ullbk7nnIvQ8ipR+/CNndunLHEFskMKQbBrY6Vzt0gUaF75g1zCEu+A6f6J5fmnab6GzrgAEuD/DJSMGm3czWGcwWjUb7Z+A5EAqj6f2i1G3fpOHYZ/N68aj3QMrPmqraR2kd5fRRlfw0FHvxMYbmnpZTEqMrSin54LqycBXosvJrrTY51yzO7Cp95vEXAqnj8ZqcX4TG8XSYMQHLUUeBns2yON6tU8IWx/QWDXuNbK2ZZCw9hiURxpfMUGi6jBC8hGbWNt3RjqAh6PT8PC7RmNFjSPPrqIiuEERJzlDnFhwpL4rDm4rVdHgUDKmcgoEUKrcyEntbsatqL5ZOgmma252zzjmh4F5gDjRExdkXaY7V3bV82pqNodPKszJS082VRIAB7IHwI/KJGTIWKKGHuZVyPDk3yeYPCsQu2zTJtXywfXdrr+RQWGte5IyNpA9G32keN2FYwwucf/AwxVgG5Df/l3ELH/LIedctsvpWA0+Ly5bZpxleQS1mrkXAVtlpSjM2u2pTdICVqShuEv+Bs2OunVBxyFVSpkv2UVqDhnjFVUyUmlHCp6Cdqst1fVwd+Wkil0EG7DT1DJyg/S/mpsWKbS2Iz+cpbfF9Tkxrwa8AZB57Wkaoxvnkhfr5RLmAG5mtWNR9XrYw00I9pwIze/GYMiTlgdq6RXS9sThV1lObhFPZJ5R0ix+L8UTKlNJbyZuQvfkNwT39xxww0FnRww1rLFX0Om+ufVE+dI1bCPpEhAWdS2MqxqQMGGZHgX2IWwSUpxelSGNWMAy116U0oNoWsOEadO97iy3q8CbE8lnqxrC/PNATB8U+EVTZDukkUsJNaK53uBv4+AAz1Hp7I6zhkIPHI16NMpzMM4H3UkHI4e7EWRv+eP7GYB6ucu05VqmoOGWP61Bh8xosNNHIXZt5nYmdZ9AfqZaEVbktxseR6D2KQ8RE984DdpvKa4bUmmeOFFVQ79jG9uu2i/TaS9iZK54IPE2NuNuIHc80mUAu+ 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)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 16:17:59.6092 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2853d6b-4023-4d03-225a-08dcd7fd76af 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: CO1PEPF000044FC.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9428 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 Wed Sep 18 16:14:27 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: 13807006 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2068.outbound.protection.outlook.com [40.107.93.68]) (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 45D1E18A94F for ; Wed, 18 Sep 2024 16:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676291; cv=fail; b=i3ECwBNFE1S591dc84OLxz7yZgYsK3pDdQTEcGN3fg2cigE4/t37EY7jyH7oyiMJqEDOnkLrmTM5ivjuVLPYGaaE4pbPhsA0FgVhaHSHx3nQ/YH4c/ERTa12HINZ9KuiWRKzh3Ua4yPai4TAjHvsGKJbNxj8zlKDQYrwdY/xxn0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676291; c=relaxed/simple; bh=wg0yEJ8qRagYgQcGnFNeDtAVK2u1kSRCVY1mv2+MDAQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e+uCoLY1HWHld9SFq5MlNxLq1bo7aFSqncaf/yWLAnJWgfe70TF7tNzW14Bl3p+uXvdJ4evPMv/ynVpis4oHwsLvUVtHhb9A227uQuqFrBJzVOAaCZiJ9img4q7ilp8G58wsW+tUok8+3W9BtAv9KnzO7x4MmkZWPQ7KjnlhEys= 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=qwqnoh4g; arc=fail smtp.client-ip=40.107.93.68 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="qwqnoh4g" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=r1gpz3m+Vx+pEgqUwvMvzaEBVvRyq7kz2EqQkG71coa6fzlZnwWTgotytPPZvxOsPHSIpcMbIz2YJE0Sb9g/fXkofnAbCE5eP5XBuL/BPYer56CKmmA9cU88cN9qMAnf+lYYnvFfPbDP51kESQR7j34yP5RqPw7EcQpfRp8C1ubdbBYOs1iQ63AGgqzu3OHFg3fIc1AcCzm97hiq5vDfQfM1GyUMvYUfchOw5WxlYVcBvybnq/WkstdtFO6nR/YGBu+AP839DTaxdxv/AeOdQXYHlgPIc/xLkEP5JSFnp4cfoTJsbMfuNQ+JB49Cs+M9xQiorh/B6AjMmKE3t2WGcw== 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=H83rd+orrBATrU2Jx+8BYcYaZ1wNzzTuutAFV6QsDDfMyFEoh92OYsxKFko1FTizrklFdex+RHjd+C01Su/Ibneawiav/HVz8CfXMqiCPi5+uVC21KAMTUyH5q70TNAg/0jZb9Qsvjis/mKla3gQTn8bfV5sjB/cMDj2mLBNnUhABJPQO9KN92rxRwIrDLJEP0gYGyiOl69G0QkznJCubyDHNx/jIOKhKA8535YipkpLZPavnaDMl21GYI5u4JnrCDAZIeQaIUcaiPiMxJD0zao9PObG/g0oIvXZEqT823H03bKWxxsjsC7171dZEouafUv3Mtb5qfBP4oH5qiUfpg== 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=qwqnoh4g/8faG8CugZUK3hNpZHUGvSXJ0sFaw/6MOACmk6sOgsifgQhmfR6mo/BKfof3AKXuwjGbYuuI7JKp4bK7kjdAINnyIJZnCUTrX+0VpSVil8hDha5Z/ln6yr+crIscIa4V6fQ+VsjZkmkXOlkJO2UwYGvKS2MTD+Ar1RA= Received: from MW4PR03CA0133.namprd03.prod.outlook.com (2603:10b6:303:8c::18) by IA0PR12MB8253.namprd12.prod.outlook.com (2603:10b6:208:402::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Wed, 18 Sep 2024 16:18:03 +0000 Received: from CO1PEPF000044FC.namprd21.prod.outlook.com (2603:10b6:303:8c:cafe::ea) by MW4PR03CA0133.outlook.office365.com (2603:10b6:303:8c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 16:18:03 +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 CO1PEPF000044FC.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 16:18:02 +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; Wed, 18 Sep 2024 11:18:00 -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; Wed, 18 Sep 2024 11:17:58 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 5/7] sfc: implement per-queue rx drop and overrun stats Date: Wed, 18 Sep 2024 17:14:27 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FC:EE_|IA0PR12MB8253:EE_ X-MS-Office365-Filtering-Correlation-Id: fa4c619a-c03b-4ec6-a8e5-08dcd7fd789c 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: jxvGIr3uMnXHFah0Lgi20Syz7WjfsvA4PVpjY74JruuDjSapO2IBOtLPhTCRVVeS38nt4MzegjBU9frOxrlDXuCK8NkJ0ez0SDE0WmR+YIMFAjbAjpbL91XX4kLSw6JabGcUJq0y3TV4aUyURvjdEGdm/WTk8CyNHVkaEFP5YTisYYEJFOTNo/Lov2Q4TQNc6wa162xeVMUfDjT7dGtAqFE8TlZbb8x5LPEYVpglJ+43z86EtRGJDySKXgXdAAfzzRkWbZAYsykELH5xyzwoe2hPUlZ+qlr2o2ltQRHirVuXE5vKR5Y2qWw3VNV2DRthibChB5lfjuPBNhVe8adr6Pz4bR5BxcYYnZWSgzXJY9xHAdZe9FO+BtjgQL7zegzmkfKnlHAa8dG5r1ksg0UmTnCTEjPPuAOz5eWWRGJabR28psoNEKl9+S1GHHam86fxe17ufAxeeTOBoj5b5Y8ffQaA9gko49sPtrOX6uK1juKVLdqMjQeYcNkAdcGT9Nod/XPQOwm8jm3rM7s7+yPeG5zrY14HV/GpypuL8uMiUfEPvPrwHDRszdkmvO8SdOrgHdqANuqleqoeRDgRgWpjxPfxuOgY7FLDwKyg27LZYFDYpjZ+cOA06dbldfQjXWgi4An75J/vT/Z5uTJLOmbMsVkxuGbT6/M9hoddyofWPgiSdiIYTWWDrNZsMwCfY+FYH1buGM65NnVhIXJmk7lHPNhXHm3Ir1cY9U5MmE/bUU4GfM7bH7KyrgDAcRErXwzaQTLbsHwlMxbUAqaamT8/MDP0SMKnDimvCHY5SefghAlLnT1bSVIcWIgDhD+r32VtDtfoAzUoccMaSdpKVK3hBBcgaZCcDpp7B9BPj1PxKrLic/7UmXB3JFDjeQPyJSlcUkc3xOjlPTFkHfp8YtyLyix8zTx5xXui3AmuP+J2h8CTjY36Xl41r0EUAWrPzVDOW/4wjb7p6zHxBgDsahynhJFmUx9wYV7Gaqq1de1vQiNBfRd+SmdveVWOBD2EBtR9yCBnkKPiUgkmcDXQFo/P8caqS6baPqx9ASXd4fDBQYXR3s9ptgEu/0DxobsS7wFEzbc9PRDSrmX5XPZzIDcCOi+EeObr1mhoZ8QUFj5Fd4x/XQ3cb296t0pC/4aUi7k5YFWEEXvOyGvSUSzRFk5pRuc2lSyrc4ILXVCLYHfh7NP0az/jq79bkEBaZJR4IDIqlFL7YsLH3kchREM3zExnA4xsRHjdprzU61PS01b7NavTZ4u+03zKvITLzWKK9CqwhQ7P88+dExV9f5e3aWu+QTK47NRJz8mktzrWnnesOx51cwcRu3HAIoVoYY/Kf1iwHZm6s51qxH8pnxq68ArIdDoLDy0Oomh4Tiq5uN9X5mIWQ77LEUL0PyONONGOPkimAn2muYk4InP3LFOZ/5LCebLw+lDYJty3r6vJPbM+ZbSKcyLMVEHkFmyZEEspOnPt 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: 18 Sep 2024 16:18:02.8279 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa4c619a-c03b-4ec6-a8e5-08dcd7fd789c 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: CO1PEPF000044FC.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8253 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 Wed Sep 18 16:14:28 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: 13807003 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2067.outbound.protection.outlook.com [40.107.223.67]) (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 A8E671C9859 for ; Wed, 18 Sep 2024 16:18:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676288; cv=fail; b=elEvhTrZzJlAs/SiqJ+6+eJo9fHaBICyvN6Pwrucgjlg3bn5HvlmbXgmC3BXdT2U52H3ymF9ixU0zz+11CKL1fhNVMhAGtW/CEgRJJjZbbFAhbqmofB41R+HHGl4gZHPD6lv6G9rIZdhZX5jrrG9pu5QxkBp7nRkji0yDAuckn8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676288; c=relaxed/simple; bh=0/70hIQQICgzkO7E0pa6R7OVvuAqhL/r0D9ioGXmsZY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sShMi/Hu+kB7yqhGoO87Zrn1SLCRORucqZORq1H9JDImVa/aykWlWILUalRCCG9g3uDCjCp6l/UeETAH1siFn+mhGXFIg1P08tk8I21NMptEEf1KNTMY8jAtMcrtRJi2Nq5zbJWzKgv8XSz+4YZ/QPv8aNcPUcSI6PgrZE3mASs= 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=kMRi9IYA; arc=fail smtp.client-ip=40.107.223.67 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="kMRi9IYA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tu665OgBZNbDXYhJOsjgaEA0nXh+wC/oTTjAu2ZxTLBD/g5F2Es/ijz69Spt3uHpf4wB242CLjyy0G1epFDWEXSUvThut6MC2aPSBU/p9BtWNrqbFh9WGttBRKa59raiiiCGrx6bdPdW/ILur2N24BJdbM4KqhAUpnxs0uPXciX8L5mCRKBOwvOGbpZb87mjg9umMaK/bSh2ZoNEYa9TSo/41jOiqAHrgI4qRDa370jihFQjSCwd8kfB5p+sN7yg2WorT2BiaJkqZngtXJbtpQ2t2jFeShyGqHG8dvMbm06u6lHq/T/IRS1bOw3i1EvRM+aCtaUXGbimbp0VrHehJQ== 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=WsXkNGph9MINGPU6BXSJCCmo3OUizz3l1Y8W+5Sfj6Ob5aIy3S1W7azy8pMzIucGAWX851Ht4D+LnCmS10mglbdOOJmSCw0Hpek/8obKZQCDkY7fmhae5tI4kzmMrLIwwxaLYMJZYZACQsKdWD8Hifk8rAjCRVT23ta+pfXestKwZ+xUJktIMz8A2d9TF9dqKPZJjM9lZA67156Hs6jI0LMFRhnR6gxd/WTpRtNxk/BmB7BmCGruwVWmXcj7hrz0zQCvp71EmxeRzzTf+s+AEh4WwhcW4GZuAqRqT65pELTxBR/yGc6a1Xzv14/2V6xxpji2+NtrgFtDaxaiZXzSMQ== 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=kMRi9IYAZIM/Xeo9BP+VS3U4IUPE7kctuW2oTmD6AKGrqK/WVFPoyxBA4BJGPp3ipgMCXUM+Tw2t0Ch9y2U0mWQQJY8NI+zcW3EbMAh66i68TFUcXEbR3rLo0PaZop7/UmaIeWcq9LnvL7Tgi0xsswpaH7Ay280C/qpiSwgSpR8= Received: from MN0PR04CA0023.namprd04.prod.outlook.com (2603:10b6:208:52d::28) by BL1PR12MB5754.namprd12.prod.outlook.com (2603:10b6:208:391::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Wed, 18 Sep 2024 16:18:03 +0000 Received: from BL6PEPF0001AB73.namprd02.prod.outlook.com (2603:10b6:208:52d:cafe::91) by MN0PR04CA0023.outlook.office365.com (2603:10b6:208:52d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 16:18:03 +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 BL6PEPF0001AB73.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 16:18:03 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 18 Sep 2024 11:18:01 -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; Wed, 18 Sep 2024 11:18:01 -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; Wed, 18 Sep 2024 11:18:00 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 6/7] sfc: implement per-queue TSO (hw_gso) stats Date: Wed, 18 Sep 2024 17:14:28 +0100 Message-ID: <7f2ec1130f96c77785424565d8068e172f88eaa6.1726593633.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: BL6PEPF0001AB73:EE_|BL1PR12MB5754:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ad12e4b-c121-4836-85f9-08dcd7fd78cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: y9cMMTZzqbVtKX3NEGl/8riU/4MexygCRgBIkibSDIxZujSDBp01blPBazKyztNg1yb3hkSNhKralUm/1a0wQY2ya+y/oSM3ELtLd8lqQeP9ahQOQVZ5Ofp9k4L7IrXy7GsPOteYrNPmpXyFGb6g5+48O+QGJXnrrnGziw8vedx9ivePrS4mSCD+De3GE7Wt4HmOVRyAiKVR1YmkLyLUouKDbhZJupYeauIjNhui/MKQ2nsLaWsLfkPb6TZ+utCXoAimJ+PpBvJvLbQs6+DFB3GL0kd84CKVoOwnRyGWP9sskG+PfEnqg873vgeqw9XOTY2PY6PgpHDKUG0BsMOxSKyqfDT/qq5B3lpj2BBzs+gFcTGJxBWz1qYVKTjhqxgmLAXemTgpv12Vo/rDUfssiHs7voCxsFXgkaFkNZLi2Eh9Ptu/zWKGstTInSpbD2TcvOtTYvHzvT7yc60Avi5lm63GrEdc2JURRNK90a1//CZB5HgJA8IdgPDAvPWW/T2Nvokijufygg9rIxqCcFIDFu3bjzQyB8ANx0fBWk4VjhKY/xqzuo1FdQRKalxC1XPHlipcLrRoJUskcOBsrhyakimtmF8tj+MPL6yDD0DsZhXppQw6VoyFo/zUlNP0pqZEAxlcvXVl1nIg5Dlxkn++TnUm6JALR71B5GM23oHR6fluOYOOMSzimCpK/3DABZN449LcHpoLQU7/MghRmKrTxEbuZf0K2MwWgpUvIboZN3e7gPC+HgMkAraxGZaPK5PD93DA/iQRr4VAhkp4M5Qz9bcyWtW+DEVX1MXsQrPyjer8/J9S7yISou7FZanZ5o1KNCs6DfpgcL37mT2inT2ooGZCZD49Ovlm2OsiUoas/rsXL/DbZitXPb8b2f5cRslBpkY3IgVzL8c9qOO7CR9b0R2no0RZ5wdtoffgDl0cTWbfgHf9BsKA6bpyqrjY8RQGg/GCTC+5onoIXbsa+bmyh34e+/2it07n/9LysjpkuZf2+wnlz5HRTeR4enoGKfP7VJcpdUJjU2lHX+A+811MZlMvshq4NHSI4MHn6q9VtA2Zm4WTFdDFS+uX5T1Dm1qoqiJSpZkGtS+nn3Yxd9oyRbT5qZyrpKFX3ewNcl5SgY8QcvEce5xS2XeQzF0Om7/z9da4vSjMFcm9PNFmDJfLlF+2mE/s4mdj7CCHi/LAwhDdosgq4XJuQC7+vXNqkPlGcVkilrDhE/te/MKnXarptaG5tKOz+dRkRcWnVwNpqc2MESECDktLsjl7pQDyAwEWXT/PCYapAngtRWmCE4sahkqLZu7AoCLNjrapJXGP2TNF3r5Wbmykrx3K2L5bccY/LVrhBmKhE7VQveYEmBNvOwpTTd2RhSl0zE8o6oodqYwVN5r3dsZsK0gnU1LdyyAeSmSEy9dNZlEhe9AR9CYwrWi9sxhEij1KvNhZG5zJUT8= 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)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 16:18:03.2419 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ad12e4b-c121-4836-85f9-08dcd7fd78cd 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: BL6PEPF0001AB73.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5754 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 Wed Sep 18 16:14:29 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: 13807005 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2077.outbound.protection.outlook.com [40.107.237.77]) (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 DF6B11C9DEF for ; Wed, 18 Sep 2024 16:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676290; cv=fail; b=dVFGHlceOBzzp+AQj+EAncR6KBGJ4cYtOMvjAfSMeIN3QcpWEico7kz0YxthhGIKwW17ayyQPoarxzIk/as4w3IyJgN+bw4ogkBIDp8k24xSjJux9xPOh/SP/SyDHB9xj9ggd4JqKMbr0b7p6gYRuBhIRzqEAzukT0YHLz6vYD4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726676290; 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=DLA9r/RHeB6mI/taRZvme28hrpD8r67GDzyIoSUGTM0YyLn8B8j4FvzNZODrzvPODehwdsplEaPeV6xu7KV/KCYNYevKdIvGufrYFN6fb853SgQbP6Czvig9TXvZyba4duDqc/oYqoYvhB60Z6jQRdZI/hC4FfcCYJgt+2vD2K4= 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=HDCGNiil; arc=fail smtp.client-ip=40.107.237.77 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="HDCGNiil" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Eo+j681Xm2Lhnll6Qyqa4AD1aNvEugiMiHvHDSCTi2dMjsYtpq2xFgkuHRqGJw1F0cu3DMgsTvJpgUTUGVeWgw0RLjjD4JSXRMJucextBpkpnJsok2oAgt/ZfMRHBJXYMEuGpozmJBQ+iEau+6LmyJr9oMqDNfZI/TXmqamaNIu0RGkqxiB1hMniBiCtSBcYN26w+mYVZQ3uFepBaBc6wbZhkDVk1tBiLE6BADTZ2ePKxWLXV5oGSMMsoh09dtquOZXhfH33Md0VOHgY3Ik46ql4zBo0jhzzkJlvko/deaI5Q2SpJbI8/InD4PNMKQvOqFo31GWZ67gbg8xkTZRPfg== 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=F0O4gQ+9ircVy1BdOEc/veLZdaQyMWWVRgrR83021zN+nZ+SNoYdZqFLxRWskUtgYWgmSJaIh7zNksDRfNxtD05OwRzF1vLpHMMOhniH7DzovCnLU/u1gqqVBiQIwrQGcuk810zw3/j2uJiNc2WDLW8iol/YWMZOD1wJDy7ByPS4r6y1e5cqOyqyy9j2yk4d/VYHZxAAU34CEDOfj6Zo5xQNzrb/6rVZJXQdRBT1/nzv+OCSWPnAK3eVNsC0glH1mzlRYriUFOt4u4X+yE5P5u3EaMe2s0lzVgN7ZnBkf4vndaennUK9RuM1NptTwPZf7qeJxCK8+q1lpjgcI6xVrQ== 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=HDCGNiilo5F70g8l4kDnnhQQzgmi8Yg8a18iEHb1tY/g+g68DlgF6Iw7M36e/bptUoFYI07OQfr/5YY7to+V2TKK7w6dkZ+IitrXbX6e5fS0FaQD/fU+f/8OvQZq59mANGb4ihzhbkpt9uoZzQ3vgmaTU9ahBIKyDWvY0fidmi0= Received: from MW4P220CA0016.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::21) by SJ0PR12MB8089.namprd12.prod.outlook.com (2603:10b6:a03:4eb::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Wed, 18 Sep 2024 16:18:06 +0000 Received: from CO1PEPF000044FB.namprd21.prod.outlook.com (2603:10b6:303:115:cafe::71) by MW4P220CA0016.outlook.office365.com (2603:10b6:303:115::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 16:18:06 +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 CO1PEPF000044FB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.1 via Frontend Transport; Wed, 18 Sep 2024 16:18:05 +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; Wed, 18 Sep 2024 11:18:02 -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; Wed, 18 Sep 2024 11:18:01 -0500 From: To: , , , , CC: Edward Cree , , , Subject: [RFC PATCH v3 net-next 7/7] sfc: add per-queue RX bytes stats Date: Wed, 18 Sep 2024 17:14:29 +0100 Message-ID: <7139aaa5f83d09c5490ef593b7c8e3eb6484cce7.1726593633.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: CO1PEPF000044FB:EE_|SJ0PR12MB8089:EE_ X-MS-Office365-Filtering-Correlation-Id: 0815e7e3-53df-4942-dad4-08dcd7fd7a0b 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: su4caedANmy9i/BPmcNRNWvlzd6cs7zY9CTPdkI0a1eSrZvMSt+RO8NhyCFpMSgEOvRuPdWsKsZvJOPNNIX0JswJzTQ6mwe+7Jk+F6okN9XycFeB6wJJqytGtd2v5+wOBueTetxaNPefpW7ghUq8dEptPKoPjywFc4gjLf7FJUp2wQnKdJX29eKQ5NPGAAyvAA3qw9PSL7gVOmhswNyDFTi+qxT6w9Xis64M8WGWiIDLlYH8fOZh+aJOHkg2cE1k7b1cHS8CaN9/RSC0516pQEcUepoPAbrFSOoLGCgYDKh5OWLX+0F4MkJLwUgBfg441MuA/gTBsEdluSFO+9QtU9VpeZ9BmYOrWb5Gp2WJOJIicYD7K7dyxvRUB8AGNS8HmJmTXlvAkiYb79/UBlhvmOEn4L634vh1nsXsRq8x2fM1/peV6XkauBouc1sc4G/xjE+GaymbKsJk3liszLPajzEOpyP6iLWThhoVPCKghYIIXrI8xCgm+xAYxRfwLWau79XeEP82rycYwQP28Ea8hgikmToN7L+F/MYWLBK4q+WwmEYRR1u5ORZMQEETzv9VrISbav/212LWwxNw8m3E8G9cC44EZX0ypB2DQ3w50veN7K0fJofUv7OcNLl8r4Y6WGxmiARM+gbKTp8qGJ6NVdqWkq7gQbqmMEj+ky3YrMRW0OGZDtE708C4VU6Vc4aMDG5dIaFFlZjrIopBYxPT5FswqhKzg490t8CGibSNPFih4thsaQpdVWi1+FaczFkAgKPwu8O5hgsfUK6yzQJ31q5kwggSng53eokW+XqFuGF2F7EABVszw6AH2oClJVqu3gM/OIcb/6/GfM+Kd11ngK8c856EoqfzNbIAZuygTGb2Vx2LUeR/awqchDfPkzFWzs2FHGBFDgjZIfSTaxmm56iL526W224+xjjvpPx2zWPJWiCWaYbvvxyPpArAEV2gqJUgDLFF4Pz5dQ6XGbtilFojtlGfHgVFGlUOLuruLwPIt6wq5h1f/VK6942RUhHM0c1hQJFe8wbwj51oEx9bTHTYrNUyAVN8GZqlzv9G37QQf1NYh6bVW7H/oIjW8sco0EDM03r5iDAo33jjSTWoV09nM9UawLpLZb6UvEGhwSCAWRWOizMhvOVMQiBtM38D2nUTOY0QCmwmRTOolSqyY2+jKNIbESm5V9DRC3tXUwFyGNrBm7ujjjIwm8UUTpcxbys2maOVk8CcLy0oEBfm1qkYRymvccR0hbDXPQcXddvf2saCnwgXNbnO/xBBYGrv9XgYnyfYZPHFLtLZdox782kXzEqwIKR1rdFYbMZeePib/gv0MziZTlnIDnnQveuAB53ZfzbU1jIsii9KPpkArOo2/gifZWtLCAvEpcgGhAkWVmit6gN9h3og/RGnERT4ii3CkEnT31ZoxJj26ujUkyYmZHf8tWdgdEO8fBsz5mA6q27/ohk/pMqsVs68LQat 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: 18 Sep 2024 16:18:05.2344 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0815e7e3-53df-4942-dad4-08dcd7fd7a0b 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: CO1PEPF000044FB.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8089 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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;