From patchwork Tue May 28 14:27:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676912 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2089.outbound.protection.outlook.com [40.107.244.89]) (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 00F9116F91E for ; Tue, 28 May 2024 14:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906584; cv=fail; b=fban+5Ms/HRDaqG/tbR2SqFTqBNlKaGGBHJml+yDOSO+psf2CCBhpJ9ChDwO9ElpRzNBWEXH1miRj1YEorG2/YS6poD6eS3cGxHyZWrR6gu+vYOckue5O6pby1y2iGBR5SY8XbEJ7VHHS7uIjtOmAbkWy8hSiL+Cc4IEpRisbNk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906584; c=relaxed/simple; bh=3/sx/6c8I+1DMVRshZmhZZYHhU+DmswXIcBAwlWtS0E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YQuOn13ctqJ0u4SztWBwBvflZFwDGbL7uR4pQlLDIQMjINGxbipm5RskbFD5C0Vj7Vx71r6D6EpmW1GZ4sw3MoG/UD+hqYNOsmla8xXwnhRBf9PYje7alFm9EbOH5RjqV1475gSFqZb9gDO49YwFfnBFemtxvzoEMUbOdQGS5Oo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=aTqw1NzK; arc=fail smtp.client-ip=40.107.244.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="aTqw1NzK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKqWMK/NXXJ71V+4TRtH/rub4S9j5ei9sRD20XNrfRbbJV3vx7DwXOV3mqyVD79Z2tB4UDQaa2R6Re2lhMcoyX9JA2DE1tr6YxML8f/hG8pKeeujyychoRxaESGVkF5uiByRgLK/Rja7jZwMdIfWWH2217PcK0Z6wbiKqQSSDvyL4CAqackwgteYit58NfFL3rcN+AcyAKsQbzzq8lv7q/Ds94zNSFSRuBOXUNVFxFi2s8PIsA3/EZGTW3KmZ81nFGSJ1fnPXG7Y8ia2TuqopGX/5H/RfIPnAce+zW5krqOPYhizPTeBNrpFKdYByQaNEyuglW0sJIpUJDyqcx2gGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BiypAWCJz74EwmD9D2cvMYEI7D9d/OYSBqbpYk/rGKw=; b=PKwkWAHyBi0t9aG2mqjK1L4ta5hGCeQOynikGY2LVzkMjZmmaX7DwAZ67IH7sXl3F2RosYo+IM+/FiTswXgBerxR1Wbl0DDGCqtanKjyrAtW2vLB7vrCYh73Q3kc6VTAVQkFqhmETKCvzGtvmnmpxjnrefRjsSFVHK1yKgGLLQ7p4sszRYv8R2LpWwV1LOWi0ZZObmcDik3MR0OEW+UhlRl8PYd0HR6jV3IkUEnwbwZ8WwV5qMzr1gGm0TMom4iVzmcUqU4be9MG5uGph0COAJsgh2YyTZwxMkbri+zPEQPIQKIKhA+BbpV+rkrJUB5OFT4YbRFF8UAtMtgnds4WUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BiypAWCJz74EwmD9D2cvMYEI7D9d/OYSBqbpYk/rGKw=; b=aTqw1NzKMouZsbThbr4HXrDrDewRSFGDdUabeQKJdsku/GSLBeAOPkwauOtW8b8StSvWKugkhk9LND9Y7ftM1tCvHEsSVrGAAOZMbpZyuAA7N6D+s2MPAfyHD4S2LDOnuXuxJFmgt5RzMnQ0kRWuULv3Ue0Cqqf0sn9hsPjAHWP6RnX6HCtDRdOpXlhwaSj3GCz6kMuEkcYEzcDcLc0GKve3rsXNlmNfj1bC9mio9ZRNi/QzjqqAYTE0SE2LGUWOXIhD7FD+4muVya6/rhKua5qBcMWqfS9YAjkjZirWfZvY96P1zkt9y0JZNT3S+/hfxj3HRZanu2+caME2TGzUGw== Received: from PH1PEPF0001330F.namprd07.prod.outlook.com (2603:10b6:518:1::a) by MW4PR12MB6897.namprd12.prod.outlook.com (2603:10b6:303:20a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Tue, 28 May 2024 14:29:36 +0000 Received: from SN1PEPF0002BA4D.namprd03.prod.outlook.com (2a01:111:f403:f90c::) by PH1PEPF0001330F.outlook.office365.com (2603:1036:903:47::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.31 via Frontend Transport; Tue, 28 May 2024 14:29:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SN1PEPF0002BA4D.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:35 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:00 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:00 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:28:58 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Tariq Toukan Subject: [PATCH net-next 01/15] net/mlx5e: SHAMPO, Use net_prefetch API Date: Tue, 28 May 2024 17:27:53 +0300 Message-ID: <20240528142807.903965-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4D:EE_|MW4PR12MB6897:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f203bb3-096d-4888-bc42-08dc7f229921 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: D3wbNZbNdsyFDD1WyhLDtbtSjKQmbovhj6A+GGOOBdinmqXvqRJ5KHVXJRiWsgAXiHik4Iil16jXvso3pUtAfuTK7VMW1Ksy2QDE+kdWa1DHNxC7jCSGK+M8G4TTIJ+Vx9HbzuSjd1w/Kmcl9uSnC0EP4KvCy6ZFf7WYLykadyL3pRCdSoCaW6WkUwKTfUWmRr25qLfSYVg1gcpegHxMZWJI5oaUmPOH1/yFd1XjKNhqp7TqvJTBWIbgw+YwO/DbePivWKYfZMKgrkxeOyt0stoZl5td2zq4LWJCksgZXCe5Gowc39q0l1vTLs9a92BNBv8mK3UcPTFrMo4xpPZxOAuUjRQFkR4k3GwES769+oEaqrMjrX0W3hXHjdvOZAmlHwRL8wj2n6jtjq3WgBRIeT4cyTI1rlmqQ4eZdSpO2Q8GOwuK/Mm60u18yO5VehENzPFLYfjHOXokN6OnLWkTsUtdkDemHMYvAPuamMd67+ObZ875OsV91Uzc1ITLrpjXvzVFu6kMazOIGyObg3T+YdVjrFZir7aKEjvii91xliNN2jeY2Gg3lytkjMH7af1O7t4+nM3Jp6agr3x9r+7oYQ9B6Cn6VC/QxtNsPV/quHLW+C1yECpkb7WmTZKB6MJspOfetFTosxNibi0J8H8LxRwS6RA2R+gNr7a+eDH7TBy6GTcXULcwoVZZuWMzRE7Aq7OIDrfN+wda71BMmIaXAVj7+4qaHkm7wI4+UFNlTe+ETJ66JeNKL6eATz+3Mosv+RpeL67FLKZcvxslDQRldjEir3PIPvpnLv7RybCoack6aNU8JsT1XMwO2if5N6F+YpIUrDqu9e2Gmr7EKgoRpLqEEH34fprqbFH6BRWPxq/yDIS3tDPZG+hA1RgHdoZCZ86jHUpEA+NX32S3kbzuTnneBjiBrYL3owtuVxNDQY9pYlQkBUm1q2JatVrMVnnzD8LUdAXGXR3ij8IDAaOgtWRs1PUeBJsvd3y3oUHoe+5Mj5LEvelukqdn369jzj1Xc/f3FN+yY98hghFxx1QbpYjy90le0jafOA6KpjuHkZp2pdvNgzQ9ujz7Ah0negxaNri4bFhXoQ+BrV1+sMGGdepzgncT+Jp9OVom1V/G0lqsrY+Dz4/c6KCV2VG2L9dpcVwYDlnNGt3NGMYRQNjAzLEwTt4mqhCrJvYwycoaMhuvecnbi/RF5qaILA2zspdDKa1O1zk4IDyqyQy0zM+DjHl4FS82DJApCgd09nzZ7N6ShVbGBlzjhcVPjll2EkjLZyQGdeDqiTp6MKEiq9Xpjb8ksXCzHMr7/XvxWResc1Vhe8Uai3do4T8e5qo/5Q0arwwdv5q9BqpWuyH+G0qE7rMIQqPq0XodLnu4SMeWj2k= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:35.3102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f203bb3-096d-4888-bc42-08dc7f229921 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6897 X-Patchwork-Delegate: kuba@kernel.org Let the SHAMPO functions use the net-specific prefetch API, similar to all other usages. Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index b5333da20e8a..369d101bf03c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2212,8 +2212,8 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, if (likely(frag_size <= BIT(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE))) { /* build SKB around header */ dma_sync_single_range_for_cpu(rq->pdev, head->addr, 0, frag_size, rq->buff.map_dir); - prefetchw(hdr); - prefetch(data); + net_prefetchw(hdr); + net_prefetch(data); skb = mlx5e_build_linear_skb(rq, hdr, frag_size, rx_headroom, head_size, 0); if (unlikely(!skb)) @@ -2230,7 +2230,7 @@ mlx5e_skb_from_cqe_shampo(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi, return NULL; } - prefetchw(skb->data); + net_prefetchw(skb->data); mlx5e_copy_skb_header(rq, skb, head->frag_page->page, head->addr, head_offset + rx_headroom, rx_headroom, head_size); From patchwork Tue May 28 14:27:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676908 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2077.outbound.protection.outlook.com [40.107.92.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 2A39816F8E9 for ; Tue, 28 May 2024 14:29:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906572; cv=fail; b=AiD69Fat2H5Pogz7UcvwngjpslRnwua1huZFvzx2IwuC+qIzGoFN5dQFhNwjxcrAXpIokud1evTZfkKWhJdlNLJIHd+tBeiT0HemR3/7h/eJCkycmLt0AG0h/J0XfwP22UTk14HTRlNpwg4RKn+fI6ktoIaYwYpBRYeYy5oyyps= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906572; c=relaxed/simple; bh=K7DKs3MaTC+8JT5Wk/6rvHFuZDGHOxwkfCriWP4dbY0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Vu7qa5uNnwLGiEr59Mtbe8nzBKeT+PI/wAhurd4C37MXhTBfF3LA0FxAscLF5aa8NFTsTJJ9pBZvwNTs8Rm+PAUwTdQRWLYsWKEQn9i0xqEcUaMJHCzNML/EZg4aggbXVwn82NwOExSqWOGDZpMg15843y5Ulf3Ce+6Cw9BMWxk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=KIhXifYK; arc=fail smtp.client-ip=40.107.92.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="KIhXifYK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqcelrcDylaDb8Sior0dWo9PKalIDegvFH4uypQfd1/h4nJIT9ntIZvpXuLzIQaWe8uCKTVTuYErlv31ur5Izxr8y1Ji8m3RwqKpBqtdB8WXKijZBrtUZLdRXh669I6xbE0LI8cxA76IGm2D8Ftz7gNgl23QGxtBHdVKKrWvK4YBtPi5YIvvlrdmBwPLWppNgMJhVF5djQpcjOQx12JK/2JcnaA/v7yHX/InOmRq78ZU/+3CIrdY9Lue/v/TKh98H3ZLt0a1eyVFFFFndae+JtTtN6/dM66vufUf0Ow2xg/mTzjJuWcZxuY8N5hV+TKvvDwdP6fBHcUMrrRA7qYZ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tHqrWofo/hlfnqvgXzfWBB/ZBQq4Q7Rk1rQRut3vsL0=; b=nvAx6N020UcOwggnGKJmvqUpRilbjUoz8/ezmoc2VKXOGnuBnC9PPiGS+0/ZVDb281CGa1xFHqy/BbgRqapJWRnGBsIE2VtBK2MvFOWXm2yDFutAjGrQkmeit0oIzcaSwhMvJQ6mqDM7WYAGjRU86QSh7fu6KXxWveUcHM8eRnzN1GbQJIUy1h39qUX4PWZj45QpwMZ0LfxcdtbZPAho6NxsSsYPKmoYLpNfQ1Y2vpUJyuO0/kQtZ87t7gz9PpIG7646Wnn53hsRwIoWm9DO6qTk7Tk/NjEw94+gOrS3nrLIfdepxRA9l8kanz1uAowTNJfFzzRWmxx0KAQOnoQn6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tHqrWofo/hlfnqvgXzfWBB/ZBQq4Q7Rk1rQRut3vsL0=; b=KIhXifYKOpduHlQKhk0eVSVnI36hKz9pAQX4CxSlStZIdT24WHNF6Wgm8BHHKdSOouWd7NL9W6tPcK90HgVTlebQru73jbBqf7zA6mq2B79kE8CKjqfXybcw0H8G7FpYr52e+TEa9I7Q6k+zoW96HTjS6BNKs+QOyE+UHywoeMSTY7VN26vXj0k2c1hkTT+RpSl7iwa9yh8qeYfgu8EiYvl/9Tc/c5zbg7xxssvNKJyKRm9BdFmrtB9qoBCp1yN4rvtmp9rXNDuZpR1IpvqtGMYZ9VS0uKzj8arH+Pfvp0VDe4EFw+BktT+x0ZiYFTOtZ01/i8lwDsf6i7dub6yB+A== Received: from BN0PR04CA0072.namprd04.prod.outlook.com (2603:10b6:408:ea::17) by IA1PR12MB8517.namprd12.prod.outlook.com (2603:10b6:208:449::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 14:29:27 +0000 Received: from BN1PEPF00004685.namprd03.prod.outlook.com (2603:10b6:408:ea:cafe::2f) by BN0PR04CA0072.outlook.office365.com (2603:10b6:408:ea::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29 via Frontend Transport; Tue, 28 May 2024 14:29:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004685.mail.protection.outlook.com (10.167.243.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:25 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:03 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:03 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:00 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 02/15] net/mlx5e: SHAMPO, Fix incorrect page release Date: Tue, 28 May 2024 17:27:54 +0300 Message-ID: <20240528142807.903965-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004685:EE_|IA1PR12MB8517:EE_ X-MS-Office365-Filtering-Correlation-Id: f81acabe-8177-42c9-67b1-08dc7f229330 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|376005|36860700004; X-Microsoft-Antispam-Message-Info: WKhrJeNWkrOebzuc1fDLeq0PlJuKaOb1YiL4D/C05AcRDlkSruL1EZMWcLPQ6CtYbjdbCjxrcLughIKDGpPsA6xIZWNe3MBkzSyhcIpnjaMLuQgbwHZ8jyxWWocd0VpTYPRUgt6JrRXdgyUNdulHe37mLGDzi1K9KwfVtjP+rcn6Xr/eLZivkAKzyqw+AKG8nMd7pVvs8A6fvAVKxPggv2kBj3ARWo6uN+jW3BHxtm9en5z7v4VBLzb37AnsUhhgDMkSQV9VKrw2l2GUQv5yXQ2PKabAcgAkv5vpySDJ1SjQZ1IYgUsuIOqqt6fFihat07rYBFZbiROqDWmTn0QZI5jwIST9/qr3mI1T5AhPWgQyitwgHUSJPiu+p0VS9py+rBWJy3L4jUsG5es7pslfSwgFb09jJXWEUePS+N89byB2T9Yj1ggkHGcv701aRM5WvoztPpWqBAr5OQqsCWo4wDWHLugZ7nRTl/hDK/v579fIxz5fgCkmd1PBEZx4HPhWtDtVzfIqXVrc5LLf0Il1nSxcBbDeEnFm/M7PFRwdhWwZR3Xa2gzs/gXPi+Oj/RvuTo5YQKf/eJe1cFm33TtH/cOntewgiuwECC9BolEjD2yZw+g+JEAcYlrxSgl0g7vGc/s54zLOo+C1ot3NOuF87hCEduqY244cw8w6I7STYxKWGBh7T7a1WnT15NGQXouQAaqrB1P4NkOxLhJLYa6NCKEliiWgaTTQKfttJhQjIzUwtXaFYNs6hvtsqng4zQOx7036zDm5r7IoKUsDjkjY/KhczemnhNJKC5cwZ9UCRKUR8btidTIv9KlD9uOogQXELtzXsvBPB0s2QEHODNuKMyuSAUapcvknJfs6kqs4vf0Z6uNOJbCCdZYaYbWny5yYLQwO6BMjMsRHnPv7B/pGTowA1abdoYZWZyVmyiAj8ujfk1mUiL2qkM9RRUaaZKXGJn8SDz+lkVTWed5SNPDg9ksUhjeCeq906uTcQgjCqMH+ahBqw//URGVml2y25DbyTHO7jkC29IQfaIocAx+0kB1obbR/6AE+zkMeWSic92GlaC32ZWpqujsiM3X3kEOJCSxYSRe96bzDKB3dVLHzlt/Of6n+tFBve+Zcu3z61xAqaeIRgcLDVWp1PQ1IH9EVtnc9K41SESHCzljq9grGEKsiFfrYrTHRiM5u0U4EWyatqMEc1huVzkpUcQtleYJZ1nAKMHUScAyGO2gVza4BsmbZ6UzgCj5KtZqemT/oTbZ+zEZxGWRHORO5HxZ/4kme5sewqSvPlVXRxAA+G2uc59mtTyBinzkB4jaEKlISxDzaVvi8mu0AxcA2BjZUhzRUEsgM/LDLEoq5+PRuzKTgRqxMQu0nkU4+x0DQIfNZ5l4= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(82310400017)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:25.2618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f81acabe-8177-42c9-67b1-08dc7f229330 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004685.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8517 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea Under the following conditions: 1) No skb created yet 2) header_size == 0 (no SHAMPO header) 3) header_index + 1 % MLX5E_SHAMPO_WQ_HEADER_PER_PAGE == 0 (this is the last page fragment of a SHAMPO header page) a new skb is formed with a page that is NOT a SHAMPO header page (it is a regular data page). Further down in the same function (mlx5e_handle_rx_cqe_mpwrq_shampo()), a SHAMPO header page from header_index is released. This is wrong and it leads to SHAMPO header pages being released more than once. Fixes: 6f5742846053 ("net/mlx5e: RX, Enable skb page recycling through the page_pool") Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 369d101bf03c..1ddfa00f923f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2369,7 +2369,8 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq if (flush) mlx5e_shampo_flush_skb(rq, cqe, match); free_hd_entry: - mlx5e_free_rx_shampo_hd_entry(rq, header_index); + if (likely(head_size)) + mlx5e_free_rx_shampo_hd_entry(rq, header_index); mpwrq_cqe_out: if (likely(wi->consumed_strides < rq->mpwqe.num_strides)) return; From patchwork Tue May 28 14:27:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676909 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2042.outbound.protection.outlook.com [40.107.92.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06D4E16F8F7 for ; Tue, 28 May 2024 14:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906573; cv=fail; b=cWlBRpiad/Zw359Pt9qiLlX6nPK9SQtOnGdKV6GkKQ0UzlJJGztyBx9Es1pLs67k7hu86FboBWlvCohzScelmpESb7PU48GUSLYYvKra97+2T0y+kURe150sTUAw3ZS3HEkVqVbK4rjTuph2AMzLn+fZuhy02G4lP7Pyi+krE3s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906573; c=relaxed/simple; bh=t4QU9HWC4PODKG5t6nLrzQLrMpoOO65LCU9kefyKs4c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Mk58WlhqT2T1UNgg/bBraCDpUVcEPgjaMd1YL+Z2CMwaM0o/H7sikYo827Xms5TkKKMvK+Yw7V3NuwTbQN8QUo7odzcNB5F25IxxXnSqieLt18VHxRwPvvroQxklBk8qqohHytwDDkmHjNhyTg1MdSSaH+mdHQRfNGPpBn2I8ec= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Mv1Cwv+w; arc=fail smtp.client-ip=40.107.92.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Mv1Cwv+w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVAsz9VUZzmdvr8wl20Ro5dAfR6xSVHYBUPwblNe3i/iyTfz0Y6Hx7v6bF61CTffrdHvsLv+qe7GHmwvA3SOmdpcZ2xeJ1FfesTv2f0DuY8E4VSa1EqKX4EtNVm/t/MxMzDitNddPAFF0G9b2ZbnQixnySZMcLqQCr8oeoW9kF2bidyG2RdU7hKxRAuiXd/syxkI/X7h6Bneylo+wFTZX8R/mpZh57ATs1KRI0pHsa7SL9UTtgMDM0flLrlh4kMtVUibTrO4vixUa4xY0w+dq3yaOMFGZr/coJXxLbH1kX+mj5l9i2b4U5w0tanal8/C6r0qZB1JvQWbJ27FtYEEvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z9Kr24ZY24F1R8v7g3jKht2MX5C5mpcLWShweLOajH4=; b=HyYfUhn40n1tRPs3NDGKBh4BTc3fwwvuI4i9nK0XMjiFtzl+uKuoRooDsCWNo08Bhqp2DTNdRkYiBVKOa8M28nFzgqy41YulGHkkZcWZgjZBGCJUbFASd7lxe2YF2CYVJLqWr4jH9vQAw3VehtPYH8G0SQixr/q7EP1n1vwaTRM+aNwJPPBar5wzW6Tue5tMOvNbDVt2muSGgB8LsX2W8X+SYOyIX9p1cxuWdOMF3s4TPZeECLvoAEymwOjPFL001SmvfgOyxXsDcJ7IBGI1mzwIGpvkRWzVcW3mrRQElGfGHJXPAy292SDGgeq3znIeQUNjCEfp2rTnvcPmAzINMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z9Kr24ZY24F1R8v7g3jKht2MX5C5mpcLWShweLOajH4=; b=Mv1Cwv+wGvsfz3fSdBQgwCNEYFnHPRfWooJUhJL3g8jpZEekks5P3b7rOYjysQUCoXt9it6Gj8MKD1K8fl2xtJgbybUT4V2imgbVdFO1fzT9JdVlCfhXkgMNgG0PQ4IsJLSNYFTLvQ6k2mPxe9JwwPmAOMLeCas1uWXuffUv8Lah4tMbKyQc11vlK13vNDZoUn5Z6+heuIjpR4WXRxEWLrBFYP/2aI3Tc+mqrk89PZ5/MWWIN7ijKncS3Y1THMM3nCHOYRNrjDMCfdFCqnLspi8XWKJe+f4QmjoTfCwZL7H2j8y1yFpV2ptPllIur9o1dIXZ5WoQ4Iz3Ar/KPWEXDg== Received: from BN0PR04CA0066.namprd04.prod.outlook.com (2603:10b6:408:ea::11) by SN7PR12MB7811.namprd12.prod.outlook.com (2603:10b6:806:34f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 14:29:28 +0000 Received: from BN1PEPF00004685.namprd03.prod.outlook.com (2603:10b6:408:ea:cafe::44) by BN0PR04CA0066.outlook.office365.com (2603:10b6:408:ea::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29 via Frontend Transport; Tue, 28 May 2024 14:29:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004685.mail.protection.outlook.com (10.167.243.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:28 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:07 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:06 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:04 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 03/15] net/mlx5e: SHAMPO, Fix invalid WQ linked list unlink Date: Tue, 28 May 2024 17:27:55 +0300 Message-ID: <20240528142807.903965-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004685:EE_|SN7PR12MB7811:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bfa8b49-22e3-4e02-2bee-08dc7f2294db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: +KwGwie92TLeXfN2SqQpRi4qTIGv/0m8hL4H2Zwa5R4xNx6Y8NKFgQq/eQNbS4kP51vJadXqxOV4SBnJBVHg4AarPvGLI3yl2xqUFF+IxunuGkCfDVHm2M8dspiR5ofL+fAg3mq9+sLCKRQb7B5HaiMA7Z5vFWY9vfNwIxkEiRdgRux7tCzv8b2RFmG9fp3O3SynDnlVlLeYG+Nyv9/Yjz7nHKvyDUZ8gYLs9JILsFHRBICxAO6JDfeNbdfXDey/jHNKvOGEIXaefhghZtzVDILD4Pp8/P4QqZXEx2Rx+l0pOB4sQbPDWeyYqfXJPORCw+i5N1WFS4JgaeCsiGHjljMRS94PpB/7xl5XMxVtfLWjtxxCYes6iRKu+43pGyHiYHArtRChnvPHSfCHCVIzbALtroqCw26Z75ETAN+hPEnVQbYKN+oXZ7Vjm14gODbDnPqx9xvd/VT2Uh/NgLoqd4QUTtw08vdm+NZ7Gkrj8Ww7eF0BkGJ0o0IqXEHcMm7LtAMqSfzzdFRBEuhwuQVSWNuA98eH66NMbxEkMOYJEdu4Pu0k819TjBKOyvx6cD9/EmJbFpYw9iwbqNsBvErFUdkK4RUz9gXJB8vR2tTbWh4lZOlZQA5o4XMnWjjQR351/9XTFzyg2rchgb9MxRweWU/Je1ZM6jr4+IYR+1xX5dSoyuuYvz2m93a3ih6EFAZH6IqZkb86IcoLDgkkQdtAR5BAQe3sMcNyjbdnBe9D0uNFtfKEIvKEc+c7/F9hD8PisN1FyVviT765pznsCVRiuBwqpbdmKNCagYkXzsiMOhj3EFPATWKjMXA0FAhTwHgPv79NMnxz78lCFLZw6ELBlddntLOt9vkGwUJioGFmsxy4tetpEYl/FXUEQ28DQxiqOTjAOWFFzFf64EDlmb6alEP9PWxRwxysFnv4S/bNrK2LR1lakaV768gq/if146XpuXKzFVkmO8hDU3kyvW+QbWXMRI62W5aibaAHQCqwAoKbU9MJ87COkwwi/kxxbz1++rHwvq4f3LyaCc7EaBuBhhKxtHA0hFR1HD9y7bwVLLlkI4fu9TL5unLwSyAZS2uXxmn+xohOxn5OG2XZonLVs3NlUoPIzTyBied78csYPR0tjlnbxAEFr1VwAir/EAoJodIj1J2KtAb3JYpIbn21b44FwWXl3u12z4HixopqVdnj/Qb22z3wFa5AfMO+nUaDCi02WsvQv48sg/U55D75mlscMyddou/xHiB7uK4HvZqaLHU6bzdSjZtVM0WSjjsa9UPADTtihUaXC0Wkt9vJfVxRdQkbFQZtmuVG1+AF2ZIu03nMSoioPBChCSp+P8wn6p+KJ429/27s1pe781bkXUlsiWKjUvHR0G+8PJbvgDeDGm7ie8XP669jgAjrjrrW X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(376005)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:28.0900 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7bfa8b49-22e3-4e02-2bee-08dc7f2294db X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004685.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7811 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea When all the strides in a WQE have been consumed, the WQE is unlinked from the WQ linked list (mlx5_wq_ll_pop()). For SHAMPO, it is possible to receive CQEs with 0 consumed strides for the same WQE even after the WQE is fully consumed and unlinked. This triggers an additional unlink for the same wqe which corrupts the linked list. Fix this scenario by accepting 0 sized consumed strides without unlinking the WQE again. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 1ddfa00f923f..b3ef0dd23729 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2375,6 +2375,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq if (likely(wi->consumed_strides < rq->mpwqe.num_strides)) return; + if (unlikely(!cstrides)) + return; + wq = &rq->mpwqe.wq; wqe = mlx5_wq_ll_get_wqe(wq, wqe_id); mlx5_wq_ll_pop(wq, cqe->wqe_id, &wqe->next.next_wqe_index); From patchwork Tue May 28 14:27:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676910 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2065.outbound.protection.outlook.com [40.107.243.65]) (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 DB4E81DFDE for ; Tue, 28 May 2024 14:29:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906575; cv=fail; b=YYnmUpAxSmSiRYfbfA+jCikKHWiKoxjGaMcGlEiG0Faw1AXML83mWX6Ll4aZqg0do3CUdVQFq5WVaAjhfIa8ggE2f4qDZffsfCw+UMtV+WxQL5loPN6l2CUANzV0iPhuJ1Y7/vo9DBZkt6ZTwkL0Jx9r9B7kK1t3Ohhd6Ne1IHg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906575; c=relaxed/simple; bh=tBzWpNP02/j8YnGjTDuNDQ1QXFYPwPbB4MvGbMdkBzs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SIb/oebbQ7ZFS2X2y3CJxtayUBwpwMnm4rav5zUFW64ZZjpOi7mXjnto0q5QBB40T3vgmQvBio2u49O29zn9tTjbxxwUj7UO9h2vNDBMxlsWL6OUNKR0r9ZxihLdkevTDLzaTv96yRh9LolWa5ZFvU4r2qTmgS/gP1ehjbb6Osw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=UVQva0Sf; arc=fail smtp.client-ip=40.107.243.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="UVQva0Sf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MSrcq2OI97eLPWj/vnnEH+zJ5AR6NMbqnG1tRpUO6Woaar9LQ3Pg+8cbvkHzTt5/yuUJyhWz4fw1B87z4snM7wOeYvjvOMncqvbnlSm39YlR0ik8sS6ivjlk9vuCpm1fPpgWRCSftsl2taJ2e89CiJgPAvojWe1esYe9cv9zjmCeMbtk8UtKqoyw7njdx1+v6oF/V4Xwqk8BFSEm5Nu0Cks5N395fW8Hsoobf8qScXN/GpoaXnrTN4E4M8mVb7zlSFCK2nhXNk/BWTGjtA+/hXtlbZfZP3C9Bf1tjtnlMbCd65MW/VP2JkGjEX9tIBjSx5OqrjG0bZbIaunL2lq7/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AwyEYObhx2Mu6J/+E3FJBJIhgacIDX6cnxNZiYjXrEo=; b=FYBaIg77qCVzW/ncT2X2vlvD3voaXELrbNv2hKtMy67sasMVdDFXNTmLQjN/7BH8WtGOcpD3S4GexW8Koq2lSxzA32quTfAfFHcthCzJGfVX5Rw1TYnFsgCmT5KnzrtMOAtnzBGYWyN6REIZ4o/IN54IQmUVSv4viz1neVzPiYAsoXfQODpjs1X1nAVT8FX7Nopm0afVgEHM34wQvqu0aT2klggsOauLO5o/i4TDNQSq3MNqsuV9k/VrLV55rKg801NseQ6/CoGV3Jp1YarChRAm1cqmsUrtPWhgUMaoef0MkTopxCmf9FuDypssaQ1go2B4nT+a8pan9tKRFsyw4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AwyEYObhx2Mu6J/+E3FJBJIhgacIDX6cnxNZiYjXrEo=; b=UVQva0SfEUj/mINgzuQXN/kZCrozrmkbTx11I10nwQj1k9XR9pg0dqOg7Hsmffmg/O9S8nORyQ0IH2Epbmcm4eBtLwrsniQ0v+fmUxigDoEt0s+63f4JW1AVFeq08gww7pxsoKjLVEyAYoKxkpyiMV3XFD3751pElp7xFxdg+5Sc6ViGhlz711aZQmuDlh45eR+PT7DJFa8vYqU5gzKRRk3/jK3JEjaBqgkHJuwZmIwGY5XCx7azZWD7p871t1EGRzeNxxu1IBXiZkDwgy/W1UrmgDg6vhQyJ3x24+VjypV2gPM6Wtk6XmwPDX49GUQMzq3SesbD1ysX5N4nXPh5jg== Received: from BN0PR04CA0063.namprd04.prod.outlook.com (2603:10b6:408:ea::8) by DS0PR12MB7778.namprd12.prod.outlook.com (2603:10b6:8:151::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 28 May 2024 14:29:30 +0000 Received: from BN1PEPF00004685.namprd03.prod.outlook.com (2603:10b6:408:ea:cafe::27) by BN0PR04CA0063.outlook.office365.com (2603:10b6:408:ea::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 14:29:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004685.mail.protection.outlook.com (10.167.243.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:10 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:09 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:07 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 04/15] net/mlx5e: SHAMPO, Fix FCS config when HW GRO on Date: Tue, 28 May 2024 17:27:56 +0300 Message-ID: <20240528142807.903965-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004685:EE_|DS0PR12MB7778:EE_ X-MS-Office365-Filtering-Correlation-Id: a6a70c3d-4986-4f2f-1ec9-08dc7f2295f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|82310400017|376005|1800799015; X-Microsoft-Antispam-Message-Info: 16TN+FOKunaaJ32/qalFY4Fk1rYSO+BxCMYxUAhkQA6RgCXTr1Sz0ou9Il+iofar5Nlo05yFCq14scftjEkNVwSKmJGfvO6uOAGOpgF837prBqy1y+qTUJVomKNFZ49z+cKRv3QkXQyTIzR58cq11z1gXV6w6iPrR/tbrFE6a6c8ddC1t9NL35Pme1o+XZS/A6ftECCWkBSGtfdrR29Wf8kNMB90xz6u7fq7MxDIfv0ktGHS/WcinODBvVs5qLRaYmkjgKls7geVadu1vTueJiQNzKIxOsBM02SlJXE+amqqwy9voC4Pl+FXhJSPMC6u6LPfx1savbLhDvfBKdP0Up44+IjNM4YFGpheXI2vaxXNEnpWIDwVwetmcFV0LNzRb6/eoqVwtFJpl15lJ6eq1A6TQlIN4w4rM5Wgd2UvsGCCDhQmNvj3egWqGJ1XDCaEtRfglUDHpnC9Rv4mSehJ+pol6T/7Rk6JgTiDYBFiVza4JXlcH5Bu9lgJZio5/m6w0QCAy3FS3firQp33pOGHaBRC/In9gf/dyYco8J2UilYnrGHBLfP8GnWHGb8lrX5mngfEcdzdQMnN3W1kzs1GpfPWsKmTvb6YJaYqAxitYRg27ZrbbGTlkhCt4Jh44yOUMgJNBqLN6zZpOuGERVwFlvdZmRtkw1eZI4rOQ7cNBO34DDbzOxIOGvPdRuyit3Lr+h/mNQr/K5FS9rDY28lvoNapcNxfoq23U3ex5z5+PfaEHPRVfwjnZ34+2Q2XzfRHtm9P0nSIEfcgKWXtRSMtiDaz4VNmTBboAo8TuhaFzOwkRXpc6v8079drvP6PDdoiJ517Nxh/EjRNzn4VLr+WKp8Xt6Y/uCGxM56dGCBfevfkonY3BXhFc9QQ2JNVvz2W0DR46mvJ3aiChaXgwI/NTcNpcUIDI1erMypUeqa5PHkVZ7ShgtRvGxno3N0RlSZSn0+oe8GtGzfqLQRoZLlHs1dORHdk/iVGnYavf1Tt2DxjJhyskRu5gdSdiWp+165gF+fuiLplocwxAMWbINqnfQwQyqK0u3FzoHCV6ROaB+mmJ5uGbxKPoJB/wI2CT3PiFCm/pY3Vngra0a10UQ943hSDlHOBl5A+1zFXgIbR5ZUkrExnqQQHV7TiKTnvQvca1xeACAeKiCGBvr3wH08bQXToZ4Gm/S97Q5MKUsSkQTkOeEk6wGD55qdGPhs7+k+IdyttgVW2Z8eQXaqWPXZ6IW/EW+ZeDORmyOBZbxWHvX4VjeCtMleiJH2TAvcPNU1vdCkpIdmpuAIQvx3b9U0lc4Gkos4jUj1SeXNVap+vsj5DXWfvRBkQffCwyCjnCYN4lTglr9sCZff9HNE2AwJXKuM/NXZPrz0Mifnxp5LsQBRXXHl5E/1MiLu7qDi/Ia8y X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(82310400017)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:29.8556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6a70c3d-4986-4f2f-1ec9-08dc7f2295f2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004685.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7778 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea For the following scenario: ethtool --features eth3 rx-gro-hw on ethtool --features eth3 rx-fcs on ethtool --features eth3 rx-fcs off ... there is a firmware error because the driver enables HW GRO first while FCS is still enabled. This patch fixes this by swapping the order of HW GRO and FCS for this specific case. Take LRO into consideration as well for consistency. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index b758bc72ac36..1b999bf8d3a0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4259,13 +4259,19 @@ int mlx5e_set_features(struct net_device *netdev, netdev_features_t features) #define MLX5E_HANDLE_FEATURE(feature, handler) \ mlx5e_handle_feature(netdev, &oper_features, feature, handler) - err |= MLX5E_HANDLE_FEATURE(NETIF_F_LRO, set_feature_lro); - err |= MLX5E_HANDLE_FEATURE(NETIF_F_GRO_HW, set_feature_hw_gro); + if (features & (NETIF_F_GRO_HW | NETIF_F_LRO)) { + err |= MLX5E_HANDLE_FEATURE(NETIF_F_RXFCS, set_feature_rx_fcs); + err |= MLX5E_HANDLE_FEATURE(NETIF_F_LRO, set_feature_lro); + err |= MLX5E_HANDLE_FEATURE(NETIF_F_GRO_HW, set_feature_hw_gro); + } else { + err |= MLX5E_HANDLE_FEATURE(NETIF_F_LRO, set_feature_lro); + err |= MLX5E_HANDLE_FEATURE(NETIF_F_GRO_HW, set_feature_hw_gro); + err |= MLX5E_HANDLE_FEATURE(NETIF_F_RXFCS, set_feature_rx_fcs); + } err |= MLX5E_HANDLE_FEATURE(NETIF_F_HW_VLAN_CTAG_FILTER, set_feature_cvlan_filter); err |= MLX5E_HANDLE_FEATURE(NETIF_F_HW_TC, set_feature_hw_tc); err |= MLX5E_HANDLE_FEATURE(NETIF_F_RXALL, set_feature_rx_all); - err |= MLX5E_HANDLE_FEATURE(NETIF_F_RXFCS, set_feature_rx_fcs); err |= MLX5E_HANDLE_FEATURE(NETIF_F_HW_VLAN_CTAG_RX, set_feature_rx_vlan); #ifdef CONFIG_MLX5_EN_ARFS err |= MLX5E_HANDLE_FEATURE(NETIF_F_NTUPLE, set_feature_arfs); From patchwork Tue May 28 14:27:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676911 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2084.outbound.protection.outlook.com [40.107.243.84]) (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 79AD716D9AF for ; Tue, 28 May 2024 14:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906581; cv=fail; b=G+MIQ7uHVmGgQetbChNvjI2HfcZCwIAEDM53yXYS1AJDxTrVZBYumoqYFeZSUyKNv//eENB0M32b5oT23rQbu3MaL/eMvo4L3XrjuCndeldXQOFzKm20NZ5StB7H+rYI+iRvC0/Z0aVL6ZQv2yNuBhoIffIDC7VMU1ucJ7SiegA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906581; c=relaxed/simple; bh=uu/yk4WtbSG4IwMQPdz16Ei0a7Zvgx7eWo2VwzEeu7k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uekDwFSCDPClZpigQIE99K2tOU6zT13zhN4An38Xci8O6QY2WuIdHf1N0GFSAfhdVGrT67LbvSWxFQbXT60mVlOvVbwSV105n2VqrhirdArA3fpoBKKgnIy8ChAw6C4cLWn+oDjv+WXvw4M3PqX9ZDAmflgLxIlAkcm7xiUZ9kw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Q3WfD4NV; arc=fail smtp.client-ip=40.107.243.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Q3WfD4NV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVQdUWgK0tYNTVnYRZGXrxs43s/cLBlgxrsw/w7iSEVRsbaHS/omm+hEbhfWahTSq3Gv5z1f07bxOSZqEWsfKlkDKSlyOfBWJUVWDMQQce9p66qD4z5SEdV3P5nJ4vsSRsy7hrWErHzT/Fg1WNdSKUDa0vXzmSQhue1RCnjTvhz+LFHm6ovbelutWxE+4qbhUwsV8G2KjDUSv+g69x+/iOypVABHiKlQTPP6YlPnvONxDojo+ZXqXfCROdnJnTydF2md/LQmSRxae4chCZGHqQPc6Xe8UK9hx3BiUoEX5cUEJsSGyhPvLHiEwjiVAUPBpD+BI7kPuwc1hvOwf0DgFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EONykFh9Re/dti8AKEgY6Ixv/AVZdXBdUY3nCjPO36o=; b=hGHL+ooEFT4diw2IzcKWB2Nqkf6eUjjrpENO5z84MER/zzKIYPJMoIwbSbH8WkLizSV6jxR7VVn7Pw4UDMZXFrluAPSFQ8MojuEqtfIiSvW/Lxcq8ZgUts5kLFrl2Hpw9IA36+lWfljtlAWs6+R2kf5Q5iJYAAanp5qqBbyAV4s7VrMKOF9FX5OfunGr1lgc6eAwaYoFwhVzOwwg1o1Eu87RI5UPHhE+k5LF7c5qePxct3gZp6/A1jjMjvky+p19ZMhjVemVVlAjNgTV1YA3mSQLNSm4Quy6hen7gSAj6CdO7hsyu9BaZjs/fDkeO05jty0z99zoLb+y9tSy7VrFKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EONykFh9Re/dti8AKEgY6Ixv/AVZdXBdUY3nCjPO36o=; b=Q3WfD4NVO2XZTj6ki45HbMV4ev9L06P/6Rkns7mBnw+PNsZiUmnqtmcbiVnh/XAc4cJid76Q0aJ2xASfnxw1Rm6TPptXSgjcHMSnDNVWfEV69kk8hP6y7CxoJevk+qq+Vs42Vjgn0TskPdhvBFgW7xlx3vcbrRb2gOASrWaLOxLGF/2RfMTaZA+QXYOhXqdElVMhUqkA0F9WLWyhTGxtB4U07EPG55V2fFiWCj6rsBGHZ64FQQ3ZYaOD8NoK+NnlL19DxqxuYmq7eVENSY2NNE780UrFfiu5kFE+XHwAt1hzNavYdcVTvXfcX3cuwVAwmMaICwJBxtt4Kh/sO6Q/pQ== Received: from BN9PR03CA0455.namprd03.prod.outlook.com (2603:10b6:408:139::10) by DM6PR12MB4041.namprd12.prod.outlook.com (2603:10b6:5:210::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 14:29:35 +0000 Received: from BN1PEPF0000467F.namprd03.prod.outlook.com (2603:10b6:408:139:cafe::d8) by BN9PR03CA0455.outlook.office365.com (2603:10b6:408:139::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.18 via Frontend Transport; Tue, 28 May 2024 14:29:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF0000467F.mail.protection.outlook.com (10.167.243.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:34 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:13 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:12 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:10 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 05/15] net/mlx5e: SHAMPO, Disable gso_size for non GRO packets Date: Tue, 28 May 2024 17:27:57 +0300 Message-ID: <20240528142807.903965-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000467F:EE_|DM6PR12MB4041:EE_ X-MS-Office365-Filtering-Correlation-Id: 3151217d-711d-4303-03be-08dc7f2298f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: e2+3PbNdX3CKFFHKEl3LXVs/f0C3ignM41jxkK/HlBp50naMVATUbxWPUgxPL5q/HZnAUUUxFb9WDgZzd+bqEuq2Cgb77o/n9BOqFYQ6SyRSqHiyTZo1nLWjdAkb4UQ7cy0AdPxBQFWOJrkv48SacsNRav2mAj7tg1U9W1y6iICROPevLL4rn2OwX9WVn5e4Gsk/4AFmZKQ6vfuT42EICP2dculdtH/J0+YuLtQBXB9KN0Grl385wPr0A/6dzeW5Vb1RnmEQtsYpxAAihEoKHCCPsTp7DURr9vA01X2A4buH5YAKbTtRUPoRVeWskKcf245MtSNl02RAbb9ADbPzESythKuyf9uN+IPuGCpvnPZJIOVxzASV98GB8ypJoMz3Owb59izFxVAko3JGdwfmf3LBOMdXlksrbo+sABNL3+YhISdUVQUpxVYf32FtVxjiRI7zNlnCcU+/XW+O2A0e0PoNvYE+n35MttTGMcr0KMfQ2y8RNbdCY0MEmGprThk5SiBhP25vJY/TFZh9SE9Esy6vNKyMPi3msPikReCGgUoSCByo8Fx6oWGu4BXMXmD4vwlywtp2vxeoiTjw78YT28/eqzyrbHhTBEmR/R0wED10b8acI5p+BsTgsmZPu/RHUG32KR7JpwpWxb/z/V8/fzIvvKlMnthEPLQvGptp0rGort+msDoS/3ihO/4ustY2Nwib3OfV/Gyw0RKbFro5/cD23natByeneM7Upopv199bWKVWnuABTE4RIzKl6pFjksiaovDwUkpR2X2jxJyeW/pJlFabKtH0BFw8jGrS/cVBk148ZO5kyZ0AI0zylt6Tzi9fH69WDIPf83hm2tbSXt+WSOIFbyalqLiv5+nYj+fJqsv32fTvu+AbeFq329biit1gvpYvzvtuNOpkSEe64GLe8MBm/H1D5TukXc9OnTLCZ+pQ297/hRPJTiveWuTIO4R0sbvK8GKQRjt0Iba5dCjb7kyqT9iw8BeD6BEiVOVl2JyQsJ/x62nhvwr+2FZP+jNiW5XC3tB6dkiZvtHDD6qETTYWcSGae60lRkBwrpsGVgX21aN7MP0iBGEZoLV3hvttwfwD23EiWAT4wglNAwAMN/Tlh7uZGc1bR8pi1h4Ga6YuArnXMvy9i2evCO5t3qQfZ8nlTGd22sWBc1wt8Af27LpNfTvCtibr4M0ZZMFQ/1hBERQ94uOllrVhADCw+LWEbm2v/PxRLkA/r+2JIWazAw/X40cTU2Z2QT0Vd6BhzywphMqiJOnQdLDWhoYld/05PSuUNgnYH1UuJnFtpTI/ynFYRQWB0+l/xHKB+Y0wXoxt/BcDGP+WV+VdpfgwjSpBaCGE9qeQ0ZGHOC0CEJ/HiXTPBqiA36EHB7jvUmc= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(376005)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:34.9677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3151217d-711d-4303-03be-08dc7f2298f7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF0000467F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4041 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea When HW GRO is enabled, forwarding of packets is broken due to gso_size being set incorrectly on non GRO packets. Non GRO packets have a skb GRO count of 1. mlx5 always sets gso_size on the skb, even for non GRO packets. It leans on the fact that gso_size is normally reset in napi_gro_complete(). But this happens only for packets from GRO'able protocols (TCP/UDP) that have a gro_receive() handler. The problematic scenarios are: 1) Non GRO protocol packets are received, validate_xmit_skb() will drop them (see EPROTONOSUPPORT in skb_mac_gso_segment()). The fix for this case would be to not set gso_size at all for SHAMPO packets with header size 0. 2) Packets from a GRO'ed protocol (TCP) are received but immediately flushed because they are not GRO'able (TCP SYN for example). mlx5e_shampo_update_hdr(), which updates the remaining GRO state on the skb, is not called because skb GRO count is 1. The fix here would be to always call mlx5e_shampo_update_hdr(), regardless of skb GRO count. But this call is expensive The unified fix for both cases is to reset gso_size before calling napi_gro_receive(). It is a change that is more effective (no call to mlx5e_shampo_update_hdr() necessary) and simple (smallest code footprint). Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index b3ef0dd23729..a13fa760f948 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2267,6 +2267,8 @@ mlx5e_shampo_flush_skb(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match) mlx5e_shampo_align_fragment(skb, rq->mpwqe.log_stride_sz); if (NAPI_GRO_CB(skb)->count > 1) mlx5e_shampo_update_hdr(rq, cqe, match); + else + skb_shinfo(skb)->gso_size = 0; napi_gro_receive(rq->cq.napi, skb); rq->hw_gro_data->skb = NULL; } From patchwork Tue May 28 14:27:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676914 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2068.outbound.protection.outlook.com [40.107.100.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 6636216F911 for ; Tue, 28 May 2024 14:29:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906596; cv=fail; b=ABm+PYbFBnDMks0gMtktyICVTgVjhvPGdDXXoAzBQ0r2EjoljYryOKCECTDeq+Ob4fydVat4G9WrBm4Acoqqs0wyGxNU+7GbmsOBLOh/Zl4AWgYnzNLMvrEjyc0jwRviLlqojUaU9yA7k0EdSO11ddPn8irHDdVKXY3k3bYGMRQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906596; c=relaxed/simple; bh=WTf2aDuwWspbP38UU25EylJvPAnuJGfZPuIjYmE4D2Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hhGC6b2r0zuDwuTS9g1LvXFsABakBA/XorhYa92ZkOlNZlFksaCAYWapS1VUgzhqs0dGH4CofaPSP/5g1xt1fCYCDIZ+GMSLS4Pplk0ixlNBvnkm1BzVmc2q3N+vKZNimt2Qnoi+RYLTQvp+jHaCALhTUGmjIqnFbmHxP5LE4xQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=TBWuIuhh; arc=fail smtp.client-ip=40.107.100.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="TBWuIuhh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXWv3y91wmgmOctnB0Jv5eo7KPLXUppVpRl9y7bHbqCKimgK1G92N2kG/H0X/yoET0M8iln50tZBsys05Sfulfv11kdxJCjd/pHtDvsJ4yy6EwtPEWrp4LWSjnap6OQfglyLvwOGujCeSSEQrJKKYjQL8p4CVdeC2X325olRtez1BfY0wjjWZI/RWVN5Ji7scFTU1xOumc/h3hA2HUnsqyQJSGi0noDLTc6c3swdIsQqVOKxoGWjFyvCIfIvTgpzP7H5mzsNqQkJ7jWJ8yLwVRqdQQy8GmMf6WKHjO6yNAl4ZT068PBQr60F96nfNekxFO3bGi1MtCitAy9ow/bQIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MxK+rDNhbg7sv4iJ84PnZbRffvN+0NMnlFcC0kGTYvQ=; b=abYu0+KtgpZ+p3Hf63ejdJySP8TexoMU2qX0USLJ63A1QZyhKuBHrDxPLhdgkjuzkd+FBMUIlOLrpKBpXRy0RqlsyoUGDq5pThJpX8pagTuQTipNlyodvJxIeENBf70xcpIgnceynktec5JPnGl7v2vQiTB6zSLD0RjRRlY1pX1RhVKkBbKDYFK1Wy/6rMSDv8BUmdld+0LFxM48XNLz5gIDdKmFtfVwi1Cd5ZGeLPGqCrIJb54attzHOVQYh26YtUI3xQERhlQ5sb8CQnpAmOu7OuStc9sjAwI2zF864dr0j6zBdZj7IzWYuA5j0xkscnFzIBlyrJldHelSXWMY8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MxK+rDNhbg7sv4iJ84PnZbRffvN+0NMnlFcC0kGTYvQ=; b=TBWuIuhhly7vUGA4NwWO5+EAYwWvSZxDFtxioc5nABz3n/BleBv8mY6PLwD9iIfBPmBYdRLA5buRpcs1hGDSr+PvVkWB3jP8eFknadv+ltDAzROI5lwYEBimkWQD4uL93PemYhdsGvYpvkldSsdVRIeWPsWo9r7WM8g2HmMwtHMJU8tuZwmk+D0EZsCbQNmX3eVS4K6kjk9SyDgxjn8AGhzWz5RNeNv9Ff9V8fBYcbepM8qkBSC65hzQQiVqXFZp8MHUA2s/qWmndZBF1kHjvqMmONRovBrXxB0f7VIgAGVB4M1ErjpXT6aU+YF51pLotpMuc1hgkTSzJq8Gl4xqvA== Received: from BYAPR08CA0036.namprd08.prod.outlook.com (2603:10b6:a03:100::49) by LV3PR12MB9188.namprd12.prod.outlook.com (2603:10b6:408:19b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 28 May 2024 14:29:50 +0000 Received: from SJ5PEPF000001F3.namprd05.prod.outlook.com (2603:10b6:a03:100:cafe::28) by BYAPR08CA0036.outlook.office365.com (2603:10b6:a03:100::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 14:29:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001F3.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:16 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:15 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:13 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 06/15] net/mlx5e: SHAMPO, Simplify header page release in teardown Date: Tue, 28 May 2024 17:27:58 +0300 Message-ID: <20240528142807.903965-7-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F3:EE_|LV3PR12MB9188:EE_ X-MS-Office365-Filtering-Correlation-Id: 14741a7e-9fcd-4683-0424-08dc7f22a144 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: Kx7Yt55Y1qxOz06rNA+wcsFv/dbHZnQaA1jQSz+ZwTDVr3Z8teVEnOqkiRurgx7749hDy64AY4sJaOjyK3M5j1yPwq7Jt+WCXgrrbQjNC+26VQ/lrhObBzUSLDc/VNHMyn2GMgj79u/g1Mt/60wOYUrR6LLxRUh/miiR3hmXQTHNOsHvhEFmTxGdT3ZVtvptwCRlC/fL/9XlypF/3sX4DJSlSC6Zm/PPKcTY0+vtT5/N724MMrRfg8dGdQf8PoOuOzU1jH/oyuoooW8nQ0zfSbLo+FOpmJzFbLwe3oDAQuJYL3/ICqvshAkEv9/TNDjSfd4Ll7+qj2Zy4uyCcVeErlmIKzawMnMxxnNkvMKjMjG2X4Oq7Xb0KYLBfV4zU3AQCINIiXYZbSiblQGVdqgUPl9/PxutkEQJm5dC7XGBmhZRyIh0IW1DOqiLEa8Ytj9SLWr6edOpWsbMlU2aS5vewRramjUHqrd9Spu2K+YwEsLuix+w3hnq1J92jknOatqq9zAgwfpG/EQqRq/zjquchFwE3dVjFatpo4vl8snL2YmxWDo+WA/wAoP6MthkGEc9krOiBbfkSCEmshwLYkDoMgc5Vy05y2FnQy01cnyQIC6qpFT7qKJmy7c7+2dEIedUgL3bOtgGnLLC67R2mnBmXMy20ejbqFTwq7Nb8mv1gIoSlq9OkG4GJNQk18NXXuIzeVvXWYAbQyy+BtRUQehP4yisfOt8SSPUSzu9TX+gYHO37kxepDlCr9UWhf/FD3c+CsCs4Hq+3XZPJeUwHKgvjDhJB/v2E1cyO15ohTrLkw9xuK7dYgfC/Rlc9g9zIZeVMkQXeSSfmioMz31rHDZMI1C3SPS1tPegPWNKHV9N5YZTNV9kG2R1xbgfuA/rGunDQeX9bLsfqqPgRx7o2iMSgUr4BkPkOCt3rn+yiHN3Wkc9j/wHRlV0GlYYjm9ZZUSqEQdhPi9TudLYFosNz4M7YevCF2kb+WjPop/svKOmPJajExhsF1sES4SjXu8oyQK5q1ELK1kYKEBrlsXp+qE93fu8YWS4tYze9S2BzckrbFeEVf8MYvnDMV3hvgdtlNdn1eh9NOKGyzpIlgre3jrTx4sVrd/JALbPO3K1FiIgnuOVfl1HKbQ31zeL1HFIBDHvQO8CEoW1IJRLzqt1bObyBGByjmakaybw75uwzu9dy+Fl8VFVUwXRCJtjVjDqRLd+rg0rR9x+SFGqKfPGmyT8JMbFrMQZM+s6WbX7y+UHVjZcyv37K3MAywd7kDKvKepwifDDz9oPwoFFYJKTcW9+A2wIkZnm8clOa+YddQB04OP/3Vey07mtFXAmdwsRFN4Sr/qXDXKB1MQTX9RZWEOnLcI1OMlx/vuWW4SH6uY0Oow= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(376005)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:48.9722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14741a7e-9fcd-4683-0424-08dc7f22a144 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9188 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea The function that releases SHAMPO header pages (mlx5e_shampo_dealloc_hd) has some complicated logic that comes from the fact that it is called twice during teardown: 1) To release the posted header pages that didn't get any completions. 2) To release all remaining header pages. This flow is not necessary: all header pages can be released from the driver side in one go. Furthermore, the above flow is buggy. Taking the 8 headers per page example: 1) Release fragments 5-7. Page will be released. 2) Release remaining fragments 0-4. The bits in the header will indicate that the page needs releasing. But this is incorrect: page was released in step 1. This patch releases all header pages in one go. This simplifies the header page cleanup function. For consistency, the datapath header page release API (mlx5e_free_rx_shampo_hd_entry()) is used. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 12 +--- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 61 +++++-------------- 3 files changed, 17 insertions(+), 58 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index e85fb71bf0b4..ff326601d4a4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -1014,7 +1014,7 @@ void mlx5e_build_ptys2ethtool_map(void); bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev, u8 page_shift, enum mlx5e_mpwrq_umr_mode umr_mode); -void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq, u16 len, u16 start, bool close); +void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq); void mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats); void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 1b999bf8d3a0..1b08995b8022 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -1208,15 +1208,6 @@ void mlx5e_free_rx_missing_descs(struct mlx5e_rq *rq) head = mlx5_wq_ll_get_wqe_next_ix(wq, head); } - if (test_bit(MLX5E_RQ_STATE_SHAMPO, &rq->state)) { - u16 len; - - len = (rq->mpwqe.shampo->pi - rq->mpwqe.shampo->ci) & - (rq->mpwqe.shampo->hd_per_wq - 1); - mlx5e_shampo_dealloc_hd(rq, len, rq->mpwqe.shampo->ci, false); - rq->mpwqe.shampo->pi = rq->mpwqe.shampo->ci; - } - rq->mpwqe.actual_wq_head = wq->head; rq->mpwqe.umr_in_progress = 0; rq->mpwqe.umr_completed = 0; @@ -1244,8 +1235,7 @@ void mlx5e_free_rx_descs(struct mlx5e_rq *rq) } if (test_bit(MLX5E_RQ_STATE_SHAMPO, &rq->state)) - mlx5e_shampo_dealloc_hd(rq, rq->mpwqe.shampo->hd_per_wq, - 0, true); + mlx5e_shampo_dealloc_hd(rq); } else { struct mlx5_wq_cyc *wq = &rq->wqe.wq; u16 missing = mlx5_wq_cyc_missing(wq); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index a13fa760f948..bb59ee0b1567 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -839,44 +839,28 @@ static int mlx5e_alloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix) return err; } -/* This function is responsible to dealloc SHAMPO header buffer. - * close == true specifies that we are in the middle of closing RQ operation so - * we go over all the entries and if they are not in use we free them, - * otherwise we only go over a specific range inside the header buffer that are - * not in use. - */ -void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq, u16 len, u16 start, bool close) +static void +mlx5e_free_rx_shampo_hd_entry(struct mlx5e_rq *rq, u16 header_index) { struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; - struct mlx5e_frag_page *deleted_page = NULL; - int hd_per_wq = shampo->hd_per_wq; - struct mlx5e_dma_info *hd_info; - int i, index = start; - - for (i = 0; i < len; i++, index++) { - if (index == hd_per_wq) - index = 0; - - if (close && !test_bit(index, shampo->bitmap)) - continue; + u64 addr = shampo->info[header_index].addr; - hd_info = &shampo->info[index]; - hd_info->addr = ALIGN_DOWN(hd_info->addr, PAGE_SIZE); - if (hd_info->frag_page && hd_info->frag_page != deleted_page) { - deleted_page = hd_info->frag_page; - mlx5e_page_release_fragmented(rq, hd_info->frag_page); - } + if (((header_index + 1) & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) == 0) { + struct mlx5e_dma_info *dma_info = &shampo->info[header_index]; - hd_info->frag_page = NULL; + dma_info->addr = ALIGN_DOWN(addr, PAGE_SIZE); + mlx5e_page_release_fragmented(rq, dma_info->frag_page); } + clear_bit(header_index, shampo->bitmap); +} - if (start + len > hd_per_wq) { - len -= hd_per_wq - start; - bitmap_clear(shampo->bitmap, start, hd_per_wq - start); - start = 0; - } +void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq) +{ + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; + int i; - bitmap_clear(shampo->bitmap, start, len); + for_each_set_bit(i, shampo->bitmap, rq->mpwqe.shampo->hd_per_wq) + mlx5e_free_rx_shampo_hd_entry(rq, i); } static void mlx5e_dealloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix) @@ -2281,21 +2265,6 @@ mlx5e_hw_gro_skb_has_enough_space(struct sk_buff *skb, u16 data_bcnt) return PAGE_SIZE * nr_frags + data_bcnt <= GRO_LEGACY_MAX_SIZE; } -static void -mlx5e_free_rx_shampo_hd_entry(struct mlx5e_rq *rq, u16 header_index) -{ - struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; - u64 addr = shampo->info[header_index].addr; - - if (((header_index + 1) & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) == 0) { - struct mlx5e_dma_info *dma_info = &shampo->info[header_index]; - - dma_info->addr = ALIGN_DOWN(addr, PAGE_SIZE); - mlx5e_page_release_fragmented(rq, dma_info->frag_page); - } - bitmap_clear(shampo->bitmap, header_index, 1); -} - static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe) { u16 data_bcnt = mpwrq_get_cqe_byte_cnt(cqe) - cqe->shampo.header_size; From patchwork Tue May 28 14:27:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676913 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.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 1B36216FF44 for ; Tue, 28 May 2024 14:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906594; cv=fail; b=AWZ5nNX6Wq+TMt9iXCoAegBrX+dGfoc9LxC/y6Df3YWXBzLM2BRrQGdM91qXij9YD1wCPKcs0aMN8pjaUA4fSyfKO74smD+a6pJ1UaIzHgKpw1eTOIrdVrGujX5zVJr+v/EqQf58kYA0pq2BSG0amS30YiN+cymt9npAdeRlCeY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906594; c=relaxed/simple; bh=eCbjVl5fYJuHGs/Pz9iO7PRDQH7zGOK/i543bCTkxZc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UsAsoiTl/G9M+BQR5tX0nGTGLUfDB+oNVRblBwgtMJoGp9Vx6JE/z+w1COzDJlTCkI+JEEzURAac4ME4X329f2Cw9/Pt6TQu1F6I8ET5obLN1vPEl6mNOfUSsVLgGprKARngcRoFz6nksp5c/HTHdTuKCFZTqC+rXeUsLThmgzc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=KvIEM1ww; arc=fail smtp.client-ip=40.107.220.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="KvIEM1ww" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WuCVS5Rfi1W6ncvZPeeJjmxsKTV+7ey5zAekFMcyfVhvcb4E9JSUjUugn5BpkY9/GSBoUzoAuHo2wET7bwyBsvhwNR1KOj6VZJ2qoA0FjaxK/TFZa/OQ1Xp6Wp27UI3jjl02gfAga3Lgfzrje1R/oEF+2zMu4oVAU9DJkEZPEE+Ci/QE4zZ7ZoQQR86GpnGuHQySoaDotbCdxTP+X0qpO+hskCuuxq6+Iy/4kzQ49dYsyvL/eMh/AbP7EtuhEzMVY0uN9Yy7a4w5LhhLQYcJ1mjgAOjw7Gfgm/kY0acupizsQwtJtGtzcxisN0kWPViYrCCJUvWapy4hHztr9wN7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=78HNFGikAJdJ2/MQJMKd1hGexFtdvWKPuARHEsdl4ZA=; b=j6f6HiPGqjOISkTX6qbUjnOlQZnd2qZuC73YusU8P1Fqh7IF+2MjSbb+gFflJrJESU2VKIl72GglbxYFBqHxJAtPSqooKpIOMMQDqrkUvlDPVEDlf3tm7JP1eu2dOToL4hSqtw4asUun5M6d8HU1c0wno5S2WtTwfqosfqzDSoEre4JPNSjny+fGaKIop4WoVdh9N8N61S/UP+GspOR/30E3LHy6V7NXfIH2qcB2QcVA+ixGPaG0XlASxe3cIzTCgrqO3zruy0R6bLQCaEhFZ+m7TwdteSueGNKXg9/6U/yRITVLGXQr8U6nXAcj84YXfseTBabrDEx2i6Nu+PHzPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=78HNFGikAJdJ2/MQJMKd1hGexFtdvWKPuARHEsdl4ZA=; b=KvIEM1ww+MLnuLkyHm09JCPfj7tq7zDqIj3xsyjxcoeaDSN5203vaheiEMrg/8iL+GjQgxHCzIjLOctqpAnfbC5XqTpD5JmMxq8hat4zcN5hEAKAixSxMAmNMfHqMJpCkoMI8KfOvrcQ3d0X5yfHOj3uB83XBkZ2BhPP5mtyAKPAOr+5FJtDT0rQeORwyq77W2ggdXGXiZOHnMx1V7ogn2124zKsLDThyqbY/olZGczQmxoz60xQbCentNr+mj7NCR0AbRrDzShKPD7OFT65ej2YuHNJkznOy5b8BwHFAnAEKmT++aogebKTbL3kyjogOQqTa7w1MhBnQ1M3mJmyhg== Received: from SJ0PR13CA0104.namprd13.prod.outlook.com (2603:10b6:a03:2c5::19) by SJ0PR12MB6853.namprd12.prod.outlook.com (2603:10b6:a03:47b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Tue, 28 May 2024 14:29:49 +0000 Received: from SJ5PEPF000001F1.namprd05.prod.outlook.com (2603:10b6:a03:2c5:cafe::bc) by SJ0PR13CA0104.outlook.office365.com (2603:10b6:a03:2c5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.16 via Frontend Transport; Tue, 28 May 2024 14:29:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001F1.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:49 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:19 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:19 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:16 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 07/15] net/mlx5e: SHAMPO, Specialize mlx5e_fill_skb_data() Date: Tue, 28 May 2024 17:27:59 +0300 Message-ID: <20240528142807.903965-8-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F1:EE_|SJ0PR12MB6853:EE_ X-MS-Office365-Filtering-Correlation-Id: 250c3300-dc71-4ea7-89e0-08dc7f22a1a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: BXe3XxGhNZYBelJuKMiDO/rGtpFgBcMJKTghpcxGxI6WrndHrAU+FKxsIWsrxJT4EtcOeMugDB1E28Q/DhpjH/8wDPMRct4xJ6W/PiSBSj7YEu10mPH+3FauM8rWI1+Keudr+Jzob2bT4jm6GGJctdun7HGA0/vqoRS5KH48qtISVXktjlXEG3Bn6e8BmMDxhGCqGo5a0SwyBLrllI/G1MNiefmb8fRwSyuUcntddyONYnMDt9lLtlR57Y8hu2psWfdS3hRZATVexgBlKG5/WwnDClBSIz3s/jMBe/K1gTGrF+dKiF41UsV8V9alkTq4JDy+EIRcyqEi4uI2mwCdTidrdcBkzqXi2qT/bnF4DFbGBJ7y8tIv8kNlx6MoKnfb5K9TFq0IdAW2RNIBylo6lUX2QEGzQ6NrNP+1c/WMH1Nf+ObpRZl6lKqQynkp32mMZYR3kVUHIxBr4uyrI64Ie3JMiJ4+L5dpukpIlQ78Cl9iDnhZxIq/ktkDG8PFedgBCHWIlpv/6SvFPjteH89qZZlib5lFpiwkupxY/ZKOVVeeyRv4qjolqeDGuubrfbwybWf3hCx8PGrdh53h+SBv67y/lz9UkJOtwJ+sDM1l8UGaW+ZodGqzw79Rdnm/ST39rvGdimKIGXb3qps2KfNbcJXu3LTYotFHURHHFJEXoZTSAy0YClkQUXMj7c138Tgm3uaEPI2IQqwuB273Xka9mIYQZarXwUlkNkkiMcqWFok0gDQuCCtxDLg/36IDSjKsw3mcRBnSLsF9iiF9y9JxWHpVrhgm3WFIF1lrCZ20DshnSpSG8Voz8GpuiWGhYTCwA6Vya2xS1RaP2us8yA3R7cNzMikTVn/meW96ZpiNwXOp7YqYxMhMRd0JhCk0dWClkRiDDlK+zh8SEAuNpURg0K++w1LGINkV46lQnsYqO3QBX9M4+XgimObyUzhxo9Jd7qcbF2YTRiq2UeHZctDThJunPi/HisUC6WRfeAD9h+OL+vC2bGYWHZcCwaDBgNhTQEVZcBINs2H8HMrdoAgT/LTbJUbU3m6jqTWT/SKDc0HTvCIE98aIPUtgUOKPL5IHBRKN5IDP2rd7StAH7eqa9xK0iCcpb9KGEvsMkk8bnWISB+A4omx3eFdbNRTOrtEpQ8RLWgD2chvtrhQ9Fg8mPQrhJAZupwu0W1iiu7L2q7iETH2Bin6OU12sZg9uOiSpJQZHaprIU5mUyORDL87DASY/j663HH5FGuiNZzKkmtd/atS2+5AgcASIgcymfER2IGw1qi2i0Uy98evwCiCUN06IHFb0/wDcUOUi2YxP3SSKq32vZyj+71hTWx276363Prc3YvO6tBMAOdQWASvYgR/sKihJam5ddTcBGZAOdUh6XutMjS6H1K2EFoTD03Mz X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:49.6113 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 250c3300-dc71-4ea7-89e0-08dc7f22a1a5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6853 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea mlx5e_fill_skb_data() used to have multiple callers. But after the XDP multibuf refactoring from commit 2cb0e27d43b4 ("net/mlx5e: RX, Prepare non-linear striding RQ for XDP multi-buffer support") the SHAMPO code path is the only caller. Take advantage of this and specialize the function: - Drop the redundant check. - Assume that data_bcnt is > 0. This is needed in a downstream patch. Rename the function as well to make things clear. Signed-off-by: Dragos Tatulea Suggested-by: Tariq Toukan Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index bb59ee0b1567..1e3a5b2afeae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1948,21 +1948,16 @@ const struct mlx5e_rx_handlers mlx5e_rx_handlers_rep = { #endif static void -mlx5e_fill_skb_data(struct sk_buff *skb, struct mlx5e_rq *rq, - struct mlx5e_frag_page *frag_page, - u32 data_bcnt, u32 data_offset) +mlx5e_shampo_fill_skb_data(struct sk_buff *skb, struct mlx5e_rq *rq, + struct mlx5e_frag_page *frag_page, + u32 data_bcnt, u32 data_offset) { net_prefetchw(skb->data); - while (data_bcnt) { + do { /* Non-linear mode, hence non-XSK, which always uses PAGE_SIZE. */ u32 pg_consumed_bytes = min_t(u32, PAGE_SIZE - data_offset, data_bcnt); - unsigned int truesize; - - if (test_bit(MLX5E_RQ_STATE_SHAMPO, &rq->state)) - truesize = pg_consumed_bytes; - else - truesize = ALIGN(pg_consumed_bytes, BIT(rq->mpwqe.log_stride_sz)); + unsigned int truesize = pg_consumed_bytes; frag_page->frags++; mlx5e_add_skb_frag(rq, skb, frag_page->page, data_offset, @@ -1971,7 +1966,7 @@ mlx5e_fill_skb_data(struct sk_buff *skb, struct mlx5e_rq *rq, data_bcnt -= pg_consumed_bytes; data_offset = 0; frag_page++; - } + } while (data_bcnt); } static struct sk_buff * @@ -2330,10 +2325,12 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq } if (likely(head_size)) { - struct mlx5e_frag_page *frag_page; + if (data_bcnt) { + struct mlx5e_frag_page *frag_page; - frag_page = &wi->alloc_units.frag_pages[page_idx]; - mlx5e_fill_skb_data(*skb, rq, frag_page, data_bcnt, data_offset); + frag_page = &wi->alloc_units.frag_pages[page_idx]; + mlx5e_shampo_fill_skb_data(*skb, rq, frag_page, data_bcnt, data_offset); + } } mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb); From patchwork Tue May 28 14:28:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676916 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2042.outbound.protection.outlook.com [40.107.92.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF0C016FF49 for ; Tue, 28 May 2024 14:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906597; cv=fail; b=XWEWHfNDkJw8J4PdsIm/FSF+wE9mfbWJHNbRVXTMjqbfQGARkUlo+167sUXmlIfiUNio/ebtJknTPHbV22wgGVKaNNZic6gAvvSn72iJWQy7oncETzJaGLNHy2mtsOPImFY+1sc/ho35G13qpm7ENzIVBcX43D9sM7uMEGISumw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906597; c=relaxed/simple; bh=hrF/mVUx0dJgBtaexHHloiztYuX6/SNLO4D0tXhHo1k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fb2L2sz23dETEjSufuJQ1kyajjHr9NxScv6ewOpF7wCGf5MQ2R1UdgEoIG8F6Wk4jepVG3H1EVwLblKYI9ZCqzSGZIpXUc8bj/gXT4wNbP/0f0FZX8Ffp01W0o8lx3uMT3wDaD5y1eS2dhkVMW9DfXSA9R6I1hCR3qdqLLh1FVU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=fQc5Zobo; arc=fail smtp.client-ip=40.107.92.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="fQc5Zobo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m5BEhS1vQjR5gOKSQ2yCwCr6QVNiBcjTL2oTknRPUzoksE4CW0uuPucNluqrnmvct0MtHgcHZ9Y6b3UiCTflgXWwoazJ284cjeQz+S9pib2RR6Q0l8FWayTjDiYkWx2PP7hHFlEhFKgwC0dEpIozHj0M0ZkG1BMnJNjnGJYWUrtq9ql5nKjy+1kG//L/jL6YylQ5AT4GIV2uB88vMVGiVj1P8JdoiQ8cBhBQGH1gRvbuh868/GAUEr+al5uQ32SF11hZCu70W7RVnNuv3nFvE/Xfq0qH0CsAz9nEOR+INgS5JC7BTOdBi8C3rBHDdmgHKbrCQ2f6uuQzzUBFFpKCaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8/ZHt7/l7K8lEZ7X5hQj3OPKHMubYz3lZb52HYmDlDk=; b=EZvpluTAaIoEX44DeRokrGQPOc5h0amN0nXocEPitzNMsCtJC/UM7bdFTNghNvRlnu5My0XQjqYiXKqroMB325gcjgpfulzJg8icllkdWqAwdZSzRcMdGbTm7LHyrf6cPfTvc3AU8pw24xtG3tuS3DtvQQ9ceEVhcxMwXAs2kZ8k01RKqE41qUS43o5MPHM92ZvBVb+0LSI0+NcMOYKQDg8r71owKH1I+X7LBFMTfnjM1fb6Jt9Isneu9SBGlXEtMykhjrKaw26wkBL0QpvkHFPrA88stxBTKCEM52FMXY5t4IAXERfYzq65PLpxpJQEDOpPuiXfQ9XwDpGH0mDjTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/ZHt7/l7K8lEZ7X5hQj3OPKHMubYz3lZb52HYmDlDk=; b=fQc5Zobot+7t1kyL7YrrQhN797n7P7wC2YvqzT5+Zv0TyLme79paXpXCe0mtgW8Wa/kljRuCXejCRnSR7EqHIcxxewMXXqLdtFBLZn+IZmSxzythr30iF+JF/klEQ0BtUrdP2RBl9cY7mWJ9urVYqoLyHPjO25wAI+gBySicuAFkpyOQGXDM3v4UbtoJW5dwwryetGfHcldDaafBcWgevAgHQgXuWCN6H/Cq3GELVK1Z1ZXIB58+fRtDereJe+dKg9PcPDSOzh6Hi7Kh14E26ALXFMInRhSIrXIdb4N+K1gLgPB2BclPsQYWY+3ua/LhW97S4Z6FRmjoQsXpNTg76Q== Received: from BYAPR11CA0070.namprd11.prod.outlook.com (2603:10b6:a03:80::47) by PH8PR12MB6865.namprd12.prod.outlook.com (2603:10b6:510:1c8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 14:29:52 +0000 Received: from SN1PEPF0002BA4E.namprd03.prod.outlook.com (2603:10b6:a03:80:cafe::cf) by BYAPR11CA0070.outlook.office365.com (2603:10b6:a03:80::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29 via Frontend Transport; Tue, 28 May 2024 14:29:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SN1PEPF0002BA4E.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:22 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:22 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:19 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Yoray Zack , Tariq Toukan Subject: [PATCH net-next 08/15] net/mlx5e: SHAMPO, Skipping on duplicate flush of the same SHAMPO SKB Date: Tue, 28 May 2024 17:28:00 +0300 Message-ID: <20240528142807.903965-9-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4E:EE_|PH8PR12MB6865:EE_ X-MS-Office365-Filtering-Correlation-Id: 341eb793-8301-49a4-5832-08dc7f22a2c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: CFJx/OWfxReVReKjKEiMhen+76Ot9Qy34kEs6FV2Rr1refzQov+uZrHDxcHv2yjrQMAJkh3Sxw1NxLy3SWQexskSNC1tNyx9OxPWMzH+Nu9coyESFwrCdm5sA6fETLsLcGlsxt/l37V/OJFdugJdZ/F39WPftCiOHT0uH4FBW2CPOBWboghGRuD7gmYLizIYm6JDaw/ArM6cV7uGu6tBQHOpmGfZ7mB24Vqd9R4co8qrod7c6/gV2IH/0pvJ0uwdD/PgD2x1tVDrWo+/O62r9ZRdo0zBVoyPfPgPZPEwwkzivA4uUMU9LO3EhIfBQCON22QmVw0nCuipIWrCCB0iCbNAfm0OauKxv70/3ip3+cOc3ym2o0ULnAn17MDcuVU+E0ZTDzuGr0THCuSvwr1XAPJNuvvkTaqPQWQQ+rTnlmA4v/ythQFxN3i1RbfLBTLK0V4yN1RlHg+AM76c/mainXVscQDPbp8ys2ka8I4TkZDEyGY5GCyAI0eBZUAFg3zsFpNX1X0mKeihmnKYhLXCY0kCDx7s0IUSMVKvmLgbudNIWVgf4qmIjCjNx4q876vdPKsiiWecRhBEqle55Ab+KneEiaeZa4Md5tcerSZnu4OthrBsEHujUdKxj+5ajXhw6u1qhOuz1UFc7ucl0XjE2np8wd8aEhNir2KP1ptfKeE4o+L95pUJrkkgqZk4pQviVVoHjjolFLk2CNqmq5fGGvRo274cHdwxl2gPNzi2tlczmXq/BStSDNu9Ab7fIOUdI0xPw4nrRJNXrcqa/+IkD2y0WWTzs0IIZqIYxVHQdum3X8yurj99GeKY/ST7of3vxWgCHNKHlYDw6fty/OBI9CP3yKHNcpGkpaYQuqypv4sODI/zCS4b2N5EuePQ49+7qRbN8mAstJf6DBkPBtj8PYpdrU7gDQctdnYijelUSnm+63lsB+VYKL3WPhuL94d3b0I2tFkszeG0kbhegk0e3ULjD6rG+v5Tq57pJv6Ui3Gf3Vw8DAler8XJHMntka6+upA0zeuCnk73sUd6S40AKj0aTwpatuKlIepxBrGPhDIX1PVmbaE/r/ZuN0Ip+kfMC0sO5n9pF9bIcyJVJ0gRyMIAm2Ia8VC5jtfwCv1WUcm580mer8A3fgodiaLynDXuX911FHfjFEyI80n9arJ6b4+xd4ThFYAYIf+/kwtPpKYknTQEEs+qsZRHAeEOZC19ZxMr24i6SHfLogw75oD6uXPYDzb4do4vmFnofG1h67L3C2TNDWXKkFRExtw1YJzgTI3/QWDEgfCT75IWUEq8zeFQoueHmcgLtujhltUGtzF37sUvxTsSOGbhXVKQYJDE5FdDEl8uh6Kpo1EBwUhEtt/708fqU+/wKf9lWWEVtmrA46y6TPWEuV/kUB9SryQ3 X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(1800799015)(82310400017)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:51.4819 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 341eb793-8301-49a4-5832-08dc7f22a2c5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6865 X-Patchwork-Delegate: kuba@kernel.org From: Yoray Zack SHAMPO SKB can be flushed in mlx5e_shampo_complete_rx_cqe(). If the SKB was flushed, rq->hw_gro_data->skb was also set to NULL. We can skip on flushing the SKB in mlx5e_shampo_flush_skb if rq->hw_gro_data->skb == NULL. Signed-off-by: Yoray Zack Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 1e3a5b2afeae..3f76c33aada0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2334,7 +2334,7 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq } mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb); - if (flush) + if (flush && rq->hw_gro_data->skb) mlx5e_shampo_flush_skb(rq, cqe, match); free_hd_entry: if (likely(head_size)) From patchwork Tue May 28 14:28:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676915 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) (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 CFB75170829 for ; Tue, 28 May 2024 14:29:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906596; cv=fail; b=ip0Vb71EV7C2cXmf+HF8Kt1OzR1OffNTbwmIeJ1uyBa0yA+vM5FOEulNzuQZICmUr1XoCKeXsHp/88YQLRy++OTyhQ96hWeQlbNdfa9CRgKdQo/numU6xyjv1JhSKcbHn5CxobB/XqirYYHbwVPyULPg1aqVd5b2dYe5zFXTBgA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906596; c=relaxed/simple; bh=oJNpJMayAKO0d0ELkKS0eGil9awYNl6aE+oc0a5m53A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WWi70SaKKvcklJ3euDgAqmZiL7dwjE8rcSDBeHhN1BR1tZmLf4iUUiYqNTYxCcGMjaIGerUz939sFpmXDVln06Bnb1F5aLkeCdk/jBdq810Jor8Yi/3Pd1nXFsGkA7+zeT1R9kIwSNHu2GX1CBzr53Fg9qqMeNPiSfwoJhCp2N8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=lzM0rPtG; arc=fail smtp.client-ip=40.107.223.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="lzM0rPtG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WcMGyAwjhaCt05MhdE40z3oopbklDTiwkkowkAp9qvYv2kgTqcVvCKU/BEH3X2AuhG1OooecZ4YU2tnjv6nTC4sWNPOnSOJsZrYuxh3JJHdLrSFRqoIrZJVm/TS8oOeX5605LiB6/SWLaLUlIBiWU1u8YSyD7uBqyk5hal6IkqqBY57nW//99ltuN7BiRk6VEE5GkZNJrTo/rgyHHgc32eoTw2NV0QGdJuYI/EhTp5h7kwYj/myQDSZOrnwvWgKqSrmz4Ip4OaucfQkDtGn6KXD708OUcONXcD0mC3bP9XUjVyzrioitDeXS7OfjqqMOb4g0MFFDZ/9Y4tICZy1pVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VmtYY/oCyQ0LId6zzQDu53s57+h3r7utMoJwcmOToPc=; b=IM+NvAAhdZRuK5VpHt6moWRYPN9UhsqGC/UONiXe62gWNBeWuu8NPhGKlNCxj1SE9uqsWzcNIZQbn42aMzAVJlMBN8fcv2CrrPISFKxh2lBkMZ3cpZLV9SowzmIRhGob84gRSN8xiptwLjvLRC29AncO7wVgPzyxFoO7+xHT8SQt0XU/Ep2sOplioBukWAEu9ViFjeyKHnywzYpV8358nDFgXgr2Nr+dAuR5H+NejzeWWiicsyCTiASoLmgwpDlyDTRzKb0HIKYLWPbScArA+3qeF2LcTD9NyyrVhMwgGFv6kLC0A8f+UFJ9ktK3tf92lWBHC7maThLNevdQq2fW4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VmtYY/oCyQ0LId6zzQDu53s57+h3r7utMoJwcmOToPc=; b=lzM0rPtGnGwkehet19DylykkFyJLMT3SBcBBoqh37l619D4dMSQxTw+u+PfNv4F0r7IjHgWcnSGU9KKlze6TYzgAh+d95rgj3vS7nc5FSLdx+NtgofQ6pNQt9KkNVo5S7b3/MB7iExzycFFbesD2B27Jm2a5IP9qG6/fNBb8pWfWJhnqrLxEJYC1LvXRCyJpBXoC4t0cE2YTSVv4+fzjk/r7vV6pZnvDGo5SslZsu76t7aCyWvfScRRh5ZaGcx0fWMpZUkao6//MH0iLUy6pawp7xB4AERtD27oxNochup+oN4OpFLj1d2LphcMwIXSKqqo6Zzarm5XF51w4pdFuCw== Received: from BN0PR02CA0014.namprd02.prod.outlook.com (2603:10b6:408:e4::19) by SJ0PR12MB6991.namprd12.prod.outlook.com (2603:10b6:a03:47c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.26; Tue, 28 May 2024 14:29:49 +0000 Received: from BN1PEPF00004684.namprd03.prod.outlook.com (2603:10b6:408:e4::4) by BN0PR02CA0014.outlook.office365.com (2603:10b6:408:e4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 14:29:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004684.mail.protection.outlook.com (10.167.243.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:47 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:25 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:25 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:22 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 09/15] net/mlx5e: SHAMPO, Make GRO counters more precise Date: Tue, 28 May 2024 17:28:01 +0300 Message-ID: <20240528142807.903965-10-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004684:EE_|SJ0PR12MB6991:EE_ X-MS-Office365-Filtering-Correlation-Id: d1204822-348b-43fe-de91-08dc7f22a05d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|376005|36860700004; X-Microsoft-Antispam-Message-Info: okfUJ1V7k8cEaevHmDBoMLp/LryusKybveHlF/bJ8Hak//fZNCjFq0XiS9wJzTFaEXYrLDJgo7fyIeATJ/EQHvgfyQ/3viacbWT++jb6c5l683ixLAuLdk9lrKniiSvWwKi+CcLL7nNXMl6ySdyWaJm4rY6p7KdKJFA7pGxfusUSyoW+B6kxeDah0ZlB7wsi8eQZdzmevEhqpgG57HnnhByZehpU4wMRg7P9ENkCHgWvPIzI8HkhM301SX9MQou7RE3LERvRq21ceHxe2s/Ty0b/aGagtNxHE6UhC0NN0PMfsCjcOTzoMPGGwJ+mnGqViRz/ONGFs14Uk/g/97rjBCXYes+q858scNB4qamNMz0d6Jl54AGrUuc6AJL+sX08S4fArubDzfK7Q6ufBe+YtFmTiq5nANyAASqznNv4XGIdIes2B7u/Z8MR3Cs+6sR+fG9jhZ/j6pX1LG2okmI8+TqHlOBk1ylmcLU2YKJmWp5VjgJlgZElVv6r8JGs5gxygNqtazDLsVUBLpU7QDt/yrP/7lFKTMDACbr3InlJy/yhZrAXCCF7kK+tZMww9SjvDPAIdkXWaN11fRS9v8XCZLVqoEQaA+RMb1/TS/SxSRJD7a1iehxSHTlo+dO10UnmpOWG6X+raJpqP+e90F0T3gzBOLQAUYdZoGPB2jY5uiZ3J6fvxf79JGnDKmW6QK7ggNAXQesKMlayAVF3tG7foNZLX1slSC4w90g/bcLQ9QXtVjLfk5xr4wh3/VgDRpvzCFP05j31Bw6MPa4B20xcpWcgIWa9w2GJSpTwbIzArfoQNxMiW679GdGZ8Abcf11IVfKCrGXOJ7E5VJ61lcpL8E4H40f3fIpXgmAEo/QEEG1iB5kFdEPoDrXsbaEjUBuDaij1Ov3ufhyDWnBvdHjARex5pZ+3xaohRtGOFrdDV3oHNdNngPGlgJqVX+1GqGKO+l2jJoaNqSn4KGq44vV5yh5gzvWp4GDw5Bldn/ziHzEYXkPLN5amvB9uctQuPv7nCLiCtIIIfQlnbkzOQtFD43sQKvcOJNq2z0OUP8s+cd2bDzT6xVoiDjKp2hCaZ9rtdLhsDXmR9CevVfJm3z4gr27duQAskmivy1BTObnZWWCCAODi+8drs4GzvtJM2FDa7xmua8teFSIZ0BANmJB6Xd5XiLYdPSCTbMwRtd/zMy5m8hJMtiP0nefR5KOFZr1acgwErVVqEtW0pVkWHyljBqF6w2v/QvIl2ep7gJcDWew77K6i3Acs7TPIXpJvqbDsJaMlkrm0J/VXpfo9wu6bxgtwNV0pwnlbTyQbR4/Kl/rJhaK9Uv8xbAIwXfkEuwbsu7dPA3Ph0gCj3SesHl6pD3HxDw59+WmQLUl1jbEGlvs= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(1800799015)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:47.3859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1204822-348b-43fe-de91-08dc7f22a05d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004684.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6991 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea Don't count non GRO packets. A non GRO packet is a packet with a GRO cb count of 1. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- .../ethernet/mellanox/mlx5/counters.rst | 10 ++++++---- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 13 ++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst index fed821ef9b09..7ed010dbe469 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -189,17 +189,19 @@ the software port. * - `rx[i]_gro_packets` - Number of received packets processed using hardware-accelerated GRO. The - number of hardware GRO offloaded packets received on ring i. + number of hardware GRO offloaded packets received on ring i. Only true GRO + packets are counted: only packets that are in an SKB with a GRO count > 1. - Acceleration * - `rx[i]_gro_bytes` - Number of received bytes processed using hardware-accelerated GRO. The - number of hardware GRO offloaded bytes received on ring i. + number of hardware GRO offloaded bytes received on ring i. Only true GRO + packets are counted: only packets that are in an SKB with a GRO count > 1. - Acceleration * - `rx[i]_gro_skbs` - - The number of receive SKBs constructed while performing - hardware-accelerated GRO. + - The number of GRO SKBs constructed from hardware-accelerated GRO. Only SKBs + with a GRO count > 1 are counted. - Informative * - `rx[i]_gro_match_packets` diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 3f76c33aada0..79b486d5475d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1596,9 +1596,7 @@ static void mlx5e_shampo_complete_rx_cqe(struct mlx5e_rq *rq, struct mlx5e_rq_stats *stats = rq->stats; stats->packets++; - stats->gro_packets++; stats->bytes += cqe_bcnt; - stats->gro_bytes += cqe_bcnt; if (NAPI_GRO_CB(skb)->count != 1) return; mlx5e_build_rx_skb(cqe, cqe_bcnt, rq, skb); @@ -2240,14 +2238,19 @@ mlx5e_shampo_flush_skb(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match) { struct sk_buff *skb = rq->hw_gro_data->skb; struct mlx5e_rq_stats *stats = rq->stats; + u16 gro_count = NAPI_GRO_CB(skb)->count; - stats->gro_skbs++; if (likely(skb_shinfo(skb)->nr_frags)) mlx5e_shampo_align_fragment(skb, rq->mpwqe.log_stride_sz); - if (NAPI_GRO_CB(skb)->count > 1) + if (gro_count > 1) { + stats->gro_skbs++; + stats->gro_packets += gro_count; + stats->gro_bytes += skb->data_len + skb_headlen(skb) * gro_count; + mlx5e_shampo_update_hdr(rq, cqe, match); - else + } else { skb_shinfo(skb)->gso_size = 0; + } napi_gro_receive(rq->cq.napi, skb); rq->hw_gro_data->skb = NULL; } From patchwork Tue May 28 14:28:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676917 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FAF9171062 for ; Tue, 28 May 2024 14:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906598; cv=fail; b=JaEjtEs4/OOm1upInxGKx/XgbPR0LJND8SaCEU7QZ3mPsNQuZr5kwx3mbm2aTIznjFxOd7GLQCrzx+RzwBwLF2rD9+QVKZpngfsPbQCEY9pIM1Re/CcNm7nTp93ihXjIvvEedu0CTw8f9FXZsEY/xr62Cduh2+aknHg5d1z6aW4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906598; c=relaxed/simple; bh=fmhjvCyhDNLJa/q5RGE2vaUk+UhKz4odZLC0ZVJa24o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kta4zZNzpllO7iW0GICOVNT0d/Gm087zrnsp2B0v1JKPEZVb4N3kRbB1iMXMO5+RLw+iTSzAxnEWcX5go1pdDRRomY5hvGXiB76habXdr3E5BF5uUIpN1RcbpYEyng5Z9HGjPPkdKr/kQ8aaJv54XM3oGTR9kmpQu2alcbQFQy8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=CahjG2Ol; arc=fail smtp.client-ip=40.107.223.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CahjG2Ol" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PwfbviD+Gg/ItTXsuQNwYQ9TCkghr3lk6ns2CtP4JMPrroLrq3qG8Tjp0CpK/qF+6knZ0H6uaZ64NgUoU4bmTilbSlZLWW//3E3gjBZkFYbOUmUFALk9P5ztoYcBp8/u7yd5viFJTXXAV8c+zfBbUkj8i6EZEzJ4cMXgKeVL4eUYS7R9w+HZU79n8RI4FIXlCD78rOwY8s0QbHgIezlsxmDakNSZMhnBzdTVCT57UxZpqdqLbzOQXPj7Bk4PGQhlr1PnE8/PGJllkUVhGbzvTcIPsc0evsHKzjOS4tqch67vNLS5Ow0T2+RRRUI1rnxJtU3w7OnFevA5wDgn3JdZkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jKOF4BLvLbodgCApJSrMtHPnJdNs81EBFkTKGdv9w3w=; b=DkaqXfvsP0ydxHpmwCLmuTuAse6l73cQJxesR/2z0RRpM58dZ7RuhdNtnm8tI5g2U1w4ig/PidQzvDN+RyDUNsJ9/4r0jM4fURb2yrapdyVuE5Q8MEncrVIDOtd+c8CpzFXiorYNt1sKguChC/2tI5nxV8K5cng5bOWXg7H5USfH8t4RZGdkd3hyRi8l2Ea8tlCvIv7+RczA049xT3BemZEiaZ+qulsydqgo/CfPb/e3F+CXzgv/7w2yVA0qhOi/FuzsTJGGDs6i6RG/1xp4FuqREUV7FQ+Lof2lY9iMs4u5jWr7Ld+XBXcli9khok1v7wpugVXe+SjSwwj8GtulsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jKOF4BLvLbodgCApJSrMtHPnJdNs81EBFkTKGdv9w3w=; b=CahjG2Ol05zU8oigL1mG2VMnWueIWWHWZLJachSWAyv01P8enC9WvcI/77ZM3OYKFm8qjnJG/V5qKcuMdqgj1PqbP9lVnjxFXcDZnIWZ7MQnB699bWwRVZ8VjzD8+EdpNQOP49dRqlQnEw0xavz/TjQr7ahXJyvo4CCnlZQoESiE6EvyEabofcSEr2sY9PGhiGG/Y2Mmc/z8CDHzrrMlUVIvndJLLt/G7fsQsns9Q1Zkp9w2D5LfXUqSmpnpCfNXR7aVOS2tYKMvkVfWgmR5XsDZ1XFZK3VmFtBRRV+hT7oRJPtxYg8298SBJJWH8NogIUdNfGRyGYvkyAkHq5pJNw== Received: from BN9PR03CA0171.namprd03.prod.outlook.com (2603:10b6:408:f4::26) by PH7PR12MB5807.namprd12.prod.outlook.com (2603:10b6:510:1d3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 14:29:50 +0000 Received: from BN1PEPF00004680.namprd03.prod.outlook.com (2603:10b6:408:f4:cafe::eb) by BN9PR03CA0171.outlook.office365.com (2603:10b6:408:f4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.31 via Frontend Transport; Tue, 28 May 2024 14:29:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004680.mail.protection.outlook.com (10.167.243.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:50 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:28 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:28 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:25 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 10/15] net/mlx5e: SHAMPO, Drop rx_gro_match_packets counter Date: Tue, 28 May 2024 17:28:02 +0300 Message-ID: <20240528142807.903965-11-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004680:EE_|PH7PR12MB5807:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e75b65e-7f01-46f4-1a58-08dc7f22a1fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: 1FEHImQUQRIQCvkqDktoPUBdBcabqrUWojur1DMNEyA3QhfVFDQmuAZt/okEADu00r9MFluYRiTxHK7JwqVZeoFhi3HAW337Bcf/qyU/2UZRYHRCRs9z0DR3IetSU99Whhc62tF5GcRSlVARGuCB3Sh6SUVdCzmggMdttkUWVzZYjGIYOTU6uOMdqJU6aJZ/D12Cse+lrGxbVxwwAyWaWppQBDG9V72UvrBPDbaYMQnhJ8sBG/B54PVYvx6mNXEEhbCcg4sCtoUb3AIQlwTPeAsu8qxJP8V/r/ooONtdWGtdSpU3ThuJRZnIqPp1hOjrrW6HBzLrlmFFf23Au0e1d7q/X42Ux9B+fTxI42p7RPlejds4RVcH2oRCQw8+glcqU00nNFZqBr+M/z9YM+6fwGQVN3QvUxcDKP05yvHGjH3VslAh++OqTpPvAB5f+78lMG1pOR1vYJ58F85Zz7a8jOBg4Qiu6xIyCp0o8SpTyRuv2rKaHIvvk6vbOjOGkqIxXKlCv6IhvhjVch1GNDyb4uuO038d+NgZmdP5RCeYvtwONcPi8AJKk+4+2OyUcRJC0GmNfrIltP5PmiMEoZyq8uH2+SazLvt4Pq6iY1APccCAgQ2bdR6ud20kGoZss9RQWBz6+KrF38eh670mB7PqvMwfh1oTa+hq/00izdPFB9qGrylg7WP7AbVUKQKugem1Q9VW+dq99L3gbgLJlOwFQD3+tbllMcKzPppfRoaS/nOV5uh6ECa/NLQ7P6knIlv8ZRc03ElP7vPAiBQ2XRn2dmbogn3sPxX+eb6w10fddzYRSE/N/qJkgIXP7aIra4YayY+AmI07Xnd1StaFqSQWjGbVm/pSWqqCZ3muldGxDd8MQxKznVBl41Pz4ad0bNqrLd8kZmHQauJ4kNg5rFqicnP+WuVPgqSAm6WhSvML2whqx1lclew42qoHiiCBtCA57VsI79UYbftQTqdsNjKqDbR5EHIgOWrCjTaQl9KMRkmGps5OAzYfX1ZiMhHP/g6iDTDX+LXLdHE46aqo5XyVmTRDYVW/SZ9NWf4vM3snuphTv8ce4e0taqPe1i3HkiwF8EnFH4JrrT8gUP5+wYjlCl5dK6rFyCn61HirPA3B29i5ahEwWOSTGhJZXlsPZgG4fZg2JWXGn3uyeN3LZkvf9dj7Ph0HeMWCUOiXluezxhNrQi2rMudpeTfEqnc7dkIgXN/EmlCLiT2j+VfJR1Cn8LS+tRmlGzOUpmPA9y9ppas+7CwWTF/sUHqaqzO5nvzPw3GVLoSv6iJum+6fPwc9pGnM+PG15zZDCvWJrGcOenISDHgLeDZcKLVbQvQyTcyfiL0D0LAUyG8qXXRO1ADmQywtgUIoYWT/73wDKwg6vJ8/CfzQEK2WDGMpvTmyTAkx X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(36860700004)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:50.0718 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e75b65e-7f01-46f4-1a58-08dc7f22a1fa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004680.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5807 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea After modifying rx_gro_packets to be more accurate, the rx_gro_match_packets counter is redundant. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- .../device_drivers/ethernet/mellanox/mlx5/counters.rst | 5 ----- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 -- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 3 --- drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 2 -- 4 files changed, 12 deletions(-) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst index 7ed010dbe469..18638a8e7c73 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -204,11 +204,6 @@ the software port. with a GRO count > 1 are counted. - Informative - * - `rx[i]_gro_match_packets` - - Number of received packets processed using hardware-accelerated GRO that - met the flow table match criteria. - - Informative - * - `rx[i]_gro_large_hds` - Number of receive packets using hardware-accelerated GRO that have large headers that require additional memory to be allocated. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 79b486d5475d..7ab7215843b6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2296,8 +2296,6 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq goto mpwrq_cqe_out; } - stats->gro_match_packets += match; - if (*skb && (!match || !(mlx5e_hw_gro_skb_has_enough_space(*skb, data_bcnt)))) { match = false; mlx5e_shampo_flush_skb(rq, cqe, match); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index e211c41cec06..a1657fad9a0d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -141,7 +141,6 @@ static const struct counter_desc sw_stats_desc[] = { { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_packets) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_bytes) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_skbs) }, - { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_match_packets) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_large_hds) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_ecn_mark) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_removed_vlan_packets) }, @@ -343,7 +342,6 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s, s->rx_gro_packets += rq_stats->gro_packets; s->rx_gro_bytes += rq_stats->gro_bytes; s->rx_gro_skbs += rq_stats->gro_skbs; - s->rx_gro_match_packets += rq_stats->gro_match_packets; s->rx_gro_large_hds += rq_stats->gro_large_hds; s->rx_ecn_mark += rq_stats->ecn_mark; s->rx_removed_vlan_packets += rq_stats->removed_vlan_packets; @@ -2053,7 +2051,6 @@ static const struct counter_desc rq_stats_desc[] = { { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_packets) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_bytes) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_skbs) }, - { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_match_packets) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) }, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 650732288616..25daae526caa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -153,7 +153,6 @@ struct mlx5e_sw_stats { u64 rx_gro_packets; u64 rx_gro_bytes; u64 rx_gro_skbs; - u64 rx_gro_match_packets; u64 rx_gro_large_hds; u64 rx_mcast_packets; u64 rx_ecn_mark; @@ -352,7 +351,6 @@ struct mlx5e_rq_stats { u64 gro_packets; u64 gro_bytes; u64 gro_skbs; - u64 gro_match_packets; u64 gro_large_hds; u64 mcast_packets; u64 ecn_mark; From patchwork Tue May 28 14:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676919 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2051.outbound.protection.outlook.com [40.107.101.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66511171648 for ; Tue, 28 May 2024 14:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906606; cv=fail; b=cDlPvjuAaPNMEpDlMWf1SV8+BPwcSU/f6cZXU3a9oObg47lp49ZGjUCIWe3339AUjI29l95F8R/A1G83n59as/bNrjmd5lVhr/OfaDGrQEWuLIAaFFiDO/bDo7rXfg+fKRiI8p7JuKHqhB/vmCi2OykfosPJAaTvfKlR6RiRaPM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906606; c=relaxed/simple; bh=jTrB6wR26s/wm3DSw4yZ+slRQQCz4msLtpHVKU59Cd0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PoeAxWkNFJWH37K2GBomCQv5pm+FPMvciRN57HB4YDjTipphaoNpPcavW4sHUXBeY9Zyy+Q8ZXTQunlPrV3qgdYWGzn1aKlOjIxHB/JhBThW5DZ0RoYvSmNFCwJRL+s4USXdgy627hxEz1rx4Aqz2PtwyoxUmKhf5Fr4Vx9w1RY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Crx1sW0J; arc=fail smtp.client-ip=40.107.101.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Crx1sW0J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ILX8E7oyjPIqoBEVV1Xf6ldyimdnATm3jldMgUauA4qovqsMdJmDJubJPhRWjV3J5vGZ6cKAj5sbYDZMG/yQ5SaG5RKDBvx2WKYbpkAD54+GinQA7SQraXaMsZmesR2mgcEFdA5Eu/z8CyAoFHvg6NAnSxzJunna+j1yuO0suy59IvRifT6GFtBJBknBF+ofU/qOfk+65pXkpp7dVD14Ou6CMWiximKhhUSvpLDkPcluHyIqTzkAFxIoQy+ZQwmhADyyfZZLJKEm1jsWCzOzva4j8wFiqEEvVFKAs5Tz2CPk9ADN6OMTtr0N/kwgvYRpagynsSFXknyvsmWxvGT/1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d3vusMPLkT5kV0VjiP4G/jXC/TbXDwV7AZXfoM7/tc8=; b=a0dI9C7y35sJf3O0fwcgRaMTpuqYb1M9wcIJ/FvnsaF/WO9/XGg/KkBLjd+775wyX8g620RXGgqsRlsJTxogG9DkqAaYjkBt2GIILZU3D2CwwEnsW8/GdIa7791L1wyKT+RrJunosp8bXriY+2oetmYr1f5ASXV8fsM4lpXf188NiNhlPYkFGRBBLy1GqYAy5FJBq+rMz7EZe+rsmthOvQ6HZVN6GZqDP0Q2M3pPnDwLt2FXQ8bJj+PFxIfwUU+ul9QyRtFzjNto68N7vsiHhgbZqg4naz+kikXy8j7VcDUnbJOcpVOwzW6xj6JdRnktEpgcwcHKv9eUP2ZBDqFUmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=temperror action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d3vusMPLkT5kV0VjiP4G/jXC/TbXDwV7AZXfoM7/tc8=; b=Crx1sW0JRGm50Felg5NunsZLryK4tWSqAt162nzeH4Q+s+QLsUF3m3NaglJZ3l14eHr2b20iOMVFDSw8UlV9VRLv1S0ocpjRCkEZe78NV/dkt9aVn99riAQKukBpAUjxL2xcdb1aOYjdbaYUx2vXn22cLzPYT9xTjCV78n6CVQI43Yrx95smidTwBRY06sgH/+UlesDXmofim4eBeOqlt4+kysLe4gChF+M05IsKLlOdUywKEam4ZNTcN53Bo4jmej9kw9/VlgCpY+/Qn8HUDZLXLEdMYJpA3jta1QQVsiVb83D9gJ9Z2Hq/158x3vdmR+bi2p50f4nQ0PRWcPhEjg== Received: from BY3PR05CA0013.namprd05.prod.outlook.com (2603:10b6:a03:254::18) by SA3PR12MB8802.namprd12.prod.outlook.com (2603:10b6:806:314::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 14:30:00 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:254:cafe::87) by BY3PR05CA0013.outlook.office365.com (2603:10b6:a03:254::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.18 via Frontend Transport; Tue, 28 May 2024 14:30:00 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=nvidia.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of nvidia.com: DNS Timeout) Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:59 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:32 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:31 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:29 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 11/15] net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split Date: Tue, 28 May 2024 17:28:03 +0300 Message-ID: <20240528142807.903965-12-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|SA3PR12MB8802:EE_ X-MS-Office365-Filtering-Correlation-Id: ee5c0e3d-63a1-42bd-6e60-08dc7f22a750 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|376005|36860700004; X-Microsoft-Antispam-Message-Info: VN7oSAV1dnOPAVA/Sj7s0IDmbcR98qHieueXHgIRCjiYFHTB5aopKEwUcLI161MkS0rdnqWWzY+d7E4JngC1fophMutoTcvC0CJcr3Z6hSuYpF4gGL06uDldY3HHkq63QV7GQ4UHSLC/lIczVx9VfsVYOHLqPckimB5L5TS0vHcMRKZX91M2H+mdHkWtHZ4swEr23ve6lddNKzOGIQOLsmKPqfmFFtEZxbKdrWbiNliZmFDutCD9joVDllFKEOqcFj8J6qDfhCBUgG4NjyNXYkXB0ZMYDG95DgYIbNBmVARN7EhVQ/XKt68XGyaJsAj/quCMXOfbmBpDi+rjJQdAQLkIYo5VUpDdQkQxhshBz1MXRYvglPEHfgV+uXxl9XEeYKoxNlHVLDDkUzash246lso1PFCdzBMCAFeq0U5mjRmPXhLRbifAqcRGwH4P6tUZkPs7JKwELJMHFn9XvXtMo/CrzyQvhPwnyAAEtW8h1GpotrZNvf3AQw/Se+HFN5R757hblHSKxv0b0CmO4Rbz4dlXpn0k2juCGKxniuNVlXt5day7QVm0XzfMXm4BtP7I+LLq6bmBcj+0Ge9sShTOABD7OqSqHE9u2qZpgWom6u5Beydyj1xyaIZ8hb5mPy+Wk6v/bQBr0wcbp+P3jpE2VfQ3mcOUzydcyH3UdXWXhsPeRWjFh9Ecz/KgrsIHpBQ+H297v6FT/TUwD5Lge7Fk1VoHH99UVO5R1jsEV05QOGCZqfVV1N0p1rqAZhqmXGRNNVmNOsfdreXsoL05L32UdQTd2ayrcezUjV0br6gnJZEP+Jaamdyta3ioZ8K32OnJf/X8DfVjhuKobVnceS+55B3HnwGosXoY0hzhhmA4ldByNseqYWHQipLXE6B4CF5rJFbjygckL90Tn7e0WrM+keqK3Vc1MWnK1ZO4dRXf5DPc5fOq0xy7K4OCeBe3l7R+foXWF2TNgZmQqI9optVSt7QyhFfHVpHggkuh45luIWsvNQFlPez+BeNorX9DP8XTTPZ/g9uUdhHcqhlodw4JhGshzqkhzUE2eVyPM6BAiFHtBIaxU2j+xRUYIpLDBZs+IaNvGXpLGnNmmZWtGuto27ObWnCIhmLGFdb4i3G/TOVATahLPsOqBM2n6uyvwH+dCkf8MTSNynjdhdts16fXAJn4Dbcw+z0+KJvU60yXEXWmDoNTdZexDATdDityb/MMHApwqMUDjRmrRLR71XqOY1HEtoBlqtTnGkegYmefqA1XP+C/D6QpMBjFVzSp/67hcDGOnYOxDK+U38ytLBb5drPLkZ3AJ0h1OvnFWSjJqD5waH0bdgmoUQgKhn3ohCrdDowJY3PjhnV//UZoaloV01k+6YQxFdBrtsWvMb+O9JE1XXmCe2F58lcbsO7UnSew X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(1800799015)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:59.1199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee5c0e3d-63a1-42bd-6e60-08dc7f22a750 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8802 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea When SHAMPO can't identify the protocol/header of a packet, it will yield a packet that is not split - all the packet is in the data part. Count this value in packets and bytes. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- .../device_drivers/ethernet/mellanox/mlx5/counters.rst | 10 ++++++++++ drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 +++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 4 ++++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst index 18638a8e7c73..deb0e07432c4 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -209,6 +209,16 @@ the software port. headers that require additional memory to be allocated. - Informative + * - `rx[i]_hds_nosplit_packets` + - Number of packets that were not split in modes that do header/data split + [#accel]_. + - Informative + + * - `rx[i]_hds_nosplit_bytes` + - Number of bytes that were not split in modes that do header/data split + [#accel]_. + - Informative + * - `rx[i]_lro_packets` - The number of LRO packets received on ring i [#accel]_. - Acceleration diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 7ab7215843b6..f40f34877904 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2332,6 +2332,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq frag_page = &wi->alloc_units.frag_pages[page_idx]; mlx5e_shampo_fill_skb_data(*skb, rq, frag_page, data_bcnt, data_offset); } + } else { + stats->hds_nosplit_packets++; + stats->hds_nosplit_bytes += data_bcnt; } mlx5e_shampo_complete_rx_cqe(rq, cqe, cqe_bcnt, *skb); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index a1657fad9a0d..96ecf675f90d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -343,6 +343,8 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s, s->rx_gro_bytes += rq_stats->gro_bytes; s->rx_gro_skbs += rq_stats->gro_skbs; s->rx_gro_large_hds += rq_stats->gro_large_hds; + s->rx_hds_nosplit_packets += rq_stats->hds_nosplit_packets; + s->rx_hds_nosplit_bytes += rq_stats->hds_nosplit_bytes; s->rx_ecn_mark += rq_stats->ecn_mark; s->rx_removed_vlan_packets += rq_stats->removed_vlan_packets; s->rx_csum_none += rq_stats->csum_none; @@ -2052,6 +2054,8 @@ static const struct counter_desc rq_stats_desc[] = { { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_bytes) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_skbs) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) }, + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_packets) }, + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_bytes) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) }, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 25daae526caa..6967c8c91f9a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -154,6 +154,8 @@ struct mlx5e_sw_stats { u64 rx_gro_bytes; u64 rx_gro_skbs; u64 rx_gro_large_hds; + u64 rx_hds_nosplit_packets; + u64 rx_hds_nosplit_bytes; u64 rx_mcast_packets; u64 rx_ecn_mark; u64 rx_removed_vlan_packets; @@ -352,6 +354,8 @@ struct mlx5e_rq_stats { u64 gro_bytes; u64 gro_skbs; u64 gro_large_hds; + u64 hds_nosplit_packets; + u64 hds_nosplit_bytes; u64 mcast_packets; u64 ecn_mark; u64 removed_vlan_packets; From patchwork Tue May 28 14:28:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676920 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2046.outbound.protection.outlook.com [40.107.94.46]) (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 83C8D171658 for ; Tue, 28 May 2024 14:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906609; cv=fail; b=CMfpEjybVNS2NxtG2dRrxrgZi+9dRDY0xoMPW76Xd6k+Ni9UX91cdj9F5iCi6DQTsvI5x1aAIKbK0lNq0w+ZzUdY5upMxMwKWiYS/KsBh4zS5rKKIg130Gk3D4uV/vhmbo2fiP60+b1p5ewntfPKke9x3nGm4q/84qNJAClGjsY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906609; c=relaxed/simple; bh=wFOWL5KavNLGN/WhqXExqOOyn1hlPLEpRtsMO7wdAnw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rmS6c+noba/C84gQ+moLe8cS5jcn57pt/B6DRWn+8KJhzd6krgXkXtWKX/pZKSJWKDrXqhGwqwe+7ALP8KD0JMEPV00mOAPQkY4Obk6cYEC8FmLH/8ei+qPh1KOy5BxlhhgBXTHJfQkHAqYZ+zC3kTfkPTO+8DzeqihXv4S54L8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=O7GDlhOZ; arc=fail smtp.client-ip=40.107.94.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="O7GDlhOZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=muWsqBsRd4h9kr93+SvPczvLwT3wF7WgL/j7yIl5JQECRGFlfFJZj4aAo9xJWQJSNOBRtG0tv32pHuuUdmdEPoz3uPrqT8s1eJYVQWjdNOgr931ToVKH8CgICKDw91dcAhI5oHRrRLEunm89IA/G5DNRH5xfAlGIXQlV2DWqqFjxJ52SDMMTKhsdfzc8A5BeNZDcuN9bMQC1SIGF3Rn26huvnvKoB9gscQrpjh3pfJrEn7ySpc5q7JKms+RE7TOunzX3DtS+xssGD3mKFRVzym64EU9nMC0C+MkrbDva3Cmi4LYwBA0dLifkmzgV0VFtfZl9a9VxHmE9tauzPSbt5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K+OrDT6jwTz+oIL0AqtQJkC6O4fn5C929vIBbephTMo=; b=Vn7ufjlbJcHHnZb0BIasBNdRUxnOXYzGLJbnFFw4E6fGLQQ6upVfCtripN6gF3RkMeZ+jf2WQWuNw0CvL3+ph4vAdXibSN1vTtDJs+O3NxTCmB4oXAwIEA/pstrBpgUX15bUvGtyPsDrtV+52HTObqTTxZbNuNYsSSh/EyoEg9U/B8po8GsTSRccAqdyTTnMzR3jkE1DD/TvtrT4JQT0lYQ3YYHdjZag3xA91kwTMGUXDgbpyZD4RnfeiuUewuiIkmfUeE619kmZVlry3wMxDwLWleSezAotrPjnGJxh4AI+g9YMAvzDm90ELMZj8+L/EMZUq2uDbYdXNO7wCR6N6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K+OrDT6jwTz+oIL0AqtQJkC6O4fn5C929vIBbephTMo=; b=O7GDlhOZ72iN1u4rWnTbb6zBiS7ebAIndSV5VB+VLGdBl66OLCZViiSAGvUkkH6hpVDENzVqo4CPBwH4nzjEF5oQz930uQlxDw5GKc04oqpwqQMQWi2cu4w0gq/KI8wXtWkHzlxjW2mUFOuUGDK5JogkkRU+GJCEK5/x4vRJSWLf1p3CmhbK03O7a6njxAdBGG/neH6RNlRZ+cZUuQ0WNG6RJBS4iAmE4VarmYcOj56cxcxBut5fMt6Tx5lnN/wBkXtm8LwqDPmCvmhVrLl2TpMBcPRwDUjjx2otBMopnu3dr/7rmB0VmALAf99Y0ED0JoSk93QPZDxDsncldLJw+Q== Received: from BY3PR05CA0013.namprd05.prod.outlook.com (2603:10b6:a03:254::18) by SA3PR12MB7998.namprd12.prod.outlook.com (2603:10b6:806:320::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Tue, 28 May 2024 14:30:04 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:254:cafe::86) by BY3PR05CA0013.outlook.office365.com (2603:10b6:a03:254::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.18 via Frontend Transport; Tue, 28 May 2024 14:30:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:30:04 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:35 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:34 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:32 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 12/15] net/mlx5e: SHAMPO, Add header-only ethtool counters for header data split Date: Tue, 28 May 2024 17:28:04 +0300 Message-ID: <20240528142807.903965-13-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|SA3PR12MB7998:EE_ X-MS-Office365-Filtering-Correlation-Id: 97da7ce0-b48f-47a9-376a-08dc7f22aa63 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|82310400017|376005|1800799015; X-Microsoft-Antispam-Message-Info: d7UpyNl1dOzdkQAIJ94/UwB2YMoLhwbd3a/sRD7HixgrnLwAX+04gWV2L/ZtDFygbwOKP9oiOYWp2EV/5m0sUwIQYAHMkpqlC8vAf1YNsGZgfJfbuu7qxOsbdmBhz5OE47iSEhhuKecnKxlgJvHrslBEFR0NIvxW7064GDt1On1lonMjGeiYWVtLlAcVufoR0vL3yu9gd7FuRrzNjzMJYVon11nG1QdGUfWNwsXcxM08BEx48sHSu/bQznY1Hs3a9jOAeTajElYb3P1dI5lcwDsdxZlvNNQne3Nv64uVdeAWnihDwwP+A8QwO/NMMNJNwJQhT6RkMMoJ+jAQb5h+QxpYzBdd/5H0sNh4x6LAepvdrtoXJRAWhYKix6jt/Li88Upr/bK98I+QQH73da6Zdt+TaTXltTrSs/IqxDa5HOFtzzcY/imuzl+ldyJS3cfmdzenaeuSMpqEkUtYGYSDpdAt6rfhgwd4JHwBJnY1xCirMu/vnub9eBt91CMcE5F+sP40I0jH6bbrGdh9u3+lfz02956vDI3TZ8zO16Q/w90ey28IXKveL3BYRtBxgPVw/pbYWoD6MkllPlX3+ivpH2UG/7x3VzNOxNW7GdFD5zVUF8zg182Ue9dn8C8r0qpSupe9WleLioqetw0wviQ1xNL8zjKkh5vVPE8vEmVtx+kpfd3zncm0DbWgmNfNZHmdIGeiX9i+LAn/aXdd8RERTshtyc5SSgK/ar7vUE29a7jwP6lVMC0j76tP7eJXGh6xDPMYxdXY0gLZFe2tLUyXWgs1VtmunFit+gGZ57nD5qicpJ42jhkvPWNiqeb/4xH9pMVSU8CxJksWkGN/kLtRfmHNFv4UO3YMcMN0B7w3j7D4UwhzNtoWTLjl+zJNgzvOpxUvUWKyJRsVuQ+z1ojaCuUB02xAWS2YguLRgDhtPIbOp8hfag6povznFqQsNTpeel607lA9KgzGYffv4OIWdRGDPMLvZJS9AJgQvU4FS6dN0VKJ8KE0MnpYkbULdlNELuOilcHd69rBxhKh7Wt3JXnBxL8WfN+NsVErznyLjslDjyNC3fkweaB9IwNbMgpdzs2cmTan94T0JBtwP7sVpzmlYio2hobV1cd41WPXaQ/J7nZg27QGW2zpREkNnySBw5YDHw536T3bQkLW4fSF8mEIvMsCroW/OnJiRfu0a6tYufQFFRanoylcOmtLgfSbj2NL0PaK9hOrwRMfgUaokGpBUBIDpc2Vt07C27K0JwL7n02oEzqV6EjeyAVS/t8qXLu4i0D9TRiUx3NN2u+Pl12w1IbwuQb+QET+PTQOlgS+E7QfuIH8E7+cfCtyFz9T5rzg0SEMZz0w67GVb/xPBYtdz4dru1RwONHWZ62N79Y= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(82310400017)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:30:04.2762 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97da7ce0-b48f-47a9-376a-08dc7f22aa63 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7998 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea Count the number of header-only packets and bytes from SHAMPO. Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- .../device_drivers/ethernet/mellanox/mlx5/counters.rst | 9 +++++++++ drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 3 +++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 4 ++++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst index deb0e07432c4..9d12dd154d2e 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -219,6 +219,15 @@ the software port. [#accel]_. - Informative + * - `rx[i]_hds_nodata_packets` + - Number of header only packets in header/data split mode [#accel]_. + - Informative + + * - `rx[i]_hds_nodata_bytes` + - Number of bytes for header only packets in header/data split mode + [#accel]_. + - Informative + * - `rx[i]_lro_packets` - The number of LRO packets received on ring i [#accel]_. - Acceleration diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index f40f34877904..834428ed45ee 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2331,6 +2331,9 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq frag_page = &wi->alloc_units.frag_pages[page_idx]; mlx5e_shampo_fill_skb_data(*skb, rq, frag_page, data_bcnt, data_offset); + } else { + stats->hds_nodata_packets++; + stats->hds_nodata_bytes += head_size; } } else { stats->hds_nosplit_packets++; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 96ecf675f90d..a4c2691e3bd9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -345,6 +345,8 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s, s->rx_gro_large_hds += rq_stats->gro_large_hds; s->rx_hds_nosplit_packets += rq_stats->hds_nosplit_packets; s->rx_hds_nosplit_bytes += rq_stats->hds_nosplit_bytes; + s->rx_hds_nodata_packets += rq_stats->hds_nodata_packets; + s->rx_hds_nodata_bytes += rq_stats->hds_nodata_bytes; s->rx_ecn_mark += rq_stats->ecn_mark; s->rx_removed_vlan_packets += rq_stats->removed_vlan_packets; s->rx_csum_none += rq_stats->csum_none; @@ -2056,6 +2058,8 @@ static const struct counter_desc rq_stats_desc[] = { { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, gro_large_hds) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_packets) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nosplit_bytes) }, + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_packets) }, + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, hds_nodata_bytes) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, ecn_mark) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, removed_vlan_packets) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) }, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 6967c8c91f9a..b811cf6ecf9d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -156,6 +156,8 @@ struct mlx5e_sw_stats { u64 rx_gro_large_hds; u64 rx_hds_nosplit_packets; u64 rx_hds_nosplit_bytes; + u64 rx_hds_nodata_packets; + u64 rx_hds_nodata_bytes; u64 rx_mcast_packets; u64 rx_ecn_mark; u64 rx_removed_vlan_packets; @@ -356,6 +358,8 @@ struct mlx5e_rq_stats { u64 gro_large_hds; u64 hds_nosplit_packets; u64 hds_nosplit_bytes; + u64 hds_nodata_packets; + u64 hds_nodata_bytes; u64 mcast_packets; u64 ecn_mark; u64 removed_vlan_packets; From patchwork Tue May 28 14:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676918 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2087.outbound.protection.outlook.com [40.107.220.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD0D5171062 for ; Tue, 28 May 2024 14:30:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906602; cv=fail; b=uXrvJgx0zvERhUVqHiXbc+KwP8f4oJDIyfL4giZTyzl4nWJHlKcvSVr5dP7k+5nYMSm96gPxNptcf89ZU+FLTQna6KgyfTxSwt5R63Iw+yr3JqEjzdZ5zzbelTd3iMr22LOBkX6x6FUFmcqBfEDYKT3VgmEW22zxaU3ZB2Ivz2U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906602; c=relaxed/simple; bh=4Or/jdXZFBzUOP3XUwdOABg3kQSE31As/jIQL/72/SQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iBx1o3C33n97Tg/qvq/JNKpm4L5VnsoR4BStkX+07syxkvIJMJ8X0dbP/2VGBTpwDDg7gnMj5YgZOXiF6ua7rE326d+ah8BZiD7v+MgxOA0hiCkoR+7CSofHVbJ2rpC9AbAJM3yvbx9tU32CE2Eb1mEgOHPEJpZY/0S8E4T8+0E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=CH+3SskJ; arc=fail smtp.client-ip=40.107.220.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CH+3SskJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HrO5iky3D77qIb4y/NasF0+5RDs1xVCRfTgxxTJMLKybwF//bbEEs3xu7Pfity82ay5BWuHAjdy+dzzFmNIAkGQ9GOPbJ9l2a1XoG2BgJey3ze4HpSnwvAn7C5/Q1P8J8rJ/NCMyGsOey+NRuv9HCW+I3DG+9BJwVWu2B7g5KtPTQAJvfZmRaFw+42R4P/xTUslXxmXwzJ+igvo6M01RjdHxl1gvoFNSUpNi+CUc8Wzn65h84KPjJ04saRs2H5SVhqjMtFdj5ARKo/ZyBKFQi6P+FyRUjytYIAcno3J/q8wjupj0/7GUApD9Uqu3N1UzWtJz2z9S8HKZXHkWnVg4uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ev/bqd6Tj8bFK1oNjS/pXZs8zKvIw2X4e/9j7vWDaE8=; b=nzpXVIaR8AdCelYMoT2u+mmTvMm1+m5/ztWrc2+dcotmqh3lgX1j2CiGzEXdY5v5FRd5MZCRBD9DxPpKlC60CYmYHo64AiJos3ircM/mCINzLHD+e4yGpE8CwAR4bFDbOhJOsys1EG359eGi69pAadbjKnotiImRWvzArh1HsjXEROdhVCAjaERG3W60Yu6ioMGdpEY82Pg9s1NRceMFUYtaqlHb5QwChKJMQlyBRcUHWQiq2GC749egf7F/vmK8dVuKBQhbh1b0IlfR/pTn6FxXav8btpR9aA0rPTkBflEy9+t9HX7xxp2HLz5Af6M2D0ocEa4Oo8UF7BZf+sHcUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ev/bqd6Tj8bFK1oNjS/pXZs8zKvIw2X4e/9j7vWDaE8=; b=CH+3SskJ0ZxC4beKDZwejHbPAGaFDXhWE1dBjgopSrhIrT6/C9q27qgl7D0rQ79vjMPbKXBgSA9FgbyN96xDkytcGcvVzxcq2GgT8p046Xb4nbFeOgYSBf1l4UU9uDte/W92d7sRkzeZ4+SiVZc/LwnmqtpVSrAyWGovZBRgSCHrH7pS5KxIRpnYf3npigqOS8Cz4VXZsQMMOTPk2T1gN5Q5by1IqueAGf2bElPwD+ePQY2dDBFtsndZqqfPpJiE4vpIvij1wdsccywtApLkn0Q/hk7PXuMR03sw6piUv9jnb2hh6Ell66IBdaqz5s5aLbxs9PuJ5vGvKUqinHM+kA== Received: from BN9PR03CA0167.namprd03.prod.outlook.com (2603:10b6:408:f4::22) by LV8PR12MB9417.namprd12.prod.outlook.com (2603:10b6:408:204::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 14:29:57 +0000 Received: from BN1PEPF00004680.namprd03.prod.outlook.com (2603:10b6:408:f4:cafe::a6) by BN9PR03CA0167.outlook.office365.com (2603:10b6:408:f4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29 via Frontend Transport; Tue, 28 May 2024 14:29:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004680.mail.protection.outlook.com (10.167.243.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:29:56 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:38 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:37 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:35 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Yoray Zack , Tariq Toukan Subject: [PATCH net-next 13/15] net/mlx5e: SHAMPO, Use KSMs instead of KLMs Date: Tue, 28 May 2024 17:28:05 +0300 Message-ID: <20240528142807.903965-14-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004680:EE_|LV8PR12MB9417:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a5c0d64-696d-44d1-4f25-08dc7f22a5fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: s2hMxMbR1I6toiHrinl7iAVlLE33Z4Gg8nMXkUvNCTeD7wrOxjuwSs9OjvZmV06QN9sWZYs44MJxPruYRnHzw8cnAihYJWgd1TTThUkRm/x7/iXoz7onWRh4ECskBhUcz1Z5b1XGBkKNE/NNwP/g5o03zKwE7VWkM5m+Utg5EftTejsX9DvqlJqyd/78EL7EKQ1OH7S64gN0lxNBRMS7D3h4+XEUdosIQOtNTqzApoFlRpNdcD1DO/UV3Zn/27gyY8JbWPUTuihVTlityipeVADudUsNsEIuf57LhordnbMLoZf5ValRkaBB+yrTtPDOFKUMbGJ24B/7tbTkUvYSeUygg9f8vDGN0/pqrMwDeSqD6OotGQlqvKpveGA1HOlZFCUw0rRZpVBCR4hPciCEtYrLzkm2ypl6kYuUuGlVEBQ9v+zLqF+7mt+TfhSuQjzPMWGOO6HIzTIStQtz9CoJeXz+XuND+Z89mz7KPlMl13JIzC1Cg9+e558cuMgr1IIMfocj+6fxoMWsnY0fNcesgG/W2VCX3vpKld3Q8ZijgHWiaMAYddsDXGqRHQmIFQlihzLWhmfTeg4Jiu9kiESM25e8B1txweM7H231pYIYI67EN+Bv2hn7t2MpH2wmp7RfuoyAZmYKBX0Nm9Y7aIGqa6/vqZreVbD5EeQ1uPBJKDR1jK3IdDDKunRi4beCWxgWZ7qLVAvbZzDBjhEHPYkqG0OAmdifFlbUKbLnnK0xfXq7JorIJEZUhHRBYiaxgtktwX7fmvPFXBBk6dYZHS69wsiHFjIENCkWlgNr6P05x2nlJJ14kTth1O3P+Wwka47jkteULSVYcS7Tl1Am+dMtyRHEX34SEkWLBfaqu8MfJunVD066SX4KWzZ7l9eF80qPNZQBSRpV9CfuVhUWoZp4uOJfiXlC3G2SpmquHjLQclwGN3jdCueicZNtvWciawfUSOC7gZWLYjQUwEjHxdPj+dJxMm+sRzYyi26LS9x7cUs3cPh5F6hGzY+/K8nB+SzIPAcXptxSX0UCLJz3pQJsfounQraxjtfVR+RiZEqchlvs6Hq6AdpY24Yd5ZirTxzkZ1WgshNuS0ZstM4CjaZafeFLN3GJPfgzzPGzIsv0IqgUmx6WhkgYk77DGAGwqHZhSvW6TzhjJ4jYeL/YMeTVouv9ej+a+92PB3r89O50RrQay+7ez1SDDpfc0XsnU5g5oSpjrEiaQoZ+0PG9tZQkU8QUmlrWoPPxlL2cYF0akkLHycLdQVXurM7AIjuev+zXwa8/A7pXckQmeCG6Yw3aoJ3WQ/bf/Aa7hO7++tahRDgWMU+7trCLmsfpk+RQCc//VdCWH2ZJxK/x58+WQIiKe/ORTDtxKHhYTm/iEFoqxZemk6XpkytTRVpM6K5bBK22 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(376005)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:29:56.8062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a5c0d64-696d-44d1-4f25-08dc7f22a5fb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004680.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9417 X-Patchwork-Delegate: kuba@kernel.org From: Yoray Zack KSM Mkey is KLM Mkey with a fixed buffer size. Due to this fact, it is a faster mechanism than KLM. SHAMPO feature used KLMs Mkeys for memory mappings of its headers buffer. As it used KLMs with the same buffer size for each entry, we can use KSMs instead. This commit changes the Mkeys that map the SHAMPO headers buffer from KLMs to KSMs. Signed-off-by: Yoray Zack Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 20 +----- .../ethernet/mellanox/mlx5/core/en/params.c | 12 ++-- .../net/ethernet/mellanox/mlx5/core/en/txrx.h | 19 ++++++ .../net/ethernet/mellanox/mlx5/core/en_main.c | 21 +++--- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 65 +++++++++---------- include/linux/mlx5/device.h | 1 + 6 files changed, 71 insertions(+), 67 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index ff326601d4a4..bec784d25d7b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -80,6 +80,7 @@ struct page_pool; SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) #define MLX5E_RX_MAX_HEAD (256) +#define MLX5E_SHAMPO_LOG_HEADER_ENTRY_SIZE (8) #define MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE (9) #define MLX5E_SHAMPO_WQ_HEADER_PER_PAGE (PAGE_SIZE >> MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE) #define MLX5E_SHAMPO_WQ_BASE_HEAD_ENTRY_SIZE (64) @@ -146,25 +147,6 @@ struct page_pool; #define MLX5E_TX_XSK_POLL_BUDGET 64 #define MLX5E_SQ_RECOVER_MIN_INTERVAL 500 /* msecs */ -#define MLX5E_KLM_UMR_WQE_SZ(sgl_len)\ - (sizeof(struct mlx5e_umr_wqe) +\ - (sizeof(struct mlx5_klm) * (sgl_len))) - -#define MLX5E_KLM_UMR_WQEBBS(klm_entries) \ - (DIV_ROUND_UP(MLX5E_KLM_UMR_WQE_SZ(klm_entries), MLX5_SEND_WQE_BB)) - -#define MLX5E_KLM_UMR_DS_CNT(klm_entries)\ - (DIV_ROUND_UP(MLX5E_KLM_UMR_WQE_SZ(klm_entries), MLX5_SEND_WQE_DS)) - -#define MLX5E_KLM_MAX_ENTRIES_PER_WQE(wqe_size)\ - (((wqe_size) - sizeof(struct mlx5e_umr_wqe)) / sizeof(struct mlx5_klm)) - -#define MLX5E_KLM_ENTRIES_PER_WQE(wqe_size)\ - ALIGN_DOWN(MLX5E_KLM_MAX_ENTRIES_PER_WQE(wqe_size), MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT) - -#define MLX5E_MAX_KLM_PER_WQE(mdev) \ - MLX5E_KLM_ENTRIES_PER_WQE(MLX5_SEND_WQE_BB * mlx5e_get_max_sq_aligned_wqebbs(mdev)) - #define mlx5e_state_dereference(priv, p) \ rcu_dereference_protected((p), lockdep_is_held(&(priv)->state_lock)) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c index ec819dfc98be..6c9ccccca81e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c @@ -1071,18 +1071,18 @@ static u32 mlx5e_shampo_icosq_sz(struct mlx5_core_dev *mdev, struct mlx5e_params *params, struct mlx5e_rq_param *rq_param) { - int max_num_of_umr_per_wqe, max_hd_per_wqe, max_klm_per_umr, rest; + int max_num_of_umr_per_wqe, max_hd_per_wqe, max_ksm_per_umr, rest; void *wqc = MLX5_ADDR_OF(rqc, rq_param->rqc, wq); int wq_size = BIT(MLX5_GET(wq, wqc, log_wq_sz)); u32 wqebbs; - max_klm_per_umr = MLX5E_MAX_KLM_PER_WQE(mdev); + max_ksm_per_umr = MLX5E_MAX_KSM_PER_WQE(mdev); max_hd_per_wqe = mlx5e_shampo_hd_per_wqe(mdev, params, rq_param); - max_num_of_umr_per_wqe = max_hd_per_wqe / max_klm_per_umr; - rest = max_hd_per_wqe % max_klm_per_umr; - wqebbs = MLX5E_KLM_UMR_WQEBBS(max_klm_per_umr) * max_num_of_umr_per_wqe; + max_num_of_umr_per_wqe = max_hd_per_wqe / max_ksm_per_umr; + rest = max_hd_per_wqe % max_ksm_per_umr; + wqebbs = MLX5E_KSM_UMR_WQEBBS(max_ksm_per_umr) * max_num_of_umr_per_wqe; if (rest) - wqebbs += MLX5E_KLM_UMR_WQEBBS(rest); + wqebbs += MLX5E_KSM_UMR_WQEBBS(rest); wqebbs *= wq_size; return wqebbs; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h index 879d698b6119..d1f0f868d494 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h @@ -34,6 +34,25 @@ #define MLX5E_RX_ERR_CQE(cqe) (get_cqe_opcode(cqe) != MLX5_CQE_RESP_SEND) +#define MLX5E_KSM_UMR_WQE_SZ(sgl_len)\ + (sizeof(struct mlx5e_umr_wqe) +\ + (sizeof(struct mlx5_ksm) * (sgl_len))) + +#define MLX5E_KSM_UMR_WQEBBS(ksm_entries) \ + (DIV_ROUND_UP(MLX5E_KSM_UMR_WQE_SZ(ksm_entries), MLX5_SEND_WQE_BB)) + +#define MLX5E_KSM_UMR_DS_CNT(ksm_entries)\ + (DIV_ROUND_UP(MLX5E_KSM_UMR_WQE_SZ(ksm_entries), MLX5_SEND_WQE_DS)) + +#define MLX5E_KSM_MAX_ENTRIES_PER_WQE(wqe_size)\ + (((wqe_size) - sizeof(struct mlx5e_umr_wqe)) / sizeof(struct mlx5_ksm)) + +#define MLX5E_KSM_ENTRIES_PER_WQE(wqe_size)\ + ALIGN_DOWN(MLX5E_KSM_MAX_ENTRIES_PER_WQE(wqe_size), MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT) + +#define MLX5E_MAX_KSM_PER_WQE(mdev) \ + MLX5E_KSM_ENTRIES_PER_WQE(MLX5_SEND_WQE_BB * mlx5e_get_max_sq_aligned_wqebbs(mdev)) + static inline ktime_t mlx5e_cqe_ts_to_ns(cqe_ts_to_ns func, struct mlx5_clock *clock, u64 cqe_ts) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 1b08995b8022..913cc0275871 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -504,8 +504,8 @@ static int mlx5e_create_umr_mkey(struct mlx5_core_dev *mdev, return err; } -static int mlx5e_create_umr_klm_mkey(struct mlx5_core_dev *mdev, - u64 nentries, +static int mlx5e_create_umr_ksm_mkey(struct mlx5_core_dev *mdev, + u64 nentries, u8 log_entry_size, u32 *umr_mkey) { int inlen; @@ -525,12 +525,13 @@ static int mlx5e_create_umr_klm_mkey(struct mlx5_core_dev *mdev, MLX5_SET(mkc, mkc, umr_en, 1); MLX5_SET(mkc, mkc, lw, 1); MLX5_SET(mkc, mkc, lr, 1); - MLX5_SET(mkc, mkc, access_mode_1_0, MLX5_MKC_ACCESS_MODE_KLMS); + MLX5_SET(mkc, mkc, access_mode_1_0, MLX5_MKC_ACCESS_MODE_KSM); mlx5e_mkey_set_relaxed_ordering(mdev, mkc); MLX5_SET(mkc, mkc, qpn, 0xffffff); MLX5_SET(mkc, mkc, pd, mdev->mlx5e_res.hw_objs.pdn); MLX5_SET(mkc, mkc, translations_octword_size, nentries); - MLX5_SET(mkc, mkc, length64, 1); + MLX5_SET(mkc, mkc, log_page_size, log_entry_size); + MLX5_SET64(mkc, mkc, len, nentries << log_entry_size); err = mlx5_core_create_mkey(mdev, umr_mkey, in, inlen); kvfree(in); @@ -565,14 +566,16 @@ static int mlx5e_create_rq_umr_mkey(struct mlx5_core_dev *mdev, struct mlx5e_rq static int mlx5e_create_rq_hd_umr_mkey(struct mlx5_core_dev *mdev, struct mlx5e_rq *rq) { - u32 max_klm_size = BIT(MLX5_CAP_GEN(mdev, log_max_klm_list_size)); + u32 max_ksm_size = BIT(MLX5_CAP_GEN(mdev, log_max_klm_list_size)); - if (max_klm_size < rq->mpwqe.shampo->hd_per_wq) { - mlx5_core_err(mdev, "max klm list size 0x%x is smaller than shampo header buffer list size 0x%x\n", - max_klm_size, rq->mpwqe.shampo->hd_per_wq); + if (max_ksm_size < rq->mpwqe.shampo->hd_per_wq) { + mlx5_core_err(mdev, "max ksm list size 0x%x is smaller than shampo header buffer list size 0x%x\n", + max_ksm_size, rq->mpwqe.shampo->hd_per_wq); return -EINVAL; } - return mlx5e_create_umr_klm_mkey(mdev, rq->mpwqe.shampo->hd_per_wq, + + return mlx5e_create_umr_ksm_mkey(mdev, rq->mpwqe.shampo->hd_per_wq, + MLX5E_SHAMPO_LOG_HEADER_ENTRY_SIZE, &rq->mpwqe.shampo->mkey); } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 834428ed45ee..e6987bd467d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -619,25 +619,25 @@ static int bitmap_find_window(unsigned long *bitmap, int len, return min(len, count); } -static void build_klm_umr(struct mlx5e_icosq *sq, struct mlx5e_umr_wqe *umr_wqe, - __be32 key, u16 offset, u16 klm_len, u16 wqe_bbs) +static void build_ksm_umr(struct mlx5e_icosq *sq, struct mlx5e_umr_wqe *umr_wqe, + __be32 key, u16 offset, u16 ksm_len) { - memset(umr_wqe, 0, offsetof(struct mlx5e_umr_wqe, inline_klms)); + memset(umr_wqe, 0, offsetof(struct mlx5e_umr_wqe, inline_ksms)); umr_wqe->ctrl.opmod_idx_opcode = cpu_to_be32((sq->pc << MLX5_WQE_CTRL_WQE_INDEX_SHIFT) | MLX5_OPCODE_UMR); umr_wqe->ctrl.umr_mkey = key; umr_wqe->ctrl.qpn_ds = cpu_to_be32((sq->sqn << MLX5_WQE_CTRL_QPN_SHIFT) - | MLX5E_KLM_UMR_DS_CNT(klm_len)); + | MLX5E_KSM_UMR_DS_CNT(ksm_len)); umr_wqe->uctrl.flags = MLX5_UMR_TRANSLATION_OFFSET_EN | MLX5_UMR_INLINE; umr_wqe->uctrl.xlt_offset = cpu_to_be16(offset); - umr_wqe->uctrl.xlt_octowords = cpu_to_be16(klm_len); + umr_wqe->uctrl.xlt_octowords = cpu_to_be16(ksm_len); umr_wqe->uctrl.mkey_mask = cpu_to_be64(MLX5_MKEY_MASK_FREE); } static int mlx5e_build_shampo_hd_umr(struct mlx5e_rq *rq, struct mlx5e_icosq *sq, - u16 klm_entries, u16 index) + u16 ksm_entries, u16 index) { struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; u16 entries, pi, header_offset, err, wqe_bbs, new_entries; @@ -650,20 +650,20 @@ static int mlx5e_build_shampo_hd_umr(struct mlx5e_rq *rq, int headroom, i; headroom = rq->buff.headroom; - new_entries = klm_entries - (shampo->pi & (MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT - 1)); - entries = ALIGN(klm_entries, MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT); - wqe_bbs = MLX5E_KLM_UMR_WQEBBS(entries); + new_entries = ksm_entries - (shampo->pi & (MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT - 1)); + entries = ALIGN(ksm_entries, MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT); + wqe_bbs = MLX5E_KSM_UMR_WQEBBS(entries); pi = mlx5e_icosq_get_next_pi(sq, wqe_bbs); umr_wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); - build_klm_umr(sq, umr_wqe, shampo->key, index, entries, wqe_bbs); + build_ksm_umr(sq, umr_wqe, shampo->key, index, entries); frag_page = &shampo->pages[page_index]; for (i = 0; i < entries; i++, index++) { dma_info = &shampo->info[index]; - if (i >= klm_entries || (index < shampo->pi && shampo->pi - index < - MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT)) - goto update_klm; + if (i >= ksm_entries || (index < shampo->pi && shampo->pi - index < + MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT)) + goto update_ksm; header_offset = (index & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) << MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE; if (!(header_offset & (PAGE_SIZE - 1))) { @@ -683,12 +683,11 @@ static int mlx5e_build_shampo_hd_umr(struct mlx5e_rq *rq, dma_info->frag_page = frag_page; } -update_klm: - umr_wqe->inline_klms[i].bcount = - cpu_to_be32(MLX5E_RX_MAX_HEAD); - umr_wqe->inline_klms[i].key = cpu_to_be32(lkey); - umr_wqe->inline_klms[i].va = - cpu_to_be64(dma_info->addr + headroom); +update_ksm: + umr_wqe->inline_ksms[i] = (struct mlx5_ksm) { + .key = cpu_to_be32(lkey), + .va = cpu_to_be64(dma_info->addr + headroom), + }; } sq->db.wqe_info[pi] = (struct mlx5e_icosq_wqe_info) { @@ -720,37 +719,37 @@ static int mlx5e_build_shampo_hd_umr(struct mlx5e_rq *rq, static int mlx5e_alloc_rx_hd_mpwqe(struct mlx5e_rq *rq) { struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; - u16 klm_entries, num_wqe, index, entries_before; + u16 ksm_entries, num_wqe, index, entries_before; struct mlx5e_icosq *sq = rq->icosq; - int i, err, max_klm_entries, len; + int i, err, max_ksm_entries, len; - max_klm_entries = MLX5E_MAX_KLM_PER_WQE(rq->mdev); - klm_entries = bitmap_find_window(shampo->bitmap, + max_ksm_entries = MLX5E_MAX_KSM_PER_WQE(rq->mdev); + ksm_entries = bitmap_find_window(shampo->bitmap, shampo->hd_per_wqe, shampo->hd_per_wq, shampo->pi); - if (!klm_entries) + if (!ksm_entries) return 0; - klm_entries += (shampo->pi & (MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT - 1)); - index = ALIGN_DOWN(shampo->pi, MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT); + ksm_entries += (shampo->pi & (MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT - 1)); + index = ALIGN_DOWN(shampo->pi, MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT); entries_before = shampo->hd_per_wq - index; - if (unlikely(entries_before < klm_entries)) - num_wqe = DIV_ROUND_UP(entries_before, max_klm_entries) + - DIV_ROUND_UP(klm_entries - entries_before, max_klm_entries); + if (unlikely(entries_before < ksm_entries)) + num_wqe = DIV_ROUND_UP(entries_before, max_ksm_entries) + + DIV_ROUND_UP(ksm_entries - entries_before, max_ksm_entries); else - num_wqe = DIV_ROUND_UP(klm_entries, max_klm_entries); + num_wqe = DIV_ROUND_UP(ksm_entries, max_ksm_entries); for (i = 0; i < num_wqe; i++) { - len = (klm_entries > max_klm_entries) ? max_klm_entries : - klm_entries; + len = (ksm_entries > max_ksm_entries) ? max_ksm_entries : + ksm_entries; if (unlikely(index + len > shampo->hd_per_wq)) len = shampo->hd_per_wq - index; err = mlx5e_build_shampo_hd_umr(rq, sq, len, index); if (unlikely(err)) return err; index = (index + len) & (rq->mpwqe.shampo->hd_per_wq - 1); - klm_entries -= len; + ksm_entries -= len; } return 0; diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index d7bb31d9a446..da09bfaa7b81 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -294,6 +294,7 @@ enum { #define MLX5_UMR_FLEX_ALIGNMENT 0x40 #define MLX5_UMR_MTT_NUM_ENTRIES_ALIGNMENT (MLX5_UMR_FLEX_ALIGNMENT / sizeof(struct mlx5_mtt)) #define MLX5_UMR_KLM_NUM_ENTRIES_ALIGNMENT (MLX5_UMR_FLEX_ALIGNMENT / sizeof(struct mlx5_klm)) +#define MLX5_UMR_KSM_NUM_ENTRIES_ALIGNMENT (MLX5_UMR_FLEX_ALIGNMENT / sizeof(struct mlx5_ksm)) #define MLX5_USER_INDEX_LEN (MLX5_FLD_SZ_BYTES(qpc, user_index) * 8) From patchwork Tue May 28 14:28:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676921 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2074.outbound.protection.outlook.com [40.107.243.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A311317108E for ; Tue, 28 May 2024 14:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906609; cv=fail; b=Yv+azC8wgY3lw2hxmwH1t8nBann/wlz9KMH3KAOq9WTu1LkUwm/8dnkGmATR2jAswx1iKrEhDrOnG510nWd22+FlpiGilh3s+MKOvVFZPLDPzfLpIC9h7y5mqMBmUl4AEtwLrKfUK3Bc4zQrhN5j0um5rt694KXCaZXkdPz9JCE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906609; c=relaxed/simple; bh=6TXPp2pC/p3Gws71EyzNlQ1ZP0+tDcG6nCWJd1obYwc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sYlMxoTEzp4z94kACB0OBWzrH9fF2vnwRS+H7dKRzu5Q4kFpvqZh1qOKuepjwBf83LPKJrWhBkw+/YNLW4pPD/rG8ddBkykCW7Tq08GgnAAgHpfon9vzk5EV+vX5kFo/Txn1VWK0/W32eh0xmcDsXRlsEHKAec5wIvuRAaJN9Os= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Jt6Bd2Tu; arc=fail smtp.client-ip=40.107.243.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Jt6Bd2Tu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PAmGwrm0fBJjbvXXf/JkeAuhb6YMmki4W3FXr7w9RrqUZiay14cLMoIr28yDxASbpELJv/Nxl+QYGXL8ax2TJNFfLon3rtqYuYKHu18kpVP+6WhOyGjRQjKdsXoSY2rAIAZg6gzGazGzJh52XdF1UL8geHGo3Hicp10Qy35blC0PCju22zEgx61MvVhlhm1eia3TqKtoqzVETDoIOe4G1Lf+96gf+Sy06Otai0hmf6pKF2PY/gWGDNDBrHDEGakb19AJKUIPyxFtTLJ8N/7rCM+I7SK6UpXfckqA9QVAB2h6JAlo5fe/n3oVyLctUmHmTvkroiM5AJHgJntivrH09Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E1xRDVfHlAbRn4xekCY9sE64xBbAPCvFB6BDqsBOGf4=; b=Q3jgd+dN6Yy8qz/CqpUFnLh2k2uG0rm0EYOlriOjtrmgQlO8SJOGk9z6r8rDXFSl+RC/NwgDdukwkGGN62HmXs6WcKC3BpkI/zRHPtbdt7BQXUophw7chUxk7eLFoOYtyIXBojJ2LGnUK5Adn+uaqbzIvIjdYKI6fdxwUqz5+/F0nlF+O6+wJO4OmnPM/KqcyFIm0ssTHCR/jn/NH09sehuWfDLtT45LkJ/ChZbzMEV0vCdvToA0Dq9SXDUm9JxpEcjNJf0kS2oaJehOf/G9EPY6bxF3DYN+jpaI5EBGR6+ESgnQWWb00dXQ7CqBeVYdOTsrKtq1eShB1AcZ90fVaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E1xRDVfHlAbRn4xekCY9sE64xBbAPCvFB6BDqsBOGf4=; b=Jt6Bd2TuXu/mrntx1vI2frSkTt7gMMiE6qMvZUPHGqKW42lztHTKjUNGZ2IvIWS2szxVnUQsR6VUHsaFk1RP4+goBebiP7id7HsVU5/cDxX+mCzSRNEk+aQdt2pONMUyWi6OxH68mgJM5D2CXwnl8U+tz3TY9gmPiu/cf0yKIyRC8/m3dsR9Rq5xCH99dYbJXTWYO5a9FS+L4T5PghdE6KbPM/tKBIntqpBgHQ5x9vb9t2TcJpcNEEzu8NA/gNvxW15L/w6hr2f7UAHcsdP+UA0EqHgSC0bagUVcsWtGrqk2wRweys+qdv1BQgr+A+YYfVRwBLT/+PBnYq3U4IDvXw== Received: from BN9PR03CA0468.namprd03.prod.outlook.com (2603:10b6:408:139::23) by SA1PR12MB7174.namprd12.prod.outlook.com (2603:10b6:806:2b1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 14:30:02 +0000 Received: from BN1PEPF0000467F.namprd03.prod.outlook.com (2603:10b6:408:139:cafe::62) by BN9PR03CA0468.outlook.office365.com (2603:10b6:408:139::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 14:30:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF0000467F.mail.protection.outlook.com (10.167.243.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:30:00 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:41 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:40 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:38 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Yoray Zack , Tariq Toukan Subject: [PATCH net-next 14/15] net/mlx5e: SHAMPO, Re-enable HW-GRO Date: Tue, 28 May 2024 17:28:06 +0300 Message-ID: <20240528142807.903965-15-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000467F:EE_|SA1PR12MB7174:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aae86e0-be40-4160-7c17-08dc7f22a85e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: JxVATtkbyyiTAMaPiaxZ5OqmqOe3uu7nXbRsYUzV2Jt9xaQF8t5Mwmz4PoOVKW2nlJT5aT3ZdKTtmYW5GmGTqPa6ZLSLZSdu1vBUb3wxRKJtK8PfYINwSxMlIJmDYyLVb9IWolSrbuIZ5MOPCBpwdyNZN44jHhMU9cHgvI6KoyGN3iWLGf3PCm7qeNY48GMQ+n2juhRL6EGLuYasQYdSgBDVQtXE+EuzDWGbyBVLidBj2fMG+NcKrO+HpwEnF7hTBkTPG2tDlx593dF0OF/8cJd/CqXNGqBIWCphqcnuv909wcBtLPp+e6+GJaHukqv+hrfV9Dzr5cIW6Pv6yf4aaAIHyk/IQYn6TVAtAhusMA7H7IK+8X8lOB5hTmScGWd7rUrqf1xZnqQf0bx/TORkXmM8cx+u213hpcY4c/y24DW5vguf4yJ3aVnO5JxliCg931x76NqzTQh8/I9ONrDPo6REA5VihG4Rbt1QgYyBb/pndmilCM6hm/HbECE0OERmZGP7Ku/fPPO21JvKeSVgV4yIL9dJXtJC1gxeEXXdTEarTt/G1SQ2O0Xyt8loAbEUyzJxDctPdman5LywY0fNbj7hj4nUvOCaBL+Zuyu5XE30Asq9+CDuWwYdoMxLSq9BBlAMXVOy0iICOhbS7nkhCEw9SR/O8TOYT8ki73264sxkH3qp6v62h4B+ob9K9Nc1IPAcnz9iWA4EwFr84cAu89wjehkJBOVQs7tkgrhMD9yQUoncVRdcP3DENMNeYXSvjTss4gDuLxqTPtlDT56sZWVpMQ3jtWyIEbhP3n9esSYeLpoHXZ91HuZjvzIYl6yfB/wpmCJKYp9FoiSBH4JExY+7TJ9V2BHXyTEmYV93UrdtQP8j1tzY8nqktmHW+zodz/NgWH7l7lIxxOocKqP1q7ZaIUEZXtrLjKhh0BqooJMxh1/zEjKcUALTBDfMyDmxN7QmN3wULOIGsnEgXzshDLNb4dUsdq9gKZyjWlEas+vin4wYNS6EYWpAAjyjGoF2Gp8KJgvcXn+DnBrpBMvQUgupzuXP5R7ox9TzBEz/LIK8n4D3ac5qm/duDGGk29W8N/AHg+kqxhm8SeA4r9MvNWRW6UfwBp/A5cX9LXMQBTOTcQEx91OT1PyHbNw74CDDU1sapK2fSUMt2zlZbOrkXg1NMtD27+04CCCT8+GQbNzO7zNPeVMw2QBCU5P12gIjc32gqtYFybbGQltjBH8PU7Yd53y66badPG5Lcz2jspVeLdUHhYpOFIwF0ImPx67WgTjVcDegLAYnXphBSiYAzqK5jbkM/5uLVEstU0DTez2TUs931Av/eGD9sTE9+aEYp5Xyk9K2JtQ6qfweU+c96dkRvCwCucdlGa0NqT26vM6Stybqq+Mtx3W480OtmIO9 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(376005)(36860700004)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:30:00.7960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8aae86e0-be40-4160-7c17-08dc7f22a85e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF0000467F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7174 X-Patchwork-Delegate: kuba@kernel.org From: Yoray Zack Add back HW-GRO to the reported features. As the current implementation of HW-GRO uses KSMs with a specific fixed buffer size (256B) to map its headers buffer, we reported the feature only if the NIC is supporting KSM and the minimum value for buffer size is below the requested one. iperf3 bandwidth comparison: +---------+--------+--------+-----------+ | streams | SW GRO | HW GRO | Unit | |---------+--------+--------+-----------| | 1 | 36 | 42 | Gbits/sec | | 4 | 34 | 39 | Gbits/sec | | 8 | 31 | 35 | Gbits/sec | +---------+--------+--------+-----------+ A downstream patch will add skb fragment coalescing which will improve performance considerably. Benchmark details: VM based setup CPU: Intel(R) Xeon(R) Platinum 8380 CPU, 24 cores NIC: ConnectX-7 100GbE iperf3 and irq running on same CPU over a single receive queue Signed-off-by: Yoray Zack Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en_main.c | 26 +++++++++++++++++++ include/linux/mlx5/mlx5_ifc.h | 16 ++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 913cc0275871..0f3d107961a4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -74,6 +74,27 @@ #include "lib/devcom.h" #include "lib/sd.h" +static bool mlx5e_hw_gro_supported(struct mlx5_core_dev *mdev) +{ + if (!MLX5_CAP_GEN(mdev, shampo)) + return false; + + /* Our HW-GRO implementation relies on "KSM Mkey" for + * SHAMPO headers buffer mapping + */ + if (!MLX5_CAP_GEN(mdev, fixed_buffer_size)) + return false; + + if (!MLX5_CAP_GEN_2(mdev, min_mkey_log_entity_size_fixed_buffer_valid)) + return false; + + if (MLX5_CAP_GEN_2(mdev, min_mkey_log_entity_size_fixed_buffer) > + MLX5E_SHAMPO_LOG_HEADER_ENTRY_SIZE) + return false; + + return true; +} + bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev, u8 page_shift, enum mlx5e_mpwrq_umr_mode umr_mode) { @@ -5331,6 +5352,11 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; netdev->hw_features |= NETIF_F_HW_VLAN_STAG_TX; + if (mlx5e_hw_gro_supported(mdev) && + mlx5e_check_fragmented_striding_rq_cap(mdev, PAGE_SHIFT, + MLX5E_MPWRQ_UMR_MODE_ALIGNED)) + netdev->hw_features |= NETIF_F_GRO_HW; + if (mlx5e_tunnel_any_tx_proto_supported(mdev)) { netdev->hw_enc_features |= NETIF_F_HW_CSUM; netdev->hw_enc_features |= NETIF_F_TSO; diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index f468763478ae..488509f84982 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1526,8 +1526,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 ts_cqe_to_dest_cqn[0x1]; u8 reserved_at_b3[0x6]; u8 go_back_n[0x1]; - u8 shampo[0x1]; - u8 reserved_at_bb[0x5]; + u8 reserved_at_ba[0x6]; u8 max_sgl_for_optimized_performance[0x8]; u8 log_max_cq_sz[0x8]; @@ -1744,7 +1743,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_280[0x10]; u8 max_wqe_sz_sq[0x10]; - u8 reserved_at_2a0[0x10]; + u8 reserved_at_2a0[0xb]; + u8 shampo[0x1]; + u8 reserved_at_2ac[0x4]; u8 max_wqe_sz_rq[0x10]; u8 max_flow_counter_31_16[0x10]; @@ -2017,7 +2018,8 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { u8 reserved_at_250[0x10]; u8 reserved_at_260[0x120]; - u8 reserved_at_380[0x10]; + u8 reserved_at_380[0xb]; + u8 min_mkey_log_entity_size_fixed_buffer[0x5]; u8 ec_vf_vport_base[0x10]; u8 reserved_at_3a0[0x10]; @@ -2029,7 +2031,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { u8 pcc_ifa2[0x1]; u8 reserved_at_3f1[0xf]; - u8 reserved_at_400[0x400]; + u8 reserved_at_400[0x1]; + u8 min_mkey_log_entity_size_fixed_buffer_valid[0x1]; + u8 reserved_at_402[0x1e]; + + u8 reserved_at_420[0x3e0]; }; enum mlx5_ifc_flow_destination_type { From patchwork Tue May 28 14:28:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13676922 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0E9317165B for ; Tue, 28 May 2024 14:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906609; cv=fail; b=NRU5kKl5yFJiA2jpMPF8u7C02jj1p1/hAfGY1j+x5k9yD8M6Bf46IEd/Y8vRfviLSCAT7Nef+eS21cAyImRp6X85Gbn+dhE88BEVt17+SLSrAqlKixgmTciWvY9CNStONzytxCznFDYZULAKBhx//38tCzh6CHchq7NPY99Ud2Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716906609; c=relaxed/simple; bh=uWwqIYLv+rG22PRchPfy6Li6GxdBO82/K9lsrnKcQ0w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fk3wuWOBM/bkFaLSAV9ifilXlZkw5jsdNh34TcqbAbfn/NQ6w/vMl6iCNM0fxpUOq8cEffxt5z1fF04bd8cO7bdS6C4vVO2LQ4fTulEjHT6o7rU1hkIolvPrZ4wWOZkP11JMJfs5ORkcLm+UPli2ZVfDA+E0eYEs3p3+z46lc1M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=r9uehawX; arc=fail smtp.client-ip=40.107.243.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="r9uehawX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MP74ZJMYgyYOQ/LXPhxrWMFL84sO6mCfVk9U/yK2uUPAZ5AjxQie7h/ZXngNKESazX54eZf+PLNEtqqX6s/2nDAImEOTJvH0Ucypze+yBYxzo6oOE9lyIhi0nXBE2wPiWIQi0MClCgnWEO10eRbWplR3eP0judk/VOR5jqPv4GC8eXqMvrs6dGprgGMpR4Em+Gixv9o6bcxmyR3a28o+dldyRsHxWqaERaOP4ysUdkvyH5uoYMZuYC6XiH9ze5ujZqT/QR+y47XU8F4fy8mIsMgR9i+Qtb5xiyMNj2sx8HUX6avQoXCjIoeLTYjAln4gff4RGRURtjFF9ETvCixdfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8kO60jm1PYnrg8hUh1dB17ev7nelb6Gfqsr+uoWX7BI=; b=IrpLMtje7orhYDGUFVnUdbexROc/v8LA6FDLr+ogdJpi2IDyYWhml5CPo8Sj0Wm76Ek7aFcj/rjE5oUVxMxorREyoZMMX6VRtvr9/f/NXWNrCbLKyhMhtUObAz+0DGMqoPm5D9Cw5W0Jm2CoAesCR+YhmeRzXzgY7OZrvrObJH+yQMZDjkdmM96CI7WbPC1FyDi+YWTlJmjmKur0r3h2nnr4cPwV79xtgOD2kLsTaloCt0O/nHwFVm+gf+fpzJxek+0UTUGTs0mLvrzsi/oVXM+27FRoTZUBSuFFmOwxMvcm8DuN2muaqZZngx53PVAk9GM5quzHQOEkhZtbOzORSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8kO60jm1PYnrg8hUh1dB17ev7nelb6Gfqsr+uoWX7BI=; b=r9uehawXbjr6UtM0ZbvSr9En+F42TucOqYWOWptm9W9MPUPCFJuDa+RYXGXSHco6xoYBZLFjtyAG/Lcy7rvsFyr9/Bol+YaVV2pGd+Js2im+EXYma/3Cb8TZWgsQITvLbx3wYWDXaNCqfDhALi821AXlnfJPPcdHpB21h+nYQn1skcse/i8Dd74edGhBG2+N76L1PLq/tCb4/3cjIkTvqinoNz8PYC1mUiRkfkwLqDzhLgwWsOIL8mtIEbP9N2k6nkftcm9M7xS7mheiw/+emzpEhfDJ1ct8PEJ89fCcSC8UtDRj3Pb94u0ITf4pyAI7KlDFfxPTj+XBSHlVbAdmtw== Received: from BN0PR02CA0027.namprd02.prod.outlook.com (2603:10b6:408:e4::32) by DM6PR12MB4316.namprd12.prod.outlook.com (2603:10b6:5:21a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Tue, 28 May 2024 14:30:04 +0000 Received: from BN1PEPF00004684.namprd03.prod.outlook.com (2603:10b6:408:e4:cafe::88) by BN0PR02CA0027.outlook.office365.com (2603:10b6:408:e4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Tue, 28 May 2024 14:30:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN1PEPF00004684.mail.protection.outlook.com (10.167.243.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 28 May 2024 14:30:04 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:44 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 28 May 2024 07:29:44 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 28 May 2024 07:29:41 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next 15/15] net/mlx5e: SHAMPO, Coalesce skb fragments to page size Date: Tue, 28 May 2024 17:28:07 +0300 Message-ID: <20240528142807.903965-16-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528142807.903965-1-tariqt@nvidia.com> References: <20240528142807.903965-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004684:EE_|DM6PR12MB4316:EE_ X-MS-Office365-Filtering-Correlation-Id: ba0eb6cd-e30e-4d74-a6d9-08dc7f22aa46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: VUIbND5lgQXKFiulLEVJRe/HAC74jM4zgBGBM/Tmi1uKYfPsuYX/HLdE0ldzGyvdNmbHh01tAzu7mE95nXfJ2ogIqrAU3yZQJIRN1zuxjjWvVZPH4Dp24i/zsNwbfl78gfpdDVoDPBh+ALth0cDFEwX+kjWECiEAIOSn75uy9pF55EOJ2SjuYNhEWH7gfnXL6e7UAJEtzF3lvj9hzbOtowEPHgLaLUGfzOJwlLBi6BbRtLUPQUV7X8Hjvc6dHyhs9OLRUB/UiCTD8944c8gEIu0F6E7D4rlEZmIVfHs0NuTyj4f2JuZpq7UBKNWmvjF+Y/lv+0eERy7QNRmDNpf8N8AvlYmzs3jqYrrP4tycTy9u/EIv/Sdg/Ya0nmBbqCvifTmaB7GSFyF0viP+hMIPRqTbX3U3ybdXgNXCtzIWfqYrZgFVxmj8rGkYl7uWhmWuhlwY1sZ8mmJJoP6wFEip896BOTdjRiE+4Njk8mFFZouDizd2TWuUVDfsZhU6HTNqV3rEpOhDTn2sh+JxqXs22s3m8IQhoGQgJzov9+uXt1fD5xofKppMTYqPClCl7SBhW8/pUawk68mDddkFRJXQNalx+EBQekQbyBsZmDTo572XQDGfuL9mCNJnsfm1Ov8ugS8JvfSvV7HoR3OHvPTcfLvSV4Och9EpM4lzde8mlpCot0/QUZINJ4ETllvktAwNyNG89qO4RXczqo+Z57EnzlQsDpghrORU5+2IrMquvySGzA0TNadMZJVOlcevX/hvu9Ea0CLpxAfZHsDMn2DDc6Kf67hstJ9mFVT2JSiFb0I6IZiJBWVVWtrCapU/8tKACo+pgLUflUSk6EOlZnZlip9wpn4ZC0hUvgFEoYkO8FxJ2OqrRI8NrEDFFhcZga76bfMRBaaxaEVqpJOS0PHdpOXvWEqDS47La9OofDJI4bv6+rQbHcTZjg2z+lNnrjodtEvZKyqUTII+8yEBy0ERoKlmoqpQlufOmX9wZgW286lJ1le7dvP+P0b201+ZEgt0VeZVrALO6VrRJ0k7+eWYunsnNFv64sVvpkBpGQ4NnbMNrJRrlMQwVqJcI4xfp+KhMJ8NI9VkZsHcDTFUJ+Fa6JKvE4QqdX+YaZkfTZg8+O3FLGJuyJUAwRKHoiPDVX3vtAN5wiWJahPiG0om7nN3i2z5o1x3qB4r5nkVw7kJ9A02onXkJT1XNL18g9+N8rOE0L6A5QQmcA4pkjcL6oGPPJIWLI62CQgLcHbVNrbrlPVu/a7sEq+3pG5prvlTX6ccB6Sre5BlE02snxqprsO/zsQdhI6QOALI3a38yK42uPVeIN5HnfeyOkcWJ7Y1st1lcjAf4+k8FxoeFLCyETGMfJyn3q+6O3u74c4dJ8FuJz8kIMYWQg7YfwB2HxvKh4dp X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 14:30:04.0265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba0eb6cd-e30e-4d74-a6d9-08dc7f22aa46 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004684.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4316 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea When doing hardware GRO (SHAMPO), the driver puts each data payload of a packet from the wire into one skb fragment. TCP Zero-Copy expects page sized skb fragments to be able to do it's page-flipping magic. With the current way of arranging fragments by the driver, only specific MTUs (page sized multiple + header size) will yield such page sized fragments in a high percentage. This change improves payload arrangement in the skb for hardware GRO by coalescing payloads into a single skb fragment when possible. To demonstrate the fix, running tcp_mmap with a MTU of 1500 yields: - Before: 0 % bytes mmap'ed - After : 81 % bytes mmap'ed More importantly, coalescing considerably improves the HW GRO performance. Here are the results for a iperf3 bandwidth benchmark: +---------+--------+--------+------------------------+-----------+ | streams | SW GRO | HW GRO | HW GRO with coalescing | Unit | |---------+--------+--------+------------------------+-----------| | 1 | 36 | 42 | 57 | Gbits/sec | | 4 | 34 | 39 | 50 | Gbits/sec | | 8 | 31 | 35 | 43 | Gbits/sec | +---------+--------+--------+------------------------+-----------+ Benchmark details: VM based setup CPU: Intel(R) Xeon(R) Platinum 8380 CPU, 24 cores NIC: ConnectX-7 100GbE iperf3 and irq running on same CPU over a single receive queue Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index e6987bd467d7..54edeb8c652e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -523,15 +523,23 @@ mlx5e_add_skb_shared_info_frag(struct mlx5e_rq *rq, struct skb_shared_info *sinf static inline void mlx5e_add_skb_frag(struct mlx5e_rq *rq, struct sk_buff *skb, - struct page *page, u32 frag_offset, u32 len, + struct mlx5e_frag_page *frag_page, + u32 frag_offset, u32 len, unsigned int truesize) { - dma_addr_t addr = page_pool_get_dma_addr(page); + dma_addr_t addr = page_pool_get_dma_addr(frag_page->page); + u8 next_frag = skb_shinfo(skb)->nr_frags; dma_sync_single_for_cpu(rq->pdev, addr + frag_offset, len, rq->buff.map_dir); - skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, - page, frag_offset, len, truesize); + + if (skb_can_coalesce(skb, next_frag, frag_page->page, frag_offset)) { + skb_coalesce_rx_frag(skb, next_frag - 1, len, truesize); + } else { + frag_page->frags++; + skb_add_rx_frag(skb, next_frag, frag_page->page, + frag_offset, len, truesize); + } } static inline void @@ -1956,8 +1964,7 @@ mlx5e_shampo_fill_skb_data(struct sk_buff *skb, struct mlx5e_rq *rq, u32 pg_consumed_bytes = min_t(u32, PAGE_SIZE - data_offset, data_bcnt); unsigned int truesize = pg_consumed_bytes; - frag_page->frags++; - mlx5e_add_skb_frag(rq, skb, frag_page->page, data_offset, + mlx5e_add_skb_frag(rq, skb, frag_page, data_offset, pg_consumed_bytes, truesize); data_bcnt -= pg_consumed_bytes;