From patchwork Mon Jun 3 21:22: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: 13684380 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2072.outbound.protection.outlook.com [40.107.236.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 491925028C for ; Mon, 3 Jun 2024 21:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449817; cv=fail; b=ozhMaPfnGD8M+wZbMP2uYkKpzLUQe1gWJZQXmwk5UOlCpB47qYPja+k0nyG4LlbI8voNEK58axEu7srAUQbX7QlAbjJHT6RY7J7OKBynzxGbZK77LCyMlK2e0OAtWC5ev72L7B+4kSPNtUVn2l1epEFI9iNOPdUbVI1f0a8GsWQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449817; c=relaxed/simple; bh=dBcJ5HZJ3dF+jU21Vp9+/aDLLvaZmpTAJhoLSal4hVo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SWmygQZR5ZKcviVmn3XzsLRaWWnGhIJkdnbHMQShLpYfE8hwQ69FLqkZB8CDeFVulzd+5Sc9OwGXnaPPiTH/eaIHG+0hAmHhqvwcbgNrU4h6w1qpYGnWAfOu4PNdZXmDwB5K93WbZjhNoJ9maivIptSmFPiMwxN/ZYH8GUedGEA= 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=Rqwfwom+; arc=fail smtp.client-ip=40.107.236.72 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="Rqwfwom+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eu0dSvIO/wZznOVrs6qLlkAuWnw0yQyG+anDoghZd3+5ecoJAhJUB+LbXL2LaEmJtZscVq/IUYsxshYZ7Iz4flkww4vW/fErp+/PKj2122nHUhHgmqd3RaOb2Ad6Qk9Wo9S0w6MzmPxVzMRfXuSdcJVcy+pccF9gQxQn9QGfTfAmhUM2RjcT3HQUtCd0xSnvtP5NMMkwiXO2utMqEK/mOda7dCJXLqmL8IyqP6zD/D35S39hsvqQjTIq9yNZ0u8j2emmxiAeAmobZQD63kWrJoMxKgqfJTpLuqFDEa6dNaWdV9dX3Y4s5IZgbs/IcMdKD+yqt8c9aVvBCzUWrUvMxA== 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=gx9W8O6ul/nmUvebn1ZsRYwUCjIViIT9f730nvBjrz8=; b=Y2qCJ/LbPVp1fe0/4HiNy9t7lujonHDHc4NY9VUfb5uNGgHQqjc8tbEvAnB2IKuFJgHEKvoJKJS1alGk4Fi80/lvKAbOBWIMSy3JINY19a37YKPpwwFRm0ZpoeuXTE8Mw2O95mE8NthdsFB0wto3O05D7lE6+nHjZ4ntXvf6wxq45R2uCAI0mP2p0FjjkAvlexMsh9fboTWIdRUDdTtMsY5KGPs5J2y5CQkN4OrcsASwT7ClRNE8LJFb14VUue4wFmpmL+sLaOO0WXC9glbb9pKmYm2KGzj57diChC/94rLQEtpgbMeW0exiK+kGKej2REutOtokDZoAvXTlEhTKRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=gx9W8O6ul/nmUvebn1ZsRYwUCjIViIT9f730nvBjrz8=; b=Rqwfwom+ydL+kGwI/fMjL7kJz8VuVBwrsfwjz0weDWVXVxnDn0Exsfaoldh6GPG9dbgHfHvAK6eGZ4dyMXr+QGyOKonStwcSuqzxr6gJdJB85N8nGhvx/IyrDZWjo+uQmObYOdxsHQhK6xBT8yn2KIwFkVM72sxMaZSxPBHuN8EGprEkeVUmEx+kTxz4/ZvUwSZjD3dTo+qjNNDb37YmGFUfVysXp5EBeYQwjGTj9puBpqlhk86NPl5royCgjlxKlLTLV+KmK3YwMd0MTlcQu1hMCCMB+RaQkFCYYBBqTmGmXVXSoyNRXXt99K2K5f4BW6InV4lzoVTa4XVQQeNn1Q== Received: from SA9PR10CA0017.namprd10.prod.outlook.com (2603:10b6:806:a7::22) by SJ2PR12MB9243.namprd12.prod.outlook.com (2603:10b6:a03:578::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Mon, 3 Jun 2024 21:23:33 +0000 Received: from SN1PEPF00036F41.namprd05.prod.outlook.com (2603:10b6:806:a7:cafe::b4) by SA9PR10CA0017.outlook.office365.com (2603:10b6:806:a7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F41.mail.protection.outlook.com (10.167.248.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:32 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:21 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:20 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:18 -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 V2 01/14] net/mlx5e: SHAMPO, Use net_prefetch API Date: Tue, 4 Jun 2024 00:22:06 +0300 Message-ID: <20240603212219.1037656-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F41:EE_|SJ2PR12MB9243:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f7b39ee-2d2c-4e00-89be-08dc84136bbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: wGd/uVFumclQj5tidV3vstX8MqxcVg1IxT3at/Do6wSKAw0GPBH0hCk3DFA7q+QKDyEabjQe8yXRvNrhsEJBCBa5Bheql/nii9CqcF78g2Ucm57+d+jeWvQMfWcIi75kDfo8C85p3BlgvJFvFnT3KrgsIn+vWxAGL82o5PkRkDfdUnnw+/EuszPQ2G3sIrp6W+EXYhkaN88jXim5sQ44w0gNmSSQdVwkP9CIlyscQZcpTT7QBRgDW3pwsBxOe4GuZsihhlMpk819OUVxEurZltoayMu7WnPIhTL+7JXAxNpP8eXj5tF3sgmCIweQBw6z6pDv1dR6MIdqTOihyhVqxed8vI25O4tX9q3GP4kFBxEqbIZr8DpnD/bTELmj1XHcrJC2N5zY2eJ0fkEd+RfQESBv09vPRKz0yx/Udvra9i+bcXI+a8LGET1SDf2nyeBOAK0RG4aEFMvYcyiZv0zjUE/34qQlGEv2Wrk7lDaaUvxiSP7t7ThqKHhn98zpEKSpqBAywvamLHrmVHO3NZ4pk6Fr6GumoG9ZNyUGwJNhvvlcpsHeUMk9HchEClVvsq2g8AX4WJ3O1aqcCUQaYQ+1y6zVzURub3doy7rOZ7CRVcozToq8Fsy06LE5VqK8qBTnGfPwz2/L5SuU4XUUlXYyF4QJMf0FDAvJOFsUqLQkLWQHE6x9G+vlvqt1L81XFKkOrwdzJFJusubnSHg8ur7c6Y5h1FHhbdlXvTdh3jixwOgAfDkNfTnxaBNfhx9Df+SKAZpbaq7MfWSl/QVjqf9b0ASwoEku+WfQ7dA86CeOOkMPOFPLkz2dYUmpNooLjRvpFqER2NsKqEuDvIW8gv7qODUji1BoaTEKrh5GSagYBc+p9H9sIryNzPLjMXxPp6JNvLMmS4Yzqs6mFEa912ZrUVNYHARyWtn/FGRqAj1tAct/auZnh4rdRAe1nbg6ejG9NJtRaJGMl+10+wJZUmu80zDUaoea/uf1t+E/jub4AQJiQL1V9eZ8GOU7dImhfvNGx0eDlNF3xgPSaH7BNic8d9av0xZL0XPMJII5Kkm4G4hhIKqCsulXr8T3jKKpT2fdNSvdgw6NcyJgTplw2EK5SKxKjleFkLramXuLUnzZLrpKPrcOTnunNDuPNuflgmJKF6LlI6nHCqqeFA3/TcyOa9xHjQA2YweNIB1ghm2X0a+LIlhnc+kdPv4RuNMUx/WOsQx822/2I9aIN02gnBIsntBJHftdNfMdW5uD/w0ZTxvV+9qXvVmQEMyAbSaCQ4E2dotTgZfhTJixnlfDne2mu8FvnT64fgigOIsr5THY/QAfs5zwQbhkaoMHdLONe8elKkyhpU/AdoFBeb1ZPAmWpe5Iwn1kY70kPE+TJQvOq5c= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(376005)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:32.5255 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f7b39ee-2d2c-4e00-89be-08dc84136bbe X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F41.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9243 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 Mon Jun 3 21:22: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: 13684379 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2060.outbound.protection.outlook.com [40.107.101.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3895713BAE9 for ; Mon, 3 Jun 2024 21:23:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449817; cv=fail; b=GZ7LGqUcyMjq+2klgB21AEeu6Igq5RMizLOwv76azVDEnwHAqaSe8sTplgOqUWyw2qBdA/3/35OFoEoEVgLbvjaQg6d/L+b8ifwWpR4v0GZvtoTE2BPtHdGdYcUb+Hsa4fTCc674mYnAG/csfA5SkEF+ND0bHgK33u6JNy4JYvw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449817; c=relaxed/simple; bh=1FthCNNOGz9oK8pgeflZwE+yh0oZjLKXa6rzu6wp3zU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hy3Buy4E66MlH/L2+sys7Y8tw9OIJbsILhHF+DhUOXcvWQRPE77/YjKb8x8pK66nLiLIQkWpAvMkzUnMWlH4d4v8AxltcgaXiu+zxjXAedj9c67XJl/Nfl5mfRF8jNzeF96ncWOp7bzP9tLDcWbT3/iDGOC0MOtW9ji4U+MhEus= 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=GDmltgZj; arc=fail smtp.client-ip=40.107.101.60 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="GDmltgZj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pcs3Reh5b6Wh8OInKtzamwzt8n2WzzkP4Jy2AMei4Y7O8bWUqBddTrleC/z/HavTwpB8hk3uYNVv6r4aCcJtIxnYXI4BOUhC281xk9Fk8WWSvOMrKF2iHMh1V8RB0cYjjzu4Tu4rSvtnoTR0GeTdSp7+MJ4WlEKsZwwr1H15u6Wf7O4vlLjkZ2KhsH7R9ab43URzGL5J9rhqJ5NgBMp2LkF82mC3qRGceUg5Fdi7h8MukU6oeirm+X//RmOx5UFblXAUoTyF4ToLwfMrXpHZm4FcAkMZyfxKgL9Kg/u9yZYh1qForbZ53r5RdzZ+eoXC/kuxjbLrjgaAIqvrPFTn1A== 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=QEpv5Oe5uQGIYCqrKy677HqrURlXvR5fDfWejtUkfCA=; b=LS9+rL1sAy8k/trpTRXIYnKWi/bMsZC000cdf9LWsMnNdNGzQOD8EMJhc30J2CDGpu0W1tsDeN881i3vLIaYTiR+Q2Q60zhLAgv11HcmwFjpfZMv0ycQM7FbBFhFnt0kiPEFM1IQnAUb0inr7riWpjnZCiY5SLK3T31dC3QtOXz100EeDDKVM9q1qUy81uQtjxwibxCs5oIeq7Bt3nA0c6hwjUFQlxxT22/AT2rBZ6UprocNrHnLcK2gTXLUKl05VByWzgxDimHxwCusvnQF5kEA10wRiU9+GwbJargBcpMiWdcOHbsDeR956OvcIGR9RqyLWTl7231PNcuS1gVggQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=QEpv5Oe5uQGIYCqrKy677HqrURlXvR5fDfWejtUkfCA=; b=GDmltgZjGJ4T7JHyNDkmOLvO9n7Up0frHA1IY93RrSetJ6docYHqknF8IIOpGK2IMfucNGYUYUMnnWv/vUOohcbZdl667ZWvg8l33RbuZIGxzkXHI4lfDXbv8Y5My5u8ww7JEqSDja284JxnvDa1hd2jpmY3QzFF79gDfdzTPTRbDzRJAZQFptJZ+QQwdBhJKkw7YpDgnku39GZLiiZPWumIj/TD169xi8dlivUntzM7Iko2YV+1BpiftDiSESquNdkuxlQWfhWRR7OP/Wj9y9WooZ8J87bLlAIV3jBRCsNotwMm4N0UpnjFn5dsRhTjpZvPBim3BZKazktUAIeKIQ== Received: from BYAPR03CA0035.namprd03.prod.outlook.com (2603:10b6:a02:a8::48) by SJ0PR12MB7457.namprd12.prod.outlook.com (2603:10b6:a03:48d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 21:23:33 +0000 Received: from SJ1PEPF00001CE7.namprd03.prod.outlook.com (2603:10b6:a02:a8:cafe::49) by BYAPR03CA0035.outlook.office365.com (2603:10b6:a02:a8::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CE7.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:32 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:24 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:23 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:21 -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 V2 02/14] net/mlx5e: SHAMPO, Fix incorrect page release Date: Tue, 4 Jun 2024 00:22:07 +0300 Message-ID: <20240603212219.1037656-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SJ1PEPF00001CE7:EE_|SJ0PR12MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ea1638e-4867-4347-f3c9-08dc84136bed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: j+yMa8KhDj6AVtO+X57FXp9Z0gBxN40NZD3Fsu1AQWxeQWdL3Eaw5sWXWaJhnKqq1XknPLsIPxRGl2pThGUeFxeNHFOgwacKBJMKZ9Dt2ebvQyRd1Sjw6of/cKfCi/09QYb6RY13UYVcirJ1/pGFINcOzKGupaaiAXS0p+UX7VWlUNyefdcezjFPvfAAwqBiJbEnyDnTlLh27MUe0czG960QJhYYAS+ii10M4lC+bgo8vqXTHAbtsWh4R+L6jaO1yRCc4NuWuzk2NoXmV5cnb2xYR5p5WHMMKyCI1D9WtJOHLtwlGp7Wh+VMyv382CoTCiOoD9inoTJQ+BbPTRMwRG1jv+AGNpL8JgRBnkSzrRiP7g0O2iy6mLkA/rFP0nXD+3NlU3ingteqH3ETBTkrbabinWU8A3HZrAw00SWD1eXeP5DMVjPxWCeXUYuiBSBy+ffkyHl1rFX1x9QAmoAJanTqE2f46AMZiDEVCIP1stQBk1g/+gFRLpQaeW+8pWhOIUivyWP8WwczhQ65aBJA4AY8IKbeAhDbdqImbfdpNo1D0EckYSHBRkhC4mq6nsgoGsS7UI0eUH1JS2GmPLeYPq70I/+/14CCXZDuxI03Amd3eRUoqTwgcOSEmC7wAp7YxJuJQ5zEebwM4ovd9XyAIphHUUQWoavnsZlYfgQPdVQQ9A6feB59/rTKvB27Sq4QxLDDU7mdwvsGmGmoVt9j6hLha268FSNsgZESM3uEAf72YZ6sKDhxccyv+djX9tTqjN/Pp7FsmDdA11qIEBBUc09/1U57JXFBeA/Q2R/C+Ft9BYqQk24hlY20FOB9Vx6JTJkIe6Z6GzlyHzuFfyPCrfzTLYLY7UWVtlS9X/X1ZpHAaiq/pHDFQmo2mITxFRDrOwzeBKfcRW2TRKUTA2lhKPlCezAlNwiHtj4SKrq7oEXC2PSfPUhnkG6YqqaIT8/BTZwIuyFAmsy2p5ZUyN/72ytBE5mzsIsOCW3cTkYA4dYYkp7LaHoEnm3ABxeMneVxBY1xAe1+/tIEbmGaMYcPWoWLMv06MJDf2UntwCTp040jAlN7YUH6PNulgzPkW0Rqt+o35PU7R8xS9asJJIMuOLXf4rTSSmfyrJkfFM1sngQ5q+0qZte8HW+1Gt66PrtMBhzYFgX6n4FX8BKgmXKQBg77qn3lDYRs2cbdIgoN35ao2uJEMyYDI0qre1jYX/usa1E2r+/3DBRtjPuzaPcOvhttxecvyDCs+7AWrVUTi/FS4E3leC1qaBHdxMknoRSD7FYhzVj5v4631LAr/GfMkxpTNNfuz2/yo5OvMXqz1NM1AMCgMctOWG5o8oaTdNQzNdVAkmCjbWlEzk/nTkLUIzDkCDAVcuGzVe6r10okQXY= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(376005)(82310400017)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:32.9456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ea1638e-4867-4347-f3c9-08dc84136bed X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7457 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 Mon Jun 3 21:22:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684381 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) (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 786BE13BAD9 for ; Mon, 3 Jun 2024 21:23:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449822; cv=fail; b=nhQCIC+YZ+9XH1VV1OuWloRZG3EuVO/t7topoxrmfYJkE8LONGlvklS4DJ34/81LbrvysuPkpjT4FRwGaw2sZIx+YjBMiyfNmhxn0JPSLr9WHulmIkdB9QaFZWihFzhA9+Tysc6f3NBoPHv3bIuGyrD1GUQDQODxe3tMi5FKbmE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449822; c=relaxed/simple; bh=5rvU00bqniOq/QkJOLJKmhg+nrRkFWKgEOe9LPleFS8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rDGrHhQld/4n/dbigIhTeVZZcWJ/6vI4yq9yyNMC9Ts178014q2qfE/V0OJlmca3UGeRFfR/2qt+e3xUjcPu1y+KsvWQsZqU39y8hcBql35AsEqFsHjXjS2YzmZb6OzYnxeq5Fb6+5dIr1dqSdpaZu3xrHS6sXOSPtgJX67ACxU= 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=cFsiAQgd; arc=fail smtp.client-ip=40.107.94.56 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="cFsiAQgd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L6+i3yEzDZ7q6eLUU049no9xSz+ZUV1APmw6bHtbY4ls07Q9zfP7O//nQ7Ag20+xcL6CbR2+stYIP2/27xtP31Y13LeWZ4P1tb9xxORfZPwdgOgWGuZ/N30FE4L9ZGtgVWjPpTW7ddEMrHkHmd4FAr479ytPEJmM7h3P6cWymKb1m59CsWuQn54wz1gjNQ7hBpKs9N0azdJvgXuWwjAeU81eGDDp+KYng1mumtiV+/CVlx2v482YKwlGQ4WHe3YImo2WEAG3PNJ0Lftp0ak8RdOXhu4VjFD+0d53g5TIOhDnKAvbjfoxPmIzzHO6407hBw0rx98FRT8W4gkxIU+4tg== 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=Su+vmJLlvWp2n8EK/A2I/74lxbjC9nxgafEP1iqUJOU=; b=OTmXZzKjKLjI4CRRMMiLjuFUKNMhjTtNRWmGV1Mel8Azgxm1Ze/V5XGBaVADi5+iDE4CxYqUsAwL2T0VmI4vHwA62mJONRm4dmml49yQ64t2geAT9LRrG5tblRPn/P2JHI0Zxt6JRSVnVnnEJJZPbA/zdvhMHw/ojteRBtELlFmdRqxtSemvt0okuuK5fY2tGmHKP4ejM0iM6FbPlj2hwXq0ZRjDFwbeoUX4r640cqP274j93m16/6s9hgVCtwyaGUfld4k2kjetsUPNwaG+WYZ/7N384ixSpYdfqR19ofsx0s6t2z/LFkPuHPEKXuNqdA+WLnWBJXGksoOWst3ohA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=Su+vmJLlvWp2n8EK/A2I/74lxbjC9nxgafEP1iqUJOU=; b=cFsiAQgdHOTcPGngK4fVQk7ptD7ume7NNmJL4mGqLPqFEJrv4LdhTywApy+jxERkAyAsQL/dgR7rFX1FAONPbSlIPItatnGgkhkfuW45/gzNTAXcx3Qh8wMPHPEf5KavcKG2shGsezd7Z6IZp2vZXrGjj8uwkCAeXAb2ZeekIxUbOEw+i3PqS1kT4JpUnJ5H9MYPx+1GpjxD4dx/F3SbYtg8SBRb6I7JO4PniyyPIIdJ4nyliKZ9JqIcH05sdzbtVFQp1bp2qQx6kNi/G/SaFYmfkYF2ohAetX8nRsutpgFa18Y3fHGIeKzUT4K0GKSThCRCfxsmFPFnGFEWgWqZdg== Received: from SA0PR11CA0081.namprd11.prod.outlook.com (2603:10b6:806:d2::26) by CH0PR12MB8532.namprd12.prod.outlook.com (2603:10b6:610:191::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 21:23:38 +0000 Received: from SN1PEPF00036F42.namprd05.prod.outlook.com (2603:10b6:806:d2:cafe::91) by SA0PR11CA0081.outlook.office365.com (2603:10b6:806:d2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55 via Frontend Transport; Mon, 3 Jun 2024 21:23:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F42.mail.protection.outlook.com (10.167.248.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:37 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:26 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:26 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:24 -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 V2 03/14] net/mlx5e: SHAMPO, Fix invalid WQ linked list unlink Date: Tue, 4 Jun 2024 00:22:08 +0300 Message-ID: <20240603212219.1037656-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F42:EE_|CH0PR12MB8532:EE_ X-MS-Office365-Filtering-Correlation-Id: 272390bb-9f17-46e2-8e05-08dc84136ec2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|36860700004|1800799015|376005; X-Microsoft-Antispam-Message-Info: J3rcdhn9bnG3PlFZwtVLQCcpJiM9j9JQOOVkMPNx7M8Gzvq63jCQMlLHmz0ipVYf2F3YGbWlrlgxD2OZAgPyDifY9DpUiYk2vMZfx1jM0LwpALr3H63/AzqTPcMArkg0Td5N08SE9/pgMbpX6izprUizrj3H9QaUBpDlifEqZAToS6itloELhSxO40dvXacp2uC9ypVVyp+2oGaaiE76W8Dj20HjL1+77aTLOriPH4F1zCFI2F9sHqJ6g72En5P6g+1l6MdVxjGbxzdbIhIiRw3tIDkD4rf5pAsi+vslgAutsLZCeKSBxpKtCg7em4jV9UcQKMPHqevHVUyM4MFmykAwwL6AW9+yV9VDIKwLp78xDr5g0DaaWHSyshz2nqRjDB42wAR9X37mdCrTGBnAf1xb4aA/jtZgsGYgjuXyQxh21Bo4IdwSjJe8f2W2ZS0ZWPC1rCaUT1LUQIfJ+2vQ2uhkgBPAdSAIleEVbOgIe71ZpXpWu328lAc7JOcAt3GLVQsNxfbKrorFpKDzXznrQ91ZekXDXWlyIy2hZ0R2C8eNIjUXVMCRX4ONHbk12j+8lhC9SRCJykoAD/0AWRAN6RVYCdJPBzLi1+CJjotD1pe7E/81E/Lyc3evyPtBLP4sczMC9RQzdQ3GUF4eHlRjCH3Km+9leeG+KJ1Wr16yIGXlO0NPvTYdUv9CTqHvXSR5VvqipRLWgIPanHTkdDutcbwe3kBNc2z1eztJhzDTNt6X8EQ//JruPouOQlhcyAJQ0B0yoRO2CynpB0AR+X9k9u89SXBkS3Thu/FDEy096GfqWRjtudfZCyVdzIcGwyFvQ64PFwAomdxv68luMcuMJnM+qoYMgPfbTfgiRd/0++y6L/vaOyShFAB+MVZRsuZdSpKVraGL+WWV/Zzdpn7SoqlhAAx0+ZghNF3kGfOglFgLyQHWTNhx0pWrKxag+4WJ8ya6vI43I1idx0ayTv+Ke31PkvGVzM5PQIRkg3AWI5Jw9zB96AT2+u12Josu/AWzzW8FWRD/06fIUpNJSeyxYYHlttbg24q6CP3LdXAZF5ooDvJsfehpmFNSt0xKJ7iTYJGBeZe0xUC0YI2pyoNrK6KC+k9VIcxSkSHX9tW3q9NhyEMfFpi9bxurAAXkhSA3FcUmmU8n67FZI1/0nqLGcsPVS9+LzZ0q5ZUWZm+f9ZETR7K+GkRK+ZmTqAd8ZtxFobiJo1IyHRiFzOZYDk1V8o68b4OdY54coLDiSPbmnbMc8GFEdfcqHxf/umTgk1foo6qs9bcU1fV/i5ZWbIrjkk9BfNskkT3+q/027GlgvZ00Et8p8DvneDkw+mov8wHyY0pQaVyzUtzYN9SICqXwCYWq7M8V5Lmkq5fsWHZCkUuRBhIzjV9SnYYMKGMn9f75 X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(36860700004)(1800799015)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:37.6006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 272390bb-9f17-46e2-8e05-08dc84136ec2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F42.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8532 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 Mon Jun 3 21:22:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684382 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2057.outbound.protection.outlook.com [40.107.212.57]) (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 3E57B13BAD9 for ; Mon, 3 Jun 2024 21:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449826; cv=fail; b=iA+rgPHoK4cY+1XXRCwuz6Ha6QsNohGE7wd7sm/yvbG6cS10+zCD5U2lvm+VfPXhsm7UE0fICdjxuKrxRUI1DPcoeB5RxgYCWK92hm2KzfyTQ9yJLX6oQvknCLluZMx4gB/jsDjlXTNpQErq+yRPnRG6K0HTLplI8weN0a+SfhQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449826; c=relaxed/simple; bh=BmOKbKVa1CG7RAKersuUwWCTWBUBQRSsEl0DxU+jZSs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HuwIqujX5PeLxpYiOD/e7Q91LmmfIDUIChQD8rNr4lrn5LAt30mC65hoxEu6Uu1obX090F2khefzvk0QVe4Tc9mDlRtGn3Z7obs/n5dGXdQ1ehPdAr5YeTdOJ1Ix2RxvzWWb5azzOyj11NLr4Y1dpciRp7aUWxCkFg8plt9Rasc= 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=M8pewcl1; arc=fail smtp.client-ip=40.107.212.57 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="M8pewcl1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYu4RQcO67Du/jivyYSdlPKMPQu3gdnxHG6JZRAlq/pMZRZ2XGMdP/KPKWfQuS17YQo0b+0veWhwvyHTgKh942EoKrJfAS/E1mwRKuP53br+ebOxRAFMV1ker8Gl6FUeBIS3gUVRtzTSbrTE9Y4AJ1yBDeFkbbaXTTYIS8huC9t3nw6zGyniod5OKkRNpc5zvZL6Yier9V31j3KYacrypmTvLiw7ZnmSO8PZUbA89F6zooJRTwwsdiYUJmIhc3B0JbjGiAYq+o6xN0er0wF+2GaSPJtTIeYyP9xoWUDtLsqf/gbNmljX7nrgmyG18cLBPDCXxWkDBcDJ/xTCS+eKyA== 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=ekTscCCgFfc3UI1HivK0T3e6YkI0BW5ektRjdmANkxM=; b=IPKkbdpNTgi78ui/NtnaTfGERQ0r/cx84AskXlJa5sXD4pTmk4m8Ez9HpMrYWG3/AppM+D3/TbWSBANTdq3TtzJSbnxZQ+K0vwQ75wvCEUsy0od2s391K3z1TWgMwKSdXNUBXD6xrhoae5i02JyGYfK5ENUbdWXmfwKSkmkhEGLQDsNQbaWNVse1uA6nKkISD2nMHc719MT08f478ibXOhvFulcblJLZJP7nei1dVyDEWD6x03892qP33JRcm1slpJDcpms2aSR7jjJfh+An0dFf3EGi0Ecfb3P203NorKMgg/dwk6ueh06aQAXEfJBMLZFxqNuRS3dzjHXm2fnNTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=ekTscCCgFfc3UI1HivK0T3e6YkI0BW5ektRjdmANkxM=; b=M8pewcl1DRKNcmxu4FrRFVyqaI/9d9hvGkiYCExQB/nR9W3VvwJ7DMDdNjGzA05iIq2K3ElWUBM1R9uTj9MnXpzQe4KTvKXcZ9DKCmNA3WSFqUEzkO8Z8LJFHwcFnNV4oYZ+sGGiILxOnambUTxTRfAtShAILj/LtBE2KEflDmluurhxeFwyNF/NkOeG+Mel1Hz7lCZ7otZBlZN23PDkFNxr9ubF1eZhsmT8xVRcpCc0Qe1PfpE3xXfDAkevaWuoHT9Jp8vt2LJaOoUy+KuifwEa+ckzFCPkRDLoiQUqo9/p8CmU6NMG0fligTOfe5v0McXSJcEJfRdE3YpXGH5jsw== Received: from PH8PR07CA0035.namprd07.prod.outlook.com (2603:10b6:510:2cf::22) by SJ0PR12MB7033.namprd12.prod.outlook.com (2603:10b6:a03:448::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.20; Mon, 3 Jun 2024 21:23:42 +0000 Received: from SN1PEPF00036F3F.namprd05.prod.outlook.com (2603:10b6:510:2cf:cafe::37) by PH8PR07CA0035.outlook.office365.com (2603:10b6:510:2cf::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F3F.mail.protection.outlook.com (10.167.248.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:41 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:29 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:29 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:27 -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 V2 04/14] net/mlx5e: SHAMPO, Fix FCS config when HW GRO on Date: Tue, 4 Jun 2024 00:22:09 +0300 Message-ID: <20240603212219.1037656-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F3F:EE_|SJ0PR12MB7033:EE_ X-MS-Office365-Filtering-Correlation-Id: e9ba1958-3a97-47dd-21e2-08dc84137104 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: gQNltyq+v8rpCcLxguaw4ZBTuw20GQR70BM6Og/T9GPPENKoHjmFmeIZ/6ozVv6l5Y938UWQSMNoVdGgzcIHcenw+PAU++fs3Z10KuSfcgjR0eD0NyexTDTlsvRcvmVScZqPKg0DZElplF1ea+YezrujHk5qki536rzzr2yMBlD61gz/79gUn7qQqeMEYU/zK8Y4Scd3KvCG8ACRCMFeHxdGGG37mOwpwnb6H1LxVPryjqAbDfvDnMma/kfY5QT616ntsYirK7vsGhL+Nc4YiUL3aUG4rZr7uj47QVpspUEr0Sj20ep3ZPLHW8s9YK4yVRs7CAa9lVVQu65tiIMptUiI5a0Y3o1hSsIpva/MVZ0G+06EZpseWC3q6v/so02J7YQrSoYVQANrRBeXezCMJrnIwhDHGQKdqrz2ugEa8pTZFkN2GWYtRuuuWAmFgfoz7b5Qhj9Ki+ncRpMGqbwtQfqBNwKM5MPtV7ZDB85czwtVYvmcW9imZe9XlU9VPp1w3YZLzqWuuYM+H+IXxVttYe3kWGLdQZ/wY4WpjJghqPCqEbKQpcMhuW+9PHuJNTXk+4XNnCx5vngnG8bUb+92WLnPsZFMhjobtdis3fZ2YqTJe3e4/3n1yQRW+YTEpH6DW6dX8MCjHRydNsQg7ImG5WrVhrZpBdeJpkV6g5/wOsZfmk9p8azDY0gMTuuw58wHIbd2aCHczdtmD4aJBc2jSQvFGLsZuZ7rnvmLmLMin3zc6SLnbqe6SoseDxz+YzfRlPdyRiJZouNJbTUCW3FtGYQnZUWqSjBs2WtcykYjga2X80iVfmURaUIZg3fpVAnzqXPPxbZpGBOYGTiPam9zUNTyyGN2n3hVnYpKvTQ1uuWdarXq0CeJMphMK0V+iP/vuo+7Qxx7nZYkzmyrWJfVF73Jxi324ZQZeqdeyI8DVBrgezt6NhfJ3PKX1LCodIukKraHWVgDlpg6iuOq5xC4ecw/fIU9CHN3TBXlKhQtEl6YYUBsgmSa7u2BOiZghudf9mXtgWS3sQrzzgCrB6PCjIS4NchJKLzvZaUpIayDW1z4KYhETghD7nSRYWu7vgcUP4UqFsRQqSrL4Hx117tFSqcqR73a+9Wz4nK2+qKikS5vBTCsaD80iLP2SK+iLdbxpK4u7qsv+ezQv2UPtsssBiebeDzaMpKQiOa7TcFZY1UN0I8l0oM55mWwULB1OBWRbZXT0ImDOhROyJbYvndyV8F5c5sYgsPAK9WTltvTcVGrKyIU69LZR9MKmrppsadBPTvILi7CJIQ7RLM07qsGKgkPg0z7+KbXlc+cTAxywHL/hqqtywYLaOmyMMhwndxjfYFUvj6p5rtaP5O374oGqHlF4ISLn7UKsKS/5z+G1eo= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(36860700004)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:41.3702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9ba1958-3a97-47dd-21e2-08dc84137104 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F3F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7033 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 c53c99dde558..d0808dbe69d3 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 Mon Jun 3 21:22:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684384 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2064.outbound.protection.outlook.com [40.107.95.64]) (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 9DC611311A1 for ; Mon, 3 Jun 2024 21:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449829; cv=fail; b=dzYELSiF9vuJOaQNiTCnMJ1eCz0XyPTW0VXFeET2blsaO4NBVlSpIXfly+GoTZm/F3Xso11yZ+4ws2ZPqO6xafi5elNb40rT4qoBtpCM20aGmCFsw1KdRiL47pn+0KUNO+wcF7ckgKAgrGhl9FXKmUdtjVCOOnlDEgJq6aN/OdI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449829; c=relaxed/simple; bh=Xc/1KygRMhfy3dfPvcCvjQ8oUblvE+xzY2tKItIh9Dg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zo4Ae4DC+5wL3J1AbVwJL4dEX87NJjUMUDiCQBupO4kjQm0ciTzTUt+mPYHjbwRe3YoUJoYZRqr5TeaV4RmuzJy+vh9/eXozi+9mkWykshIpNiyNdrQVPOZLb3d4imFebHH0eROnYJhPzYpKwn9ndQM+6pTJThojPqWNF5AfRCw= 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=SyqRst0y; arc=fail smtp.client-ip=40.107.95.64 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="SyqRst0y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P4ufLEK5pHbLvruVcA3fTdMdfN+f4BVbDPS/9thN2l5EwgtMqpxXW0jXq1VpdBjA531QODsPqKm4svfLKAaKN1K7mubaX18jCD8NHMfvXFv4lJ+51yjmT9NxHesKfqMeZWTvBw6U1sR8u4MmqT73PlI5qm/DcgfhNMVUqkcgrs0KqxUBPSllj+DLGDC25ZQPkdyCa9zUZ1rnZjV0kcFSyhJNyqIP93UW6x5dyRDOJNuPRYCeHliXReojuuxeEwEQsNrKzRV2We423Ap8MmrvTsH9TKa/gHSeyWVuKZFoHK6FkWcFtSSpKIW/ZUDyCN3yOc+0Fyjdo73u0+ePWMg1kA== 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=Fy3IGgLjZxxQ3S0SF6S0vErhZUNJmun5lnhCVsXFVz0=; b=Gp7f1u0T/mOSK01RfdSB3QURUEmAXbK38rcjtjQqkzXcuKtm5CKkFh15TnSljb1GBvySuoPojbdhJKVONDSdTDdq6M9GEejx+WbOKQpFwc0ZOYGNbU2BTjpHRQSachQPzTaPnejb7taS48MqkDykKsb3YLTkThbzMU1BC6fMMaEQjCbf2rTCFqZZIYJP6xlrz0YskR/NeBgrkahZcehl5XGOD5gI+D5H9D0KTY2lyfwEfL0ihdJMHgAl1ilwkxulo03swPnoC2usI5zy13l5MseXnFhR+9jrV6zjRzWTZ+A02NS9z+ZkPjiy+YhxBvDVrSZwSCPX0AmVQNYUQJxkcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=Fy3IGgLjZxxQ3S0SF6S0vErhZUNJmun5lnhCVsXFVz0=; b=SyqRst0yAzSWHlQCiDZcp6j2+JcncZ7jqVsCFIuD+LxkslsD1bJJuyrE4jepDmLHxZtM0o/Ldzu3vCaNquLj0bnxJPDZpkkLTBf8Dh3LG5309WKir7B9PPMOgHRUVvCI1jaCR4FxXZqIO650HHJgSMHfW6CSMbY1eILBk0X/QaZEV8lStkXeaSsQSEQqUFj/XqvFVQTsTZZrAs/4cQTcNG93ztAKCUxxobhjqJifEAMXGIXO6swDpskSElx2nsiPEopUHXF7E+kkIXIAAAzaatSN1Ts3luZkaWfBbk543IjIwlEVmmV0LMUJkwA9yj419ut4Dh0fTq0o+wf8P7+bog== Received: from SA9PR10CA0014.namprd10.prod.outlook.com (2603:10b6:806:a7::19) by SJ2PR12MB7992.namprd12.prod.outlook.com (2603:10b6:a03:4c3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Mon, 3 Jun 2024 21:23:43 +0000 Received: from SN1PEPF00036F41.namprd05.prod.outlook.com (2603:10b6:806:a7:cafe::47) by SA9PR10CA0014.outlook.office365.com (2603:10b6:806:a7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F41.mail.protection.outlook.com (10.167.248.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:42 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:32 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:32 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23: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 V2 05/14] net/mlx5e: SHAMPO, Disable gso_size for non GRO packets Date: Tue, 4 Jun 2024 00:22:10 +0300 Message-ID: <20240603212219.1037656-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F41:EE_|SJ2PR12MB7992:EE_ X-MS-Office365-Filtering-Correlation-Id: 45f8c0af-31d7-49a3-7d86-08dc841371e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: GDgbjWVIcoXFmQsFbMF1S6Uouje6mVudNLpe3vAib6ODIjQezuI5GqUfxyMFGUB84difsLApjBd+XKyEqtrB7g+/U4GZafDFpkD/Wq150/YLpTckg7bNlBaqVvyBJRDcCq6dTj5pqltFnHsvOYTW1esxEKMTDFLqKE4GG9BbyreL5ZZH7LWFFXmGuSX5C9xjqzdF/iS8J/SGMZzxrBeGnUpof7tT8FChK4whMiXia6heNJVSqgEqUJdYMM4axq5BuXSxFC7plaNjZAZtmGBu3s/C72MI6mwAr5HSyeKJDr4gl+LyGhjX04qOLMM6eK+3o295KFoOxDIAyd1fy9iXM9Xwm31ezTS8yT+amXOmcXekWe3HDLcF5UZtf8xFvx/cI+6LBbF0o36dUPjcBOt+Q8NauMRbiCocELUaSbD2LYV0z9d3AM8rr/DCjzGMqyB7CaP5nYJ0402sCkJKIE8l2W172p9mRJQtEy1r0lVsIMEHcUhLnDcR5xPzTlQ0nl5Y4kleFUSvX+8uhy63WuUoHtqY56wNi6jFAQ7lJUlS76zXWXMh+vDSJxp2TvGDxavjcLgmTXiexq3pJnHyVsT8c2bgOY/V2YWg8P9GtvIG6Wv8md5XuvpJpIZoF/UBcOKKJKzHDEGVwZv9b16qJDSywE3EZjxOK33v+Y75Mt/tJtwU9NYfSo53Se+mQWT/tlc+L/9JDqXAPLVZB+IIeG/PMppvpEF2wVAIc+kIPEg2SKQ61vzFqPJ9Zy+oU+6DggPBoDxfLAvy5G7e76XZQQrxt2y9qkHp+41xhDL7GkaifZ4BjNzMFDlQIwZJ3z3uyJcCQlGbMRRIU1zNOTKGgHoMy7ruPbbfXc4QxR9Km+wgK2jxiEP5V4THkmYc8HGoRXysJ5xSDSw8poUwDKMiAV8L/n8nov0Vi76giDtoW3LyDyOiPpTMuFz+fL0A3V7nqxuSzr6AUVEPbmkXUeNujqlPfjJcWsSF4whkJYoqtbKRGd5xS6BE8d5asQ+fXbOmRtsrFQKoFDmcSzeSfgLAMosJPXJpC8L4j6JMk4l37dm0qaIicN3RlKqAi0YP6SxW/2jE3pGqB94hzkCwdcbVCMMvErcMEL5txZ0MswNtUFeCjmfnhAFwXlJn4mOJZEPrBpOiYbApU0a36WS18Qy3sChfQO54SJd//CxUQPiDX/YbJClkrLylQnl6nlxsE1aa+nnACt4p3b6MyEDxG5iGY7krU1GPGHnzMbG+bU/IGuSYVIjlsbgiSIEZpD2RDp0Fvstn5b/Uko07SFlhXp+UPkMeETlWd8Mhz7RMtD57GHyz+3tnxY1nhvAnbIwAn061HRSymCWVqf+fATlb3OC1sq6gNubUpFNuf0KV5Bqe2T3yoDo= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(376005)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:42.8693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45f8c0af-31d7-49a3-7d86-08dc841371e6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F41.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7992 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 Mon Jun 3 21:22:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684383 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2063.outbound.protection.outlook.com [40.107.237.63]) (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 1E019131E2D for ; Mon, 3 Jun 2024 21:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449827; cv=fail; b=IHNqIJzxrI5TmBr0/v+0rXh7CONEsDWA8g8xtf2AzaHEyJ+NPPC8Cfn5h6ZZIjmOZY2FeJhgInL9lbgtEBIxNCkyw+1ITuvj9ECyKU4kk+1IHhx1tpz9OGbFCtdJie2FOMaEQcPuEyFqqNzQxbAe3/wMRBFx0mfTDZhmXEcCCg0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449827; c=relaxed/simple; bh=f6qaWl9uqXnDua+hheNzGbWRJXbHOEk3c/6udhR5iQA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ik3+zLuADu/ocmyycauYoHHBcmrNxTH9ldUcfCoesMqUOkAtBzK/1QDW4/5HL7i0yiot3J+Xw32vKMnYo4MoxaMuqamlJPxv6AVGM+2yFNTUcvs/VvWphFO9F+tYm/nYjgAjmvGjlGmgzLiweDoIJPU/E1YbW5cWIc0Xe+cuu24= 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=AciXWqpJ; arc=fail smtp.client-ip=40.107.237.63 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="AciXWqpJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CIn9qQwTNuVaUg13TQWBRqthgr+uoIMt2GC8VygSY7OXXffSPIeBRn08NCiDVj8Ix4W3eV2bYzT+gLyyhYxzzhlkJ5qPJmWPynYSDQgIgftzYre2JNymixhbC9XIhBzAzrFGOa8fw9s46RTZH7KIZg0YmQDEKNWRO9QrYGk1sFGuTlX24d7kvWSMQu44QjoZd0zHqem6YbnlF6nn88W/vO6xZcYURyMGKJGY7Kg9w0x4UAuEya3nB+khW0CbkD4FVVThUNlCzup+9DIgYHZs3h0FBgTFYbwLzyzT6FAi2o9C87BIITtRByfLmCF2ANSIlxItBq6p9kG0beTgcMgFaQ== 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=xegAKYaLoRJxVG9Qo94I8txaHZ8DaIEuX8Xi0A6QQeA=; b=b7ibklpmNJ/l28NMykyWvor7vohl7WW0AtW5QIEFj7BESlkCvQEbODRDH4yjvhy/qsRHJprN5oqH0fUQ3eh8W14dTV4bmxjz8R8IhcaEbpJVHlzBdu5K+ZAiUIX1LJbdEwh7eZxmDyIg6qk2V+XiBgaJPwZ8jFnepkNeQzcPNDD9jl1agF8/yzEmm2O3hIduBBugQ90UHTFPoQUhoDo+f4Lg265JK44ojXzgAxAG4IhoPe551sop1agO5LwxKRdkPR4ELXfNVldaR/c+um2EGiNo/L7TlGGG76Ci6lxMX8HuQs58nk3gri7N0DvqboLpBNKQ/EoyDPMJsi+AK86Rrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=xegAKYaLoRJxVG9Qo94I8txaHZ8DaIEuX8Xi0A6QQeA=; b=AciXWqpJXm8TFAt3oE0bUbsXOU7gbTdW2DrMuS0R+eohBL352Kv9DiSgDHr+uNe+zz9csOsKIGiieelZzguyfnFkfLmgcP9YRb/VY68BVvnvelJL/ld4seyw9wjZlAZ+RFGl8yBzLav8wPskFXlzpw1heK0E05A99Ps2JXs40RUPh2kzNVWNnvQeDB2ibPYBcEgxyYt0PIGnyJW9hkwcNjkJAIaBxCfDNW+iXFJFWUu0kDXEDELv87ipXn+eDIDU4qbOm+CrauEO8bYhvnG/sysT2ALBy9KPv/bBgTPChreKCbe3gpFpi5S6u+RI+bmnhiy6rKGjVWQk1hyChhd7qg== Received: from SJ0PR05CA0030.namprd05.prod.outlook.com (2603:10b6:a03:33b::35) by PH7PR12MB5976.namprd12.prod.outlook.com (2603:10b6:510:1db::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 3 Jun 2024 21:23:42 +0000 Received: from SJ1PEPF00001CE9.namprd03.prod.outlook.com (2603:10b6:a03:33b:cafe::9c) by SJ0PR05CA0030.outlook.office365.com (2603:10b6:a03:33b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.14 via Frontend Transport; Mon, 3 Jun 2024 21:23:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CE9.mail.protection.outlook.com (10.167.242.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:41 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:35 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:35 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23: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 V2 06/14] net/mlx5e: SHAMPO, Simplify header page release in teardown Date: Tue, 4 Jun 2024 00:22:11 +0300 Message-ID: <20240603212219.1037656-7-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SJ1PEPF00001CE9:EE_|PH7PR12MB5976:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fad25cd-76b1-44b1-2ec1-08dc8413713f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|36860700004|376005; X-Microsoft-Antispam-Message-Info: 8QWX43U1TK9EiSZzR9JJsgPBIxavRP0w7hFGifu73rFAYm05cmg/57QJcQa6zFLdSpdKsnNuagx6I3zMyQ6/xULBVwmv9Mx1mqzoJjAR47mySIoKqQOxRMFDkJoRjwO/PL3bJGY5P1m+1QZdBi+vCPUEmOqxH6X/ks/wABK+mgh1GlWKACOR3pr6XSelpmtSUZhXZ7O6GfcTFWQp+nrL/uwWveTGCJv7IC0Upu/HjPWNHJpAz4QeEsiXjdSe+AhzRSHqWfwSJ5/u3rBzX5mYy+5nMQIxZjjvmYBb36VejUasArEDIn23mTKhnk//fA57aGeohPFJzksaWfiFY1GWc1Svc1kqS9IVSNVDl4wF6sg7PWRhDMcHtHfATkH+h40EexcmU00F5tLqsJLuDpv7XhRLNQ7Tzzen7dwLm/4RlGK+CrC2N8puIoEn/15n921SJ/IlGkZDAhSvOlvwhwWrJV7Nkf28cI4wwBiONDxMNvRB6af7JOX+KxYX+f7X8CyKlhE5ZKPEwCiLq2XiGTkIZE1Tqx4QXXoxgUiz7NJFVrgQtqyx4kOAALwaUfooG0QiooSuRkMmh9Gzzb/Kpbn0WihGT05rmZDvmDZQCaiRTVqy9laBagTJtdR3Db9VG43vQHrdJDCsf92Hy6pm2jcLnj/vlg5jIJoVyN0z5suwUr7bsVNde8ZjcGLUyq7ne16ed7bLMjmF4hUCTa/sLyTWqvp5bkFJrYLWJXFU71PEQe7gDDPhsuBtw7FBj+z9xy0lY3pouPRTrRB4EEux2JzncQZnQLWB8WQju/1dNYcsp4DGjxgaKVBkPP0Y/+hXxEVYuMshAfp7x2zMjG5i35UeOzEdVeWcmcg9lxTBZaKkPZq+tSwlfSHZO6wPMeXMGvQo55KVa3RiYXGPr1p8Gz2K7belyEIXvNTwZ5vePbNc4h/FtpxIZfyYwNfpPaCDec13N2C/bT/YlaP2BpRhtO3SD8wrpF1MxOzjzuZ50CmNpt1RLHcS6brRC8mXUg/fKzfm7cku1a56uEgIyBUulHUQd4iDmjMYWhn/Mh1qSBFSaV4ryBb8jrprmkijrfugysMOwJGdcnoa7k5ElxAYY2xSGjX3JMtbyOLf6cEdry0TjdgAtfMMryMo4hbcnBBcw+7SaK0AnrozfED+XMXQBptmEPd0CkjtaiI03D0qYW2aCTEzyP7/re7DscjjSB0urwj2SSwymHgBjWw37btSWYivIcCposBI2+cxUsrVEt1CtOzAWeQPFP8FhUtdNzctqDilUG5kdNbW5z2YGtzzboAwSyI1Lq1Jf6oIW8jlvSf4BzUEco4eTM1ryvXvxoAYn+fQbSeTFMpo8zuDtym7no4Qk9U8nJ+2EyAju7gL9/fgTwk= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(82310400017)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:41.8822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fad25cd-76b1-44b1-2ec1-08dc8413713f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5976 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 d0808dbe69d3..d21a87ddc934 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 Mon Jun 3 21:22:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684385 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2064.outbound.protection.outlook.com [40.107.94.64]) (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 DAD3E13C3DD for ; Mon, 3 Jun 2024 21:23:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449832; cv=fail; b=rfEYhVX8P18xz2tcuLy4lOnzJew1H89UY4SOyzKMkQRCtx/PH7HDAub478/0eThpyWZnI4vvUydnxIC2MFcNf1PBSdTOqLQgXbTE0Vx7UDO1uuE/40ZO6W4sKcBabghO2YqkCJmy37Dk/WWKA1I9sJTfsLyBUK40rNwjiiLawOo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449832; c=relaxed/simple; bh=MrtkEoB4QcVfZPsdbr/M37ZSapsWMpsMa/8ED1H/pgs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YzVqLX539MpPxDSlFj6hL14LCeZ5CeGmWKkq+POFuDoF4U10apiCLFCc1y3SvFpTOSmU2FZbHpqMEjvIG0wGLbBwHMfa22un4b3R9gJWVHSAlUV8liMs9AJkJKJn5WK0byelwHSohpxG/eBrjn3ex27JLGi202GTMKZg2vBDwOs= 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=LVI8fxLd; arc=fail smtp.client-ip=40.107.94.64 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="LVI8fxLd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZD8n0GvAZSKQyeCGOMRuKWFnVvL106L43YG6ZqafqE64rwgkG58Gf025tFOTki4o+ytIT+gyv48XvugL87tZSU/KHN+8lBET5P0WuO4PfbtCnsmwlYfXOuym+36LZeW/WoueyM6llwqUW+p7vtSdiKIGu18/dfLs7V7sDF/vtEWF9L/J8RUOUJm4fNAeiQPPIUIxw9+0iyfyqR3NkSPg7lAM2Jz9ExPAvYaCPFAv8sXCM2ureFg4CQIQzBNIIljVcqwiHC0ONND5I7eKd0N0RNlB4xaY6MLKu8DMDQlLvsJjidMkhVZMsbvYG/usLc1JUoizrViSyfjF1IUOsHHprQ== 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=0jrWLwFwKqJRia/JAlXF/3a625sOfAOKo8KuRkIhxFA=; b=kRiZioXKcVw7JkO1UKOX2zgt8RAsXmLzR5exXoNgqXBRFAUCrSYL+Fa/J9StfzVkxX7BRLTS4JNEOFJo78wJK/UIdEr+qA5VYaz8PFDI1ZRSltaoqhVHkLo59jNnuupiDdvxRIbWf5GLq5eNMhgbBAVWWLPST0DYSNVTJL387yv21Kuz4o5NljEWor7Qz47nlmiECkM6xob8z2YrVRNBHdl9AZ/qvOmIZm2bCbWtabt6AaakDjRKqnkz2vPAdZOY57e9mvhXE2BbFBxOh62Sw1ch3Ohm2yerVsMvJifhwB1+MvFteGq9zTCFFEzkpTAivvf3NHrhCQJYgfpW99Pt9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=0jrWLwFwKqJRia/JAlXF/3a625sOfAOKo8KuRkIhxFA=; b=LVI8fxLdLwkhwGIuWwyVcam147dfBASKbFgZ0gFCJcN9zHJPVwvWHRFIK/5QcOu7Lu2sNpqjibOt+mywlJeNT4i7TReehMx0Cd6JVElTj5JtGzaIH6oHtjhTnXIwFCWctTzuyUAzVfHPlWBFMFPJLk1cvmDcocZQcuj7qos+P90qpX/PyzKz+6n+WHodMB24qmdXoTARJPTLtSLpahs/tmjf2BoW2D1WIT4r8GAoO+5NeFYQjnUrwM+9IxjpAX3sRqtVwt/2b9RwPa5oFV6lNpyGXZ+QrseqBub4bLEZF24CxgklRw3/SICGDOVoT2ysXxOmUb4XgYTKsvOdj9KS4g== Received: from SA0PR11CA0020.namprd11.prod.outlook.com (2603:10b6:806:d3::25) by CY8PR12MB7292.namprd12.prod.outlook.com (2603:10b6:930:53::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Mon, 3 Jun 2024 21:23:48 +0000 Received: from SN1PEPF00036F40.namprd05.prod.outlook.com (2603:10b6:806:d3:cafe::a9) by SA0PR11CA0020.outlook.office365.com (2603:10b6:806:d3::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.29 via Frontend Transport; Mon, 3 Jun 2024 21:23:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F40.mail.protection.outlook.com (10.167.248.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:47 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:38 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:38 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:35 -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 V2 07/14] net/mlx5e: SHAMPO, Specialize mlx5e_fill_skb_data() Date: Tue, 4 Jun 2024 00:22:12 +0300 Message-ID: <20240603212219.1037656-8-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F40:EE_|CY8PR12MB7292:EE_ X-MS-Office365-Filtering-Correlation-Id: ed2d7f1c-be47-4db7-af76-08dc841374cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: VdTVHLJ2V9+c70InoGYDTV2aUd04bmsYdW6sdklfBF680Xk/MbQoUszDUgjn9UOaP79qk3H6FKeeUlpfODS6HBDBxbM9tSjqFFnkerdoy/d5MencFg3INhYvvjshn3515aEFaB8GUyKuNbxAfBRd9WLTGBT55YnYCqcxJh5w347FAvejmXbZ+iEQB8+Usi8jFNy+kG+RCxNrPqp4ITTIi9n0Xqhj6UAVhQoV74TC30wb7sxpVtAfM/5uPVoHWYZf1Q9cEGUCBZP9ONOXmdxtFGuhUc3pq5WX2+3FjZYYcqv0Gv3njnOLIYHtMgH/QsFt9jinttXYsy1w+U80wLjzLU+OhyYg0qrL1EWa3OxiI48TXUGKPXTEGCGdaJDCEf3IHESUOkt8bszeOpkAWWVh7QC4kpDzr0xgV/7oXN3iLoHH7A9TmK4Bt928GzTnGA3h/W21UFn7PpnPu7gmzOMs962ukr0OzE/MXxjiL9k/0IOiBlWBIN9PH8JupeCTlMiYoOv/Q/4mcsotkmWwdqlwFG978iYjcIovSe1OYXAQOtpKDmzbzhYSH9OF+tTVrnrQna92y8HYejAZiCQOpgtANf+d9APKpWe5tVzWEWXerr/+hCqdEbitz10AoZHxZVXlsfxPLyG0HzVYd3EX28A9xxYntnwm5huIM1D1yEdzKtrzOXCTaROvrCocdprDsJElzcQig/9DzGvzK4WpZ1fT6F5A8cYgHV5YAMTtnXf0/mBY3pfitRDbknpqw/sOF/5hk34m4Wk0F8gj/ow6vF3b1k64Ngx3OKfG5BbqtjfeSFVLMPX6dHeQC1tPB3Tr97OMh6yNLOwF7IWzJxDjsoSqJXiBvqS5ROfZetyUF9h3sqGTO8epB9bj3Ag+SAaknZNkHv+Vu6ZNU8EDkWz95o0u/WyoWFsZBBdc5qMxJ5YIIblRKWdGTMghT4TO2SeaY+duYHw3cj2jhl3m6fpdwjpMj3rsiYPUM3u+wpZSrzy0pvcmJ/00dERSjAHpBSxoPg/aZvdwsllIWjCr5+v31XoZRhBda3BfeROt5DokzzH0IeuklLwJA4Aq76MK7NSp4gE6yGY295yaiIlNcHsITjuOg2/tRRp2STMDKseQLeTip9oHerb8o+pwAKFXdGBup+FQYLuPZSMbuDxAk3C0ZkS0aBgUDNMvfRVLayzUhWFijO4Lei5LMRtBq20ylk73WB7e6WH8+V9iCq1RkG3XexEmLUbCIERVpwQYfVL1txvj5hmMoKgeaWrMcVJfGCTXDhVsrgBdc2U22GW+Gxml0Jk2nRuHILuUFTDoe21NMnMM4GnLL/aSugoT/72V3yWkRjCoshi4IEnY7Cm3MWJQ+4OpmsCh3Ts4z3nxbwuXe+7pyZYSrtuki0CZqayjs5pbPRJz X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(376005)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:47.7268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed2d7f1c-be47-4db7-af76-08dc841374cb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F40.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7292 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 Mon Jun 3 21:22:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684387 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2040.outbound.protection.outlook.com [40.107.93.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19E4C13BC12 for ; Mon, 3 Jun 2024 21:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449839; cv=fail; b=tx6yr5YR5EpKAvDGTdQLYeh+EGeLR+t7R9kAYFlmPgRYpJA8fmaqOQTj6a1J6hPyA6OTAShcOKJCVL2LtNIKT2gFrK7NcGpw07n3nA4iBg4FkGkvDHpUc3wqI8uMf7thwocCn8WPaqzF+eg1e3vvLEgsF65toqWNZgrNKHGv6cM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449839; c=relaxed/simple; bh=ghZQBU8icZY4F6e5S3tK/Dk4ppNJPavgPl8CXFxEjzA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BfA5+nwcQn9bLLRZEWOG3YpuwIOdlaq/HJqdODfIp9oaHAXsKq6Z5yLKqE/i5y3S9PxsT5ifxiV+ydv3GrsZrc7HC395mQQsD6rwSvHZEmlLa1WBG7LOnMc86sSDQNuVCgMtW//hkUPDYKllRugA39IGL39qPCRtjbfuOscMltI= 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=Yp3UelN1; arc=fail smtp.client-ip=40.107.93.40 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="Yp3UelN1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aUyZgRC73iLnkUIS7OSTUhUnqQNALLtUohNJPQh7eDLexhtMoxySx1FNGMP94L32YZyt5GPKfRNwJaaP4K+Jd89G0kCx3BiSrtwNT3clX+ETqwLrn8gqEAKs8BDnpzzSG2eyR6hOThLOe8BMpMYCFYz8pPRne3oG6L4nk3TeOrXmd13oR56QIEWN0Zjzm0/3iuTg9jsITLRQKWCmfuKQWL2m46le50VqIAS50wgRXwcYZv/9/6VWaTS4TFBb6rcY+wF6qSiwtDraX5sF48F4XaFnrPMpTP8czAe7qskK6m7XAbMIS1eAkIp8MWE0lpXJFZSPnQhxdZCwXK6wuC4M8A== 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=X8loLAjIp1BiRjK7VzCn/rZhfo0ImD+XTMXWMsHEHSg=; b=UAocvgyFk1uSdMDfkLBXcVuS5yKiTJJ2vAy6RIiHVXYglz+FDBiyuoIzR712FAk8TXjuajxF0qe9QIYvMM6dmoM6sAI7p3Y6oewtK62IJmCsb1T8bLWLq5VYeQMDIMcVdShEigNLWwDHDWCKpNpo9COtGvq2vLzW1ZYRVi3XrXEZ/pSVgaoc0T/WpK5BT80nOQ6CpJ28gWvsXiY84M3vfhkYlugKVrvZuiM0J5NhmYL7g+0uIOUUMG5Aps9rkw3aG+GmLV4CvW19eogv6HVIPepaPDmHR2RPvNijBh1o6LNyDlI0MfLj7cyr4mfvpz1LWWdobrGyls3ta0Z0GBbSAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=X8loLAjIp1BiRjK7VzCn/rZhfo0ImD+XTMXWMsHEHSg=; b=Yp3UelN1DT8lRcMsjpHAIztCTe/GQ4b1cDmy+v6KMqCOc+seYM88jYAf88PTyms+MqCDsI+VbFBWZN5qROLf4nk7VZjXoKsmyFWQVQ+gIsgh+2jtwnc7UAPPg14QsQ5RWBrHcAaLrgTAt6vyKj1HEOonK+y4hPCJ7wIIotYwGyX3OyT6NBEoN0Rq3VPZkQKV/zHkSztmJgXkHt1jG27nImVLaaMWgS3izjtn0Vb+WjmiJ7Tjgw3EizEBoCg7/kN5p8cTjqC2r5n6p4ymzAk6F4q80awF3i+UFhwsVT/rLZZt9woQAS3ARFeyLjkaPPvpSeI3HZeei5gZ/1B3R76R1A== Received: from SJ0PR13CA0195.namprd13.prod.outlook.com (2603:10b6:a03:2c3::20) by CH2PR12MB4088.namprd12.prod.outlook.com (2603:10b6:610:a5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Mon, 3 Jun 2024 21:23:51 +0000 Received: from SJ1PEPF00001CEA.namprd03.prod.outlook.com (2603:10b6:a03:2c3:cafe::6b) by SJ0PR13CA0195.outlook.office365.com (2603:10b6:a03:2c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.13 via Frontend Transport; Mon, 3 Jun 2024 21:23:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CEA.mail.protection.outlook.com (10.167.242.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:50 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:41 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:41 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23: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 V2 08/14] net/mlx5e: SHAMPO, Skipping on duplicate flush of the same SHAMPO SKB Date: Tue, 4 Jun 2024 00:22:13 +0300 Message-ID: <20240603212219.1037656-9-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SJ1PEPF00001CEA:EE_|CH2PR12MB4088:EE_ X-MS-Office365-Filtering-Correlation-Id: e3ef1cf4-8704-4cb2-b600-08dc8413769d 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: ZncE8760gdc2cv6NdBHu1b8VEVwZ5J6GoKEwSdAlTdBunCxvyQ86KcIsTXFKGIljojq6URfsG1DEKhlH54I4lQ06hBg8qPw/EsRdnGNqJUcKq9y5cjJP1CR0BmeIVWO9gvTc+MTIALvze6rUOKqbSBKi1weQW4NjYkTOZGA/DW69sdrTwjW8c1wRXhhOALB74L/m8XfUCYHjEZqkUXZRTAlN92hZveQ+TzFjabg2/mfhsD962l6uNsyBT981WSND5QvQ6vjNhbJ4HEydzYoOKUuCUnnaaNw9Y7FjQ711WDHT+ArrKy/Nvb9HPXbLdCzuv1DpGcKLE42ih/5WUyzMRCdXeMc0RiN+74plXSZhNrC7pIu/kN8TaZd16V2cJhh4jHEyIbSgOzVjFbxXH7GW6josw02WrYe7CYk+ZkwhTrhOHEgzJNi5c+STquD1fyP50ob+EhNV81ROq9YHQRjTHcJhDayt69PEsCj140lLvrhEnO8vRumuFY9QBz1ViUYHShua41pXwjQE+WwtxGTYiigFEj8FZ9lo5baAv1hqfXyLunMyNZnvwi+GI1OyA5qkam19e9GLFc9rS0LcRAl5CIclXtqi0Ptro9U8Rna5zQwH+2c/wPIdsJHr9MGpqj/Rn9rwaTwv91VNycwuePajecCKFHLakDvvW8uYDo9vGnAf4W59JeCnVbXuaFWuVuh0nZe9QajxyY//Ylyp/MjEPp3Yk9qhvsfVvohcTBqVtXVVQdvBqNT4UFmE1cDcnI5fjSLuXUkjqOS742WOBMhVhBnVHjC/O8mrbjuD72wStucwZyd2zzzN4koyiMp6pRs2pKRZ/v6Z8e8WMElo9G2kiNjfXMRMmIiS5lSxPdIZY/UsMQrLSicaJcVUUNMH+8FUFIZzGlUl62eplF82HxwfrHKAXDdoQKsYSKiNZ6F4T6qoc0GvjnnCERpLbh8HweEEWMbfZGIkYIEhmKwPZK5gl+RVYxiXzJX2G/IXBF3imCGwhSQ/LC01P6uGodeaWE530Gv+sU0gaXX/LN/Qhgdv4TJHrfU3iseSfaacnPpRQlNTBtXTs9lGaBn/THQn9lXwHvtkAI62cUHI6EuPVVBd9m/qTxwJpCymlEbEDt0KJ7+OltX01p7vCgm4aRZauV3AnaALyWTy4hrXwe7MkAxyVl+JJRt/LbDhoawzM300Tppxo/cZ5mIb9LVr4XpaUycgq1+QTF/6dxfsJWql5YQofsWW03b5Ke+ea8hx7gsAAwbAAD0OuQZgkygG/WjWIJv19Ia4DYkDrwytGZLvFucpMHH1pyqpDkBq5VB0W/oIwGYicBTZHIhaIump1sz2gT/cnP9kVx34bSDvUELEss95HzljmVL1wI0SSibdLKGVdCn/W/WJMHugiBFWK3mA2FLb X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(82310400017)(1800799015)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:50.8747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3ef1cf4-8704-4cb2-b600-08dc8413769d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4088 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 Mon Jun 3 21:22:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684386 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2078.outbound.protection.outlook.com [40.107.243.78]) (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 BF8EB1311A1 for ; Mon, 3 Jun 2024 21:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449838; cv=fail; b=alsVzlhi/TFZ1knzZ/PPxH8ksNKo1s++wFZprcg6uGUbImPt/Qf7kmiIp99tuRp79LOBbXE3QJljKwEXSYALbDuFbxwQ4wtfcNcdYmk+xjxpSfELjmLeSn2Uhf+hDCZv7Q3vO4FOeDeRrXh9sRfKADkQfhH6fQhZaLRBJ2gIHFE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449838; c=relaxed/simple; bh=fa6icr9ENtHix7PpR153w0Uk6QKJJ4/EJwsl1cLXRxI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U+q60Lecpaq5Q9aeXd0oKRf2f51/++LzB9q293tsSMGzdcXN5IKIS1St4P8+ZgKiI9ZCxGs8i1rpig2IEAvkP9BShwmIeCyGa+M/yWKdTHK4WGRrMM8mEdyGdis/mg0ZMMHz8P0qB2ocseZucR0gK3VeyGRNSR9E17Y4GP7IGLY= 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=jzqqOtyd; arc=fail smtp.client-ip=40.107.243.78 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="jzqqOtyd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bIX6/UrE0/R9T2VNjBOgUW+3TJobGUWFiXsfKKFi1HKw1yEpjx4NII9VFtV2Z0Cbewc+HYEwd82HJB15dxMxXqFd0W8Sneqwhs69YJ3eQ/oehrlmUx4gCi+gAbAvLV+EiTV4TdiWw/zsWzl+pyd1LdfQsl+yc8m7zYKy5BgOXPAzZyn5tA8+iVjISHF8qNNQwC5J0qSpXapKgO+eboR0VeGimINvdg2DgJdjNMIM2z4hzJxv0aGvyzMWhdVAzCgd+7H213ilTcc7O6CCwDDD3aKplWa5qwvcUPBGGlFzWaAGVn09CExQjlCMhflc9CC6g5FLX5GS7LJ8JJtHn5iXHA== 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=pTCoPd2xeYd2qbbr2nYmx897XxAZHkbtTashSgLzjnk=; b=Ifq2943ipzShCXF/Xw8zSKJsfGRjMBgsGDB5WksXZRKZ3HOQckjBtOOywWmq4UTjV1TrOOTjiEiAgJiG/sBtcf7PtQcvJ85kXxBZt+xZ/0XkWRG0B5A1Nc7gyuzUSimIRaxggeiC4lWWoXV3OgVgP+ge07Om5T6Yzg1SiSXhfKTSTx6wZrlVbyBYWlnN/B+51h6t4BbubwqYpULcOBdm8ND1l1QQCLKQmb3VODRrlO7Gf/3nthmEiDfQtPwXkTO4iYnU6Qow45Lcf5Pv7X3AYuwUJRQ5ABTyrAyQ/TO95B8aYwMvxToJMRVpNYa/iDlSCtOhpLhbtMI6hqAgrtwbnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=pTCoPd2xeYd2qbbr2nYmx897XxAZHkbtTashSgLzjnk=; b=jzqqOtyd47DkG8uM4R+NIE+k/wkMrhea/D3iBX6gjqxekKk+zctMjeshhLykMfzi0z+X1Jl0H1Fh8Qs2RMi9fpeiZ7l1bBbiPubr8YdWpGqnoGNqhu4LgkeiEtSTS3ZrWjtgRXF316s2j7JR2Lrk8Qog8F63Lui041Q0SDON+4LWnTtghkMYzEnoIsMLeqHzt3xHv85S6lbZl763lh+W5QQjJERYiU7Eq9D9mopyi6wBX/pkhbyWBGp5hIBAR6zfreWSag1vtCiGQpzHHxN1KhxCDOQ5MIWGPt+8t4yg/GTEnkfgwAZhnt2jKNK2CrvLD1WspS+1rqjAfietqyfqfg== Received: from PH8PR07CA0029.namprd07.prod.outlook.com (2603:10b6:510:2cf::27) by PH7PR12MB5997.namprd12.prod.outlook.com (2603:10b6:510:1d9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Mon, 3 Jun 2024 21:23:53 +0000 Received: from SN1PEPF00036F3F.namprd05.prod.outlook.com (2603:10b6:510:2cf:cafe::24) by PH8PR07CA0029.outlook.office365.com (2603:10b6:510:2cf::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F3F.mail.protection.outlook.com (10.167.248.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:53 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:44 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:44 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23: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 V2 09/14] net/mlx5e: SHAMPO, Make GRO counters more precise Date: Tue, 4 Jun 2024 00:22:14 +0300 Message-ID: <20240603212219.1037656-10-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F3F:EE_|PH7PR12MB5997:EE_ X-MS-Office365-Filtering-Correlation-Id: 6960058c-2bd5-44fe-cd47-08dc84137828 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|36860700004|376005|82310400017; X-Microsoft-Antispam-Message-Info: bZAZ4DMUoL9X2DYn/dyOzZ4dYmmJoicYcvOio+my4+e66zyBee8eHTa+DtdgUKxD6aibhofrQ6p1c9NnN+Kea2B+AO0DqdyOEFnMWERECfO4cQi3TnKVruyMyZDXNhn24SA4aaAEyW74NmkMt3UbjgOMBhK0no/iVhYpl/0B/+l56zc1yPTiHGGBx0zR+ph65/tQnjDAg92Wb8i6XSDOD/xBeekDPHPcLpqCNjQlpo8oW2a94hroTC2bkvUrA2j6NA4QnB9FjVHmxqlb9+GIUHzz4N0hz0ByNAf6cRvbyrnL871G5rocYkswV5/a0VPuE9BR9N+hX4/WyfTKUZVN+R23ffU30+TTVWkWK7gRAzN8RHyGfMo7/+BLdADWZkLflRCk4s8bKfUZ+5dg3nKjWvPiARdEzTrTyG2s4cUaNUVoOb1C2UNHUwztrI18pF0Ds2dweDX/BQMgs4oUrX2fILwwLPpdf/BgZpOTsrcNr1Sda0LTz42mPBG8X1pXPNrqFICKzJqz2GueBC0JXGaqhHA1ly7jZt2LBtyZzPLEvxxDuFb/nUVIO1jcFTajIxddHbPVjSreB+Fmg5p0o7gRBRp29yG12bKj0JQuWmCTDw+YTIwPL5/RWiqK3G1o2Tn7xheKb7V/u0DDIMATGbnIqc6itGVVDUJtKABVYYMH+PWY+2gJeVvW3utoQe9xEzymk5dcz2cZ4OVOpJkUNdE8CWMqc5fgO198vW9rFeFd8U/GP0xF06aPCzYCSEt5OKT2TktCpoKhFzcOSwXDKJc9mhF3JxzmcicO2cmZ1i8+9y4POgqi/AHpXIzX5Z+rzfuUN3FwbK/sDsZQ2jXRDraXkyoiu4KW0N48ibnACcN6RGE1Fi8dXEEvUQ+SjPPZ6Fn8t3Khi0cU+QY7dR/ri49GvKcZVAckumD06UBwJ15v61ZTO4yb/8rUl6nPNN0KGEk7ZZlMRRv2eoBQnbwC70NKV5d9XQtRnK9IkmjIn7Zy2FDz7SsxZIiU+Mndrm08A4xwhqTRBXY5CVEzke3xlmyNDGlMDmkyjzar6973liMMqRMgk7jSPNiAcYI8+9NfpkxHz6VZ4mT+5OVV+VA4NwoEFSIlL30d9Pxj907ORmQPHLJaUbyfDjWrisHEqQgXrx4aeknvHChp1byezCi28uXqHWEko+Y8vAuv+cINsNi4lAtl8rUCOj8Sm9B47dFkrmN77Gg1no9OHRfeqvYZaPU5XEBmEf/jPwBAUHZzbhpyR3OsSJ/0U2K0X/cI43TID8Bu229PO5T9gGP8UThv1URT3rfxrQbrqDRopkrhN/cJ0TrsFAHrWQySw+IErWAmel8j1S7ISZpePpQ4T2PjP5pJq7rUBwK+xFrySPR2uJT5R/0= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(36860700004)(376005)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:53.3702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6960058c-2bd5-44fe-cd47-08dc84137828 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F3F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5997 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 Mon Jun 3 21:22:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684388 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060.outbound.protection.outlook.com [40.107.243.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E88013B58D for ; Mon, 3 Jun 2024 21:24:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449845; cv=fail; b=o0tA0a6BR5GyN3C2HNobBCDQcCCJilSi3GtulHb0qMwmEfJSxCjY3ZuhvG74ObVdrljPrQFK7Q40ZqY9psTS8H7MFvId1CSOzqSUUfjniJ+1vUVu2k7tjMlAl/MnOPulNqJ6ssU7NElVdFk/6whnMBFE1V5mHLcj+6GpX7SPGYA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449845; c=relaxed/simple; bh=ZwrMtd77uF+j0OeCO8kfP5YsRqlW0uXUeP2EHKvf+N8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i1eeD+CSyY0SgZXPiaM2Jt71t0YQHwgCCLoJiVwhUKFKP7VHJFwRBn5tfmp4icT5l+dEzHkMu7vHQ/pqaqkt/zuK3Us6OD5pH8eLh0+SuVU64DjVX2iq0QELnWugy4R8C87dFbV07onwKclZfglIuUv6YEn/XHESIaq4kQ179/I= 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=O4qQvZku; arc=fail smtp.client-ip=40.107.243.60 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="O4qQvZku" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=abMQswvguZfC/LvomIGgmskgJW+ZW1rZwjmHyKkJeTQLfrDRqMWZiNRUt09QyEl/izxnC6GaotQOvMk/STFP42a1ZqiqOjg17Vo4k7u6btO1bl7sf/95QQhI9XflQoHkWpeSgqDjEn/Q1JA5tCrotVRqStm3J3HCYrwLMVvPeEwThiWqrhgANM4gWxLeQ7E1X6xfgansthBnJQbFJbnkQBs25lbmD6/+v68LBfuaJsFJwiUhp65hDn3HATIfl1cNGBMuGL6UP/tmxuR+xOiKnj041MZrSG9jeVou4aYovF4i7kKt2XQg+M025B/AIxW/UY18Pr77uUWDxd55ZqLX+g== 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=a35fdEY9KDg7HcNtzme6BqdJfb88AgLqHwQBhwRr/BI=; b=Do1bIBETajLkX2GvP2r3w4MIAY3f9B0Vo9km/dhpbIbHf2P9W1Kgy7IFizBokgsYTyc0Nts7fLQgt3Q0lmjphgcRwdq712AbQmbwjXI5CskKa0BiLk+fIPhTFjBbxHrfJYDBPpcTa81sCH+lnzgo2gkD36YZoDG3kyadAeoIMlJDUiIjkQ2MHv5PAsVwO3QR9fwiUk5haXuX+/w5pd5qS2quQzBH9EFkNTBSrEO+ZJ2gx+if+CpyEERbGL8+BUQT8WliJcwq9pdvzv0oh8UBhgmX5U4weD48wJjMkaH0LIVsdz63uT4Q3WppDKMPwp5pllasy/Thx6QtM6Gax9C9Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=a35fdEY9KDg7HcNtzme6BqdJfb88AgLqHwQBhwRr/BI=; b=O4qQvZkuvH6GoM5AtV7HEtd5E4UhYk7j2im/+Ilwmw5+fJ06+dO5gN380XNsPq6RMJzWlsyK7lkp3JAwuv6R2yWocsHjKxP12rwI5IC2he//f8GY73Vgd7uorjltXWKDebLn4zSPqEiSYndATprW3AN4AWPQw0wTdKeFtyv2/YbmqjBy9MSJxweo33veGiz5+RRTEk63AX23q/pP9pi1MIrKjq8eGCYxXz091JlE1hsoTiELfEjoD97wqgj6DUfuGp3oytBmb8D9yZQ55rtedXklsxOlPjA4H1b6Vh+0Zqu/qat1S8HS13+uOyToVTifecLtE/hH7lBY0OVMl5LT6Q== Received: from MW2PR16CA0004.namprd16.prod.outlook.com (2603:10b6:907::17) by PH8PR12MB7448.namprd12.prod.outlook.com (2603:10b6:510:214::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Mon, 3 Jun 2024 21:23:56 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:907:0:cafe::74) by MW2PR16CA0004.outlook.office365.com (2603:10b6:907::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:55 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:47 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:46 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:44 -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 V2 10/14] net/mlx5e: SHAMPO, Drop rx_gro_match_packets counter Date: Tue, 4 Jun 2024 00:22:15 +0300 Message-ID: <20240603212219.1037656-11-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SJ1PEPF00001CE8:EE_|PH8PR12MB7448:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b08d92e-503f-40b5-1274-08dc84137916 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|82310400017|36860700004|376005; X-Microsoft-Antispam-Message-Info: ryPKMJagReyMbZQYJ3uqyFX0pBj14d+5zsvWg0yT50MH9bitPK18whfutagYPfkXs0adI/DDSmkS3v0Cf09DWUZkzehl8wW6bKKNLsaDJZhcfhfBpX5itgtx7YTKAhfyRV+YHqW5JyXUHfw043X14n9FFQ5chfheS9jIXgsAdO3Ajfg3xAxPRhBdb67mdPCI1xIGUoSo0UKpkWPUcQCiAIbGSzLBfpJ8m7zJL6g2s6r2EoqnxcIekFubOzmYOwkEP+GUITn3XP5DSnMDW0fZp4QDQ0dCbCyaU6f+7dEz512V7NBUIyfWRl1BmazBWXa00zO3opdVRGnBla576GxH5vjbJ5+OIDbTNQ9FiZW1UEoNKh3ktfMvBGt/ZkfYBCCHJCIPBBvOhKpzUkLgWshMSfshjkVZCtHDPK9vvu2n+PgASFAPbgqNd+WYtL0xUTPJvMA4kt0gyzxQ+Rr/J6NGiPLCTxG61LXyOvhCWd7gB0OtUp3lL80568MWRzT10NjvtXfuw69wWoTBXq27q4nB3/NcHGaeAMavS2wtxe+oxXqg2DtHFV2O3SRQxACZ3iLrjTOVyR3drpw+kPzTHtkn5t//HuBAfqjLqLFLCcmxduVH5KvdWeOmLyHxFfiP3M89lTvTaHLCdiuyjUA6Y+9xpx7x8jpt5fjKMBICHiS9jrrvuAP2DtZIMAR7nDOn6qi22I5XmwbAH5by6tjAnSEA1WyED4DBJHh0pDaWiiy90+a8FiZRS/8H5yVMNva7S/arA4hc0GTtu9ehmpeeLkJz+nbFmaxIituOyOXogEWaVvnmSmjUlPhQqdqBEh8FcCHYdysNDUtrPm6Rk5Yci8REUU8tFLnATdAsjXdgQwoVbKfo3eUe0F6BvGFV6BtM9lTrbVB6eEBxYprFgI1ew2mHRJ8dWPMOhtwEHlHAdbFWQVsYOyX9NoITfY9z6PzQg4azeXBCaZykibxBpMY3mHuedWCUs+oPeKwj6r/iQYalOkhXY2T8E5uxIh1Hoy0XgfR3icu+p8mMVBNn0HD3cBfkbpSKFTGZMFRw5ae5R8uf3BkLjm7FNcyEongeJigs2+r1RsrcDteYvcSXEI1azKyVqKXgv05cE2yKXKFLW9nV+Iy5mc8BsJ8PVmPC6ZpTtLtaT0nQup/llvhFwCf3+Ca2oQOoZeTSLu95ZrbEQMUTLR0Sg59HYdRtyUw2tFJvOaiLvX3f0wZuaS/52I/SPX7bqQUyMcfeOYWygRXRScUF5yoIv1g0ugOeGx3oZtDJAbu4GcLID/+6HkYzurFIheIO2YgcMn6YZEF15tDcYwb2bMO21rnDyWzfZJJYOS+B68ciZG4Exnb0mWJH7zsP+L6el3/eFrF2yeNvuj5OmfB+JuWgenSMfRENHY35Jj0K40Or X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(82310400017)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:55.0346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b08d92e-503f-40b5-1274-08dc84137916 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7448 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 e1ed214e8651..a3c79da1525b 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; @@ -2057,7 +2055,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 Mon Jun 3 21:22:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684391 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2081.outbound.protection.outlook.com [40.107.94.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5D9313C914 for ; Mon, 3 Jun 2024 21:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449849; cv=fail; b=DYhh+WW2OZ0C/hOHazjsgiREWvEPYXofS8K5eh/SmsBq+TdvKo9kZRIBy6AGbLDOJ04BCq2sYoWQVbpSYQ2wfFPtjYfWgipsPfFZ5BinBDVM8z7DZf3s8C7VniBZcaSHPM20zv6UTbuDmC6IKqEtMUIOFA1kr9clEB0C+mttPj4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449849; c=relaxed/simple; bh=TJZKGFydQLuM7QG2rBoqc0j0X7ZAgbHwAF9W4HjMHGc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fs7Xd9jCvz2WWH7jPyCskI4yLYiqnF9/Q/l9JNLGwAGaKc4jk8qdeO7f7ONK/mhQEodOt7Wxn5J4wKrfmPtmtnQCUKJGxhittFQwIJ0WxIHvVjWgD7WNc5tRj5yiHneuGUEMiFwF5aAxcl9LDlufcBXiFdy0HuzlDZiUCwrxK64= 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=AaqZcUKX; arc=fail smtp.client-ip=40.107.94.81 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="AaqZcUKX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AU3tafeJtBy5KhGcbja8glK7jwefqr9vHnabw51NgR1Cn8FCUEIq0plQoOCnVRncAVoLieLPMTL1wru0z1tjwNOuqTjDYJNWWOjGRkBtummsnP1EMrpSw568owfq0DHAUBxB1VjchM0kK29Qk9353r3VACo/enA9pOgMVl3mCmQS7gJ5CAMyN+5STFMb6R7UAEQvYd+0zxZ5H83Iqa8sODvEZkrutNCQvaJRes9Qv+KZ2IAsvEcrgx5wTY9amaob3ozY/T/7SIQovVj8Gl33rokNLU2eHYB8j9goDGKj/r6PFe5cCbrhUMDx/mGDSlGD6AnB5EQpcHsAlb2mkLJXow== 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=Z70qeK1+wFJT3LlMDI/z2wYEXh2K+ndTJLRNTw2OloI=; b=f0+M9VcQAhWtirq20+TeOewk73feoRLbdiK/jZ84i0ddmlCjZtHtljxVasPgTyiVwOaWzFwgaTJ8/R3kH1pCIoVvFms6Zc2akVwI+NkV1PXecw30QsZYWwyfOv9W1C6J4YbUlHeq0qqyID5CjKxn90173syrHWQjF6tslJUbndiQIs1iWHet25UFHg+JrmlcO8JWSiVj8rweoEyBlWyuAhB1v2jEtfhEaaIh9UCjqPzONaq4Xh2JMjDljaYpMa3Mh4weIVsyKWNGHtnXaLGLSEUwBDjtNLwiqXBQRIvXHox7UDTjOTpyqgYuZbw7aYSuLmFI+AG461UzDOZIWVX0Dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=Z70qeK1+wFJT3LlMDI/z2wYEXh2K+ndTJLRNTw2OloI=; b=AaqZcUKX2nhD7KIQNNocx3ZEs+1tAtqqnULQuftKmO2CHUH0iQ+PcBlxv4u1CFcRINXlWrZ7wiD79IFBB+vf47KtcfDJcycuMfxHAG6AP/zWEC6vvsY8LvlsVT4/86Ag70cdKuLjKyui9n4EuipdAH8lZOfIjsWAdki5NhQCzAmMx7bQelFwPTxYnaI+IFSsDUdqZHFjLxMpF4FmSm1wKIUtGzWF8G3QDP7ATpQH2/zv9+pyhMgGncH/rQXrn0Rxae3LU7jUIduN1b412cSofSv3emwkdlgKqbOT4aowgAyh/N8m4cDAGfulta/tq+JuiV5ODwHaUS65lHQN28Na3Q== Received: from SN7PR04CA0105.namprd04.prod.outlook.com (2603:10b6:806:122::20) by MN2PR12MB4288.namprd12.prod.outlook.com (2603:10b6:208:1d2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Mon, 3 Jun 2024 21:23:59 +0000 Received: from SN1PEPF00036F3E.namprd05.prod.outlook.com (2603:10b6:806:122:cafe::4b) by SN7PR04CA0105.outlook.office365.com (2603:10b6:806:122::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:23:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F3E.mail.protection.outlook.com (10.167.248.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:23:57 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:50 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:49 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:47 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Tariq Toukan , Dragos Tatulea Subject: [PATCH net-next V2 11/14] net/mlx5e: SHAMPO, Add header-only ethtool counters for header data split Date: Tue, 4 Jun 2024 00:22:16 +0300 Message-ID: <20240603212219.1037656-12-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F3E:EE_|MN2PR12MB4288:EE_ X-MS-Office365-Filtering-Correlation-Id: c407ef7a-d089-439d-b8d0-08dc84137ab6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: +kJ/fvX3X3KVzi+fcfDSFwn0wiJjtuYJY916Js/UxGBcx0a1m4Ynru91w9yQZmL6xQF2EeN6LRG9ix9SQATaVIh2CrCoZxYDhueewBIjWRBBVpeWxJJvbVo+AtX/0lmr03BJbg8+uslzXuevZn8xSs7JkK//1YQh4Fuox554wFV8URaLUi8m1sDpwgw365KP3IWcvz4PEXDQUkyueAyFpCktSZZkL88EOXlV7+gEwkmbriaIHk9VPsGMix6R65Sdx2UR1LfWny+gRHaDOgzjgNT+qJCKjIzP+99Tse1cWT33qB1ma01mepqTIJnIATMrjD9TWG2HHuHUC98gRkPXxC4Ck5g7NEjlDC0IfvubyWZZfun6MRAgplE+xsWVSxXRVY95W/hiAGsvQJg4EvA6ls3GZKTtEBTJHss96sk5e2rqAzMoyrefzuY6PmalmmvEG3nZonU0GyZJnsY2xzkwvKEvT5+qrSTV9YOCsgMMUKsleCyDloXFc22hb6VN2+nH7KwXARwlCwKFKNwYUIFzvY1GLaf195qzTOohgYwE7MGLK/3F7ZC/bYmy78z3qZU/IfrlMrfbmlZiw616sOa493mx2UQZXRIqnP8eLQ8lu9KUo+4jQoPI4XBBVYjb+OVcA83gvNp5al4LQ4lYTXTvcL4wSsdmz7jB0y9xG1j1lvWAeeAK4a8G7LQi9fZw7Zlc34Jsh/E+yEdxsONuoIep770OxS6L0L8w/nmXAv1wYOn/oC9A5ABDgyj53bgfxETup81s8sBYj5ZXoaao5JzL478lU4kL7c55+52vrbQ+p9ZphN9+2VYOjYd7VBgtavGXHSexkeUMFuzem9EcfjZxFcBDm5dPnWKaieiT/vIlXM6OcqiL6O8vshqocZ+uFmH3IPsC06uuskVsmoF68djJ1KMVpca1Vvwokp/vKwoN51Q3tgu20oIor9BLMVknhF/ixHP7P3hR9xyDR7UgpX2J5HxdK6a1i5Uv2rcSDsa71jtevtaItRNX6j1uWxbJ99qLw36iSyv0R64CJnF/xXCHWRrXWku0Y8jonNN7tOwhm3o63LutXFu74xgNb/cKCwvu6KoUpBNikRd7dlLlQsX+OJpjSyz1tOhLdLpd9bKkJlBg/ho+5i2pmM/XUie0jfMJOf568v9/SVY8b5dndIxTuxKS5p/EX7T2E12anXYmpzpbX/CgQt2U0fT9rcPGVBLqFlWZBFTpUFWO3mTT2Xy4ro6D7eCl0U3OSDcQaTXSx43igYZndfmeNM4yOd9ZBAh07ZbmFXHVcGssPMj4K/rI4zGGn4Ld8wpMiSw/mE9SWOPT0dxSglYnoqDDC1RdoizMgwG1fmIkfoPttoDTKEctn7R8WB79eRAe1i8tfszS1uKTO14I8Oq+s7GXouOH1m0R X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(1800799015)(36860700004)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:23:57.6558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c407ef7a-d089-439d-b8d0-08dc84137ab6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4288 X-Patchwork-Delegate: kuba@kernel.org 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 18638a8e7c73..3bd72577af9a 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -209,6 +209,15 @@ the software port. headers that require additional memory to be allocated. - 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 7ab7215843b6..3af4f70de334 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; } } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index a3c79da1525b..db1cac68292f 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_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_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_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 25daae526caa..4c5858c1dd82 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_nodata_packets; + u64 rx_hds_nodata_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_nodata_packets; + u64 hds_nodata_bytes; u64 mcast_packets; u64 ecn_mark; u64 removed_vlan_packets; From patchwork Mon Jun 3 21:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684389 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2083.outbound.protection.outlook.com [40.107.223.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADEDD13C68E for ; Mon, 3 Jun 2024 21:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449846; cv=fail; b=SgsTIBnEDgJaVO9sr3zaKN1ZRK7ZlzQRCBma79qATpK0JNnEXPsucYp2pVH3xza/bmdUjfVFakEAsIYlgRCCIkvNRg9qEaanwf9gjYtC0uENRA+1/kfcVT2O7W9RLa9vFevGkqhdKWGX/Y82kK4HQo6R4+81jwK5CIPhLki/rL0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449846; c=relaxed/simple; bh=LbSZ4Nn8VkIv0WEi3Kbv02IDSh+wLXTOWd+MXP+wV+k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SGc/q/RNU6h3Ddsq7UBBOBrFRqoGmMRProeABFzuAYueZT3KVcyNjB3e1fwuRMpOh+0iySMpjEZqhqsSAAEDIvPQ74POeVBsbJfyyaT6pFMiDFHOoeXUJGAeSNjZsEUdIueLhTHnuTzTXSdrVeJ+GL2Uunmp7zwezsU0cPlZGBM= 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=GA2+DodM; arc=fail smtp.client-ip=40.107.223.83 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="GA2+DodM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioKgM+wNPfnmRVgrRMd8+5aXfikOiJDqv1HCB8DeHinWlNnCnqQXOuP5VzquHv3Z2YU9MFJbVLRfPEBKhiIjCKkigtj/87uBJksp0JslUUI8gSsEu4yf4dbuc0Y6m4yzLqHbLLZKEj0XXPqFDk02tpOeSY5mei9mgDRufXx6okt2eOkO8+SVDgSrD4nL+sgt6YX+4AuW3GcCxqCcyBCN40sGmYD5SMgjBAvXyavgv+LG6+TS2AqUjXZzKiC8HC+XDvKhNd+A7dCJBfWL9IGmqOcqsz7+jezMjPY6Lv5p5Q4sN0BDLqaAhCG3FsWuYQ2ODHDjfZNFzG6R5N4JgTZiUA== 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=AgYzK6sBKKl4i/xQPr6oi7+1RrdMF8OwB0W8bq7t/so=; b=UWtZWPMOYB9NWSu98B0wGfAaa3mLwfvt1jPDotRwKmeWvS888sYHyWujnV+9P2umjFZLfg/C28PDIldzESRfJCnU2pxz5kSPE8UjG8FGvz/FinAlPOt7ck8PDRaOiQY43H780789dUjGT929oxVIZg8kxl1+Y+IrA+Nk8LywLciS444gkfFOv/nG+53w5G86gf7GVTeJ8MKfyr5B8wTyRoRGFFJOiVp0ULdLSO6iDNADDh+I9vUWV4zvCmSrXLe/6ZRe+nxKjwp+IFYSFWKU9PyL8ehzWMNGt/r1zg7FW8VVfp9Q9R2r6mMw0zAvOW85eJDNXW/LpJtfiCcrupDFeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=AgYzK6sBKKl4i/xQPr6oi7+1RrdMF8OwB0W8bq7t/so=; b=GA2+DodMg3jxEHmEgilt3sqX83vTWfdQ/h5wHD+J7LX9KKGTSWsn3mVewkmNyA0GHN6kKARP8a3ScUD4tCxPlJEblttsob6VNFjS/4FthBlaJ1zRJg0qYPLGYqZGJWCeD9R/k7jB0FcwcpOTrHKeOz+q2S1KMf8e9zhoDL7wEJrIwhu3yAO9sPp0CftR9doAStisv8XIp5gxIjsKf0r76rCKZ2r2D/HI4fWj7lySe7Gn7gZmbM7CzqxmIKaSatPXC/LALp2Z6WAiBzG26ALiO8yvLR60wU/o5pJZdkJtR9E1FGmWnspoHR7Hs9JN7+D/MWRcTED+xn2ZSPF+ul8TRQ== Received: from MW2PR16CA0025.namprd16.prod.outlook.com (2603:10b6:907::38) by DM4PR12MB7695.namprd12.prod.outlook.com (2603:10b6:8:101::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Mon, 3 Jun 2024 21:24:01 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:907:0:cafe::b0) by MW2PR16CA0025.outlook.office365.com (2603:10b6:907::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:24:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:24:01 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:53 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:52 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:50 -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 V2 12/14] net/mlx5e: SHAMPO, Use KSMs instead of KLMs Date: Tue, 4 Jun 2024 00:22:17 +0300 Message-ID: <20240603212219.1037656-13-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SJ1PEPF00001CE8:EE_|DM4PR12MB7695:EE_ X-MS-Office365-Filtering-Correlation-Id: 09691c02-4555-4c40-868f-08dc84137cd4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|1800799015|376005|82310400017; X-Microsoft-Antispam-Message-Info: RvPdXweb2VIYeiZTdOHFFE/7w4y/igORmIxjvf78nAwbA7d+Gk4DeK7wUKjO5gCDsLG2NtXMrbWb5Kro0LXm1V0RH5a/iHuI3n+8N3wCAvemTBSwwEx15Bnc2PhO6vtrW+fyxeM5Pdq57unkvJjYqcaz1ALK5ib75TejagftYv/OVQ85Pzsx8A2O5T0sC6BGTc6Yldg+7ajp8bWieVgBiqD/uNZ7wUvULHHrFdM2PbvTcv9f9p6Oxgd3LA3S1mHhMtctlptp7WJEwRzhFRTfI3U0Jk8nHsdGabQKAqWhoTYfRFM/VxBSnvSruYL1upLiVTaSMk+KU/g+B/qAQB+C+8CAOgxvOchI0PPa9RBKdHU3g+8zg2ZK+KNiCr0UXTnAdnQbVVY5lMqE7fK39gneYAUIdSyaxmxaD82NstnMBVc8CXj8todhKjGjoG9l1j5QMF4unICFXZ7fLzNnu/ElD/pRE4jyH6xSNUxygLrDuNlDRzL9+zSzGctngeSIR3RUI2uwNt10nW1U0Auj3uM2FTEvUYwCEBLTZNVUIy7Ln21V09w1e+vM3pu5rMnqiq0W11DM9bvWeKM/DeIo9qh5kOByY23tCjwQ+VoZLxYvjWTU0QfNOSFxpkuKvC8ESHg6JGNCVuCF5Cshvk8cNk7MjFKM4U5S5MCPz2zCjy+zVQ2J9W6tyn6YnFpo2MzqfjGr6oelgyiunK/IiF5HLXgQubC7bxr/avzg5fRv97XKJLkmnl7JCF8XQ5p6tH4nPNicrKlGAxfT7FL+VKVgTkj81nhmcuGbkceFWh4GxRIgZZ0TKCr4GjS0qq43U3wVxQ9vRVoziAZ1fowlzdxjSoj6DiMb05NB/R1d27lxJOioezjgToHXeJaLeti7XE28Y04DcRSsfcMYOHwxMMZMN1Zom05/D+3REK/Gyo55iNTIiMGcg8/loEooNn+BoPmJNf+DIV/yYUjm/iC9udrE0oadvIiuPK8G0ET9SHs2ZFGhrCyBVMl1vF3vFrxLaJA9KyXUiq9PC8qviOvLRexQ8guGxesA8V6DmI8ix3XaIWUi7yJJiqAQt+A2/fpsiq5pnTCjrbZb10cEt8hcSG1hkDnQwxnMxFYqQ6uAdScF/Ady7pPfe/PWcW1Cqa+GpzrO0O41CGhn9sObf38QcuO55z8JO3lQpdcbV/faRkBe72ESdssvPkbsDchSFjpTIXgufp3GIVZDRNwJXFOHWYXtAYIFAiRqBP/E76fXcLr4LRIkZRy7TKgFZkBtCiIJnEwRJoXPBik5LlDMIoTvvA9Gdykme6Al7sw0C0j5P3PvoyBv+Fjq93DlBmpvfrz4JLZSKSd0MqWmcGmXa1uYKPq8Zn2IjoOi9Gk/3rmsbr4v0i1ssJdqJN4xwmJ24r0+c+IoTe/D X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(1800799015)(376005)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:24:01.3159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09691c02-4555-4c40-868f-08dc84137cd4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7695 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 d21a87ddc934..2a3e0de51f0e 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 3af4f70de334..f1fbf60d0356 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 Mon Jun 3 21:22:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684390 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2089.outbound.protection.outlook.com [40.107.101.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 5B90213BC38 for ; Mon, 3 Jun 2024 21:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449848; cv=fail; b=Y8+owi9EL4HizVpcuIkXe2OI/r8JxL0RKRI57wdBVQzSa7SDZrOtOyqSs8PZh2pWy9TC5VfW0zAQqXhZaWW/Xxq8VboOYnBDcFQSQiJLLvFz+LQWeYZ+1K+jV0rhRyr8860QdzmVKRV+AfJnNex7pZBohlq2J9myndhtVdqfXFo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449848; c=relaxed/simple; bh=P33gs4Q/+X1SvP8bGKF9t4mcy6oTMvryZAfaCZwUsrU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sqwodUGsHFDzViYoFJGsB8Go25a4R0ZjjABBx1cm47EF0OUOIE+CePeQLopudbVrlYY1QDbP2TsUg5qAhHqJr6inpNeiwfwPUGFj3NOqaCJ2GA+veYlnzAsTK0KNAr/nOX20iejkIY0x7WQEQSXPoMbdrVLNrUslO3YCH+zVixo= 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=hcVB04RO; arc=fail smtp.client-ip=40.107.101.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="hcVB04RO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bL8FCYODXLByXT9B0cdfGQf6uPDLQqXuxK9u+tLCfKKGHPUryPnoOBabzkHjfDxyEx7QrXkxAytPJzaz9U9+WHFiEz34t/n/jQNtaRdQZKq79b97JWk2dnVwY2W25EsHA/eOlLRW/9Ndm8ItSXBLVMGDK6p3iTxNVKNtphhUwW4r4FfMFODZYBfAg/Ld3DwnvGCkRQf646mUWrnpH3gJ1862snQ8602wyD3Llygy9LxIBZn2IU3XLbSVBaR0VzHgRcyCc+4s1to/1dSTh99S2Ck8mjhqu7n76tNjfYWrQABJk+m4Awc5kCCy3ZHQaanvcUpaWSCeAT+iVKQwAxbvTQ== 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=zj8xI0FSlqns43waDG5l94hPriKjOpGbw6abQ3uy0JE=; b=GZYE7Ec2IrQLtmAHnDcdJMLBR9rM+cz++SxjpBRAQjHxC3eO4uE2QO4Se9m31SEfRLajReVdQlEGFAgw/89qY0or6dYJYHH51gReNZUFfqospbZc+JicFdvyMSyY4tVCCiT04t6KSs8Sn0tMLZOMDF9rSQ1I6SmoSdI+CLjs72LVslsD6t1h/vN2zsgTNP/JAO9uUf0F7i1KpxBr0PrZEVXMjSRPJgPMck+A1PojH8nOz2v+tHeTPGq/ckME0y9q//+UF6wAvo0eW8E1XYHclXlsZ9uHniGUWfopX+FMrFcW5FXWjTKiHJs2Qk02E/7DCxQbnHmr5seZTggp3RYcUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=zj8xI0FSlqns43waDG5l94hPriKjOpGbw6abQ3uy0JE=; b=hcVB04RO7EsWDlQKu08ECPubDL32xgDEMp9xz1cDq2GqZv/tRCYq45QhfMslwEIzfp6QMfLGHIoxzTgUIal2dDH7e07dezIkTXChhopZtA7EBAkKCzVXIchnD0wi2mRCTYO48AtGO8PP0dwUUS+puM3MuH/p6q6cNGnAHd7e9znlrnWclWA8B70b9yOPK+Gd8Cd3LbrgBFBRvcmY4CUSYqP8I5ylh56AOIQYYiuwY8nqAZqF9DBZsXN67mTVqm2VPhcS2TwInD2TVeXxulA/KYQSpgm7B1z8/xwR3SGXRghmNqzMxWpxrowp0jZsbGlT+8qzB8SltSyvgb+zhbHfAg== Received: from MW2PR16CA0005.namprd16.prod.outlook.com (2603:10b6:907::18) 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.7633.21; Mon, 3 Jun 2024 21:24:04 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:907:0:cafe::e0) by MW2PR16CA0005.outlook.office365.com (2603:10b6:907::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:24:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:24:03 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:56 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:55 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:53 -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 V2 13/14] net/mlx5e: SHAMPO, Re-enable HW-GRO Date: Tue, 4 Jun 2024 00:22:18 +0300 Message-ID: <20240603212219.1037656-14-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SJ1PEPF00001CE8:EE_|PH7PR12MB5807:EE_ X-MS-Office365-Filtering-Correlation-Id: 0937c355-e081-43d9-b1cb-08dc84137e43 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: SwdHDTLn3LtnTawD/UXcXpmzI2ciMLJ2IzAGWZJtxg9TyX7CKdJuOBE69JSpfx7Rv2X+m0/aV7l1lKzmORXeiQPjZm05HL2wjmbTsTHSvcrbM9K92IUM+yIGwna1EIA30vFwuCmJUlPjVU3vLjfCYKgkCD3RgGoAksuRU6cCkZsEBd1PV3fqVgfBuq67C3feflJIKbulUTJrHzt5wG4xUoJMeGLxo8AYcCm3rRgH6r8gmp+1KieRuEkIY+nKbvmbKs4iXLLwNMsMxb8uTDYtDEFyDafAUL/YOeFyd5SAIHQjtgF8DHCi0SvAhTe0pvwrgSDBCI1+jc+3H+fnBXvQMfOaRSXc2sH80gtEJz2+jg5rH21x89R/MXg1D7NKfG+rStKh1Y/355cOlP67wJSq5KAdKBAZF7VYVlhIlpZauRUt84lgdzJV+XESAjqIv9svkwIwdl3H4+kmaHXUD4e7MiBdu88S81wredRFkrw1aSxW7GstubjWxJBSmuyA3FzGOXm6O0KM/36keQZ/r1cU4JMxP4khbS2KvOhxj1QOW6CaHKJjBAcvU0czL7SFM0tVMzhQRPt+z6Xnt5EpNCHovv6R1fk/ovi4mYl+b7drtEnfZpRLN6fWK2Nrrxj3dgY0XnxXdy/47n90ocv7vy3ERyZZN+APIuIXRTaAafWD/oSty97WTrRaW3TRDm8zmJUuA7PbuaR5dT/ZrplAFHSBHxvhAHn+fC9xiC/kfcG9EqGdT5IONtDe5fbCpffntyw64iJI/mWxvI6hSuQmA21GE5+UMU987qbYXFAb4Bg+eXmp7IyxOzx2EfVcQn0+yQga8t0TQakWJSzqboGoEu3NN/roR5mNCS6BEuSNh+1GKJscqJKGHl8Qz4gFSklS9YC/MWY4S+iRO3V9y7W6B8M8jDrBtgTpjQQ9kv157rXJQVMjwik1bkPHlw6uMWl9E6OM6nGR7dg+HaUVHbXfHYZVMGFnIIeNPiXKpG0x9TffS+w6Bh1vQ49dep9yMci24Q7IJUOekAEtADkKMRV//XD1JswBEoetH09x2YEi5tgXDhbXzg/DksqzJ0HjWDdez6/ddmn552qrstr0gnHGH3sHbKrY5GWJVvFHQ7SPsTalDx3TTGRzKAB1KoBCQWX6a9j7A2VLH0GiueZzowBBne/P5l3LkmObspXyojOtUOvUUVlbu1jxt0vu7AsSVuK2BNc6UMzmZv97DAWflT7d3Pt7MPEHcSfq49NHhA44spqtvGZcSKBkqlV8aFcpPtzdBXnDqQHxS+eDLHHvLgdD0MhxzndRyItLUI8f6aYGWUT6HpWWEmrEKj+Jfafv7t0dH5RpB3Dm0WdQFlk+oZzpQyhIA1GmLNQgVeOni86ZxLFjWxvplkSPQ0hvbV5BB2Rd9wDw X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(82310400017)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:24:03.7222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0937c355-e081-43d9-b1cb-08dc84137e43 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.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: 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 2a3e0de51f0e..44a64d062e42 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 5df52e15f7d6..17acd0f3ca8e 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 Mon Jun 3 21:22:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13684392 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 598E713B59C for ; Mon, 3 Jun 2024 21:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449854; cv=fail; b=ZzW+a4sLG7WrsfbfwKNsC5X2InUcVWvz6wuDwnf1ESGnvp3UMcuThdPzf7p5ow5JGH48/L8qWSKH9mf6C04pD8Q678hC4GtPyKvp+6AFT+4kWOmHC2/6voFp4bL+OTqBbGCkpTLcfCfBIgxeox0h3QHyZu0R6glJOMv17o1akfs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717449854; c=relaxed/simple; bh=HIF1jQaku1rSw5o94bi2CSu+pNrSWlgzXJpJIyXYdt0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Izr2QGLpU0Xi3FLC27OxX/TrrgTWEqd8sKfaK/t7xg9GQSx/xSgex9tJZleBgbtdJrqIdN6BmhzwK5HFzo27ACPDR/iBYB61WkpHk2KqBM7w/rM4aONZ+nqRYSMdsTcy1ivVbwStrUMTwfh/JHBJ32NyI6VcozUa2HNjMVntdOA= 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=oklTa8Mm; arc=fail smtp.client-ip=40.107.223.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="oklTa8Mm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gD75dMVOnLCUZ0s623F1BJhv76au5GGgZ3lKhdUEBOARlvUBMQNhtqA+msR6ZJd/v4H/FgDjANSkfXgpfiqSudo2fYsauCdBaKTlJ/WUYGTJoa9qxWKrZ8RYzKfICjA8JOigS/rjCSWVzEHRWN6siVaZQ9ifzWB3Aowg/OICPl5mp3ayK6BI73mJ2I2COqME4iboCGD6cLRbmZNR34lx3TYsx+TGjRdzKv5FDuvcrYWzsgnUjh1F8NUOuxDP6dOrjr3kmTPgdYbEvI90KaO9hLJOglAslGI732Bnic5GrFvIofAasv2VSV2GWTzpD5cqvVOSS9z/SxTZuy4mzYvNlA== 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=+PVbQkDPH/nrgpHNbnZ5WBZyAozbKOhlMWKkcfqcpUc=; b=DX9yZiaGGyqnGCykjacbWeq41XHOXJeSPyTSopgFNlBanueFP2zvIh6LnQu4c5u+RkUfeWvHvq6gnMc3PwXyQ/Rjkxq1VXzLOQo+B6NSikjA7eb2OeAWo3FLKJ2/X8SZEI7xkYr4swyQNospH15oIUJIhDWc6/Etz6KZ4xq9JLQakfbhn43AKvo2pJLk69WtU6SpuQDSbuB4YNpc7VtFbO7+9oDBN8TKEFearbQjQ8gzWOerzpQDV8GwtlgAX4/8S9/EIO5osKEo5ba/+lGpM/EzEmkYxo6ke1HZkuxSLv/wu+9u6tExl+2QsNsdRfm83XK698WGSkNPDHpCZE3mgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=+PVbQkDPH/nrgpHNbnZ5WBZyAozbKOhlMWKkcfqcpUc=; b=oklTa8MmKcRu+RQNF9M+pN7tVMwxZh7qlEvGEIYqRv8M5vmnQKt3BkLB4GYoqFQyM1yiFZfYmcWmCSZuWnEwbxJ4ER6+tvEeQddT21j1TwnJtxWi0YbQ/PZHEqTmxrjTTM/q3Gr4071Gdjy5AJ/DN37f13m/q5wDKj/hJtCULK3nfT7QKOMb97mK//2aXxvcvIEkmLEqz77ATmv5neUP9N8y1E+sB3uzvDRZzqY65bEPsM5iGC7hFlThepQAdA0VD2jYnvUX0w1EGAGgPfKNVSvwQDTFvF/YvXz95fOjiRS9sqdiYFnh1MHlC+8XG6RLxU4dnAjhOcjlmD46poGO/Q== Received: from PH8PR07CA0031.namprd07.prod.outlook.com (2603:10b6:510:2cf::11) by DS7PR12MB5911.namprd12.prod.outlook.com (2603:10b6:8:7c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Mon, 3 Jun 2024 21:24:09 +0000 Received: from SN1PEPF00036F3F.namprd05.prod.outlook.com (2603:10b6:510:2cf:cafe::4d) by PH8PR07CA0031.outlook.office365.com (2603:10b6:510:2cf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 21:24:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00036F3F.mail.protection.outlook.com (10.167.248.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 21:24:09 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:59 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 3 Jun 2024 14:23:58 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 3 Jun 2024 14:23:56 -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 V2 14/14] net/mlx5e: SHAMPO, Coalesce skb fragments to page size Date: Tue, 4 Jun 2024 00:22:19 +0300 Message-ID: <20240603212219.1037656-15-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240603212219.1037656-1-tariqt@nvidia.com> References: <20240603212219.1037656-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: SN1PEPF00036F3F:EE_|DS7PR12MB5911:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e0c020d-cb83-4972-0db5-08dc841381ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|82310400017|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: T24Imu9cNnnsphfyoCeDRQifqoRSj7cft0/zn4pcvTaEVXxKkCjsux6VqMSPWW3nM/rmnPL+LHiC8INjkk6zeIWhTAx6pTBU38V3QCWVRAsFQSl+pC9yQs7GJaFbcvExCUqPScC9+Hw+x2z3sCItLxN5DwbLObefnaPjTGDrmeAuL5fAx8iiRdx+0bpmReDQLrbAzxYHIxuwWpP9Xytwk8ghmxllhb9IRPwHIDa5wgpA10Lk23kKOctRFh2eGZGmN851wn2mb1NSKwuK3lp1fIkyBFVh2Z7ORn38+y/4B6Gt5Xd676Mf+Zkk73XkOJLA1HGFKunPazQmlYXxINtkwuCDJHRNSXJjvZeDFEPACApVityQYrj57TOM48tkJ1IU7/rHDXAyF2m1SbKica9BIUYDVy434QGs+yV/MHUS5SzwAOaUwk90HXzABwrl5rAF0dtPBy5jAcMdNurxq6Lqyq9c7FK9ITV62oSC6X/i2rpkvpkULRCU3AKR19YWIvxox9TU/j1dAMq/+u550dQkBP04He4qvyBocbmIT+DDmqD11pzo/apktlIr5gr3wGH/rF+YPXXaL/ANNp9yaNZBWuhV1CIDWSS5E+O4E7leZ+/NIEF8Oi9yqQRPNZWGsn06iMqliX0TZgyTtVo6awyRfu2sUxNlVxqpuymgt3DubJ20mCrkpyFSwKZOGej8xHTJfwR/9L5pJox93OW260libzfu8DhLfy3mUWYf1XlS+pMfY9AnyTfJV/5NokFs5Fv5+XrhQmyOnx802YKJitP/3Kcn86fn42VW8VljvhQJHIng5C40GN4GJQ21s7f9Q4jUf/MG2iBHtZtwT0DFjua0lXVSYbwcJs8AQPo+QgJam7gFBTQQcuu+B6+IxZG03aQfKfcW6lkYTGKjRU5uZuZstOB9fagMR0tkmeOT7IEWqoe9DcOi9uJcl3vNdAg0ySg/+InJSQ9pplz99d9quMyhSvhQfisyTJ2XTuLDJBDpizd0MU7Nz6GVD5FzpKk2GaFXhOPrK4AdRmHCrtYkF6oB+d4bfBEVszECORIwEeYnRuQGcfXCbgeew/edchoGKq7CT1s+AFXmccmKIuGSJ5tsMq48L1VdqNTxz89Pxfk9s3DH6813OShnrX3ny8S+dcW93meB2xD94CMXcBHCVbfEhrLMwD3tQCr38fIutHpcsr7hDc2FZKj2pR/R1GlLXSxizS2cNagUs0gf5TS6iv7YbCuv5TmRNNwxwSoRlT0ea47vKvkiD9+C7TIx5YUe+zRAcSyiDfOngUSA1xOGTFUNtuWs13VgtsfytdDNkMrIf13TjZAsk4cDgM9jlCvhmg62ZoADwp7AF7WU2M5QPidEOWZhzd5bl5nioim/d0pAze18jxXg+wFgdr9/v9+ac27l X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(82310400017)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 21:24:09.3233 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e0c020d-cb83-4972-0db5-08dc841381ab X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F3F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5911 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 f1fbf60d0356..43f018567faf 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;