From patchwork Fri Sep 6 06:11:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Li X-Patchwork-Id: 13793340 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2122.outbound.protection.outlook.com [40.107.243.122]) (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 AAC553B1A2; Fri, 6 Sep 2024 06:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.122 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725603129; cv=fail; b=kq5yebI4QjUAWr13aJjewjlE9LiX/yzcCn/geHxZAzjkzHWX+V50YdaLzAeOiwj1lpIj2WWTJdgrurOyaI4TuiQfm+UdA5hiv6/XDxd6w2jt9UgrLNu47IDMrbto+Kk9f9iAcyux/SPJjJ5vy58PNsvtxprtUPvxyrGCGcf1700= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725603129; c=relaxed/simple; bh=ZrR8gGTPNeGYbxcvLpWUb23AYu6bdkrBawddl9DF5pk=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=uU0tmZ3CF5PDU/f85PDSHLYEaUVZ2WTAhbEWpy7Zt9nPVvKR41hgQXiudHERsvcyELlcIyrrPY9nYgta7ngSeyLTzD+07XbfyI8hNLoVlEwcmeHfyxdywp2Im8mLShA/59VLcR73oJgmgZSRFVBl0kHakHDaYi4WgkH1f6AO2CY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=Xz1hvI15; arc=fail smtp.client-ip=40.107.243.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="Xz1hvI15" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UKrfin2+tZYm7WhX1ECtGsmNzembmZz1n6VyGmyOYdF4XZsz2tR+vGOWKNamhMKmaeQQ3/eU9H4FApJZOgZOOsKJuYmheBWVi4j287SFXryh8WPUbnlEiDnzBYQFRHNT9h3WqHCk5tnc9zYUvf6Si6i1ycs1qnEmT46emDb396ItfIFMpCnF6yNYJppDjE5kJmuDeNtZ2+qMyCHALNAQHATfUtodQ4OqHSzdbPl8Q5aIUzNH++nEQYKjnkOFfxOzl/YbwOeDmPemzLZKaBnbQN87smOWYn3KjmZsfmZdKLzpxU3CW4CjcjHA7di7PVeqFj2I4ax5jAuKh7U4BodeTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3t8gyHvq9gyLlczE/uXc8bSJoDLL314D8OnSoXfVKnE=; b=bx27snXbQJc8FXU70m3MUjtlCVQk//mqir9vf2CenXjBIN+W6pPOr626+FjBAQ79OetE6oqtz2tWJiBTwVotR7y9aCBxnwWHULMldf6Z+SLGqZBEGdugU0+cRLwl3AAQmVLeBU90qN218clqD0eR43+3TvPLVzY0Ltx3ZnS+yru5Q18rYFzrLuvGl+PLKGcmA1bj5jSvLTVtz4gLRJ2zp7gBNxk4n28aP34zMSPRvgUXv4lkTtrvHy52dEGbCH/bedj6mRU5OrLWq6MDUofC5fVGevl2t0hZXGOy8pzPp0Tfl9u0PzZkYZpu6LkUjpUyxxpshGL6umTf1x6NfAW1xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3t8gyHvq9gyLlczE/uXc8bSJoDLL314D8OnSoXfVKnE=; b=Xz1hvI15Q14hHgzVJX9HXdLNBMVLscdq7lu7JwVTfWN3bniIVa+8/MpTUefN/qZIGGt/MJq0IzjdA+XOWwaZm8dVWRRpVItxv01wiJEGJJkB2kvf+mTrkeuVUKrz72N/4JwarwsZe0AMr2EayHPyaFurew/cmwhPTFfHgEqXoGA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB6445.prod.exchangelabs.com (2603:10b6:a03:2a1::14) by SJ2PR01MB8077.prod.exchangelabs.com (2603:10b6:a03:4f3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Fri, 6 Sep 2024 06:12:04 +0000 Received: from SJ0PR01MB6445.prod.exchangelabs.com ([fe80::223:9849:bfff:b119]) by SJ0PR01MB6445.prod.exchangelabs.com ([fe80::223:9849:bfff:b119%5]) with mapi id 15.20.7918.024; Fri, 6 Sep 2024 06:12:04 +0000 From: Adam Li To: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, patches@amperecomputing.com, cl@os.amperecomputing.com, shijie@os.amperecomputing.com, Adam Li , Christoph Lameter Subject: [PATCH] net/mlx5: Node-aware allocation for mlx5_buf_list Date: Fri, 6 Sep 2024 06:11:15 +0000 Message-Id: <20240906061115.522074-1-adamli@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2P153CA0003.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::20) To SJ0PR01MB6445.prod.exchangelabs.com (2603:10b6:a03:2a1::14) Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR01MB6445:EE_|SJ2PR01MB8077:EE_ X-MS-Office365-Filtering-Correlation-Id: 3381ad0b-c5f4-407d-c3fa-08dcce3ad3ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: eIS/0SlyntQQpUuPiCACScuuwbuiO32WBiaF5s3ok8klPgsDJXzcfpIm6SdHvB4c74g1zfzDZtRutt3LSjsjHQDpZy/V/lWP23RXjVvF1m/gEfXCS3qXet7shGglZzoAC8UHLsvt7chSIgR1EMfL8lUQs93DI9gHKZlQMV4yuVVwoPD4KVjD5DDP1GYtXQpZgQeM0BvRylSHLp6+9n+Mr67hL8LW/P1nbxvQBCBDdcp/p+xOoHXyIukpQrHcVbBKjV6wolQSL5p3srzkjiD8TjvnpAydlq8RzQQg4UyxzsL41yvSfMTx0bGqLAUUkH74Mqg2FPxo77OABJPmXYDeb9YO5uO5amM5vPEk6cQ0qejlZFXAe+vIaYoxSMzWfnPu9Uh5AR0JEVyv2XHQtrYSB2CANDCHyKovUv6n4CkWQmtb78lqak/gyLu1vaDvZ0j3MzRTJ7fDTlbGbhiKkgueAYomyi7WGaLGlW3rcTQvw3V5RYWajmUyCm5bodow6g6xUmdZ/SpjKBBwPkrZLzRV7ukIatZi1nanoDYKb5WBwTRxiSrwzUBNiZ6KDHBPnXiBEoUDKSgYcLHgz+Dz1N2AmLiT7o/isFFEJ93SngpMVI1sOJu6i7fh2ZY3XorMvGyxT/dks+G2KxKPcJwmW9o43aIh7Ix3A/TbQ1m0SssdRAMEAIHZRT7oIt7jZ9JkduPFx9gWJjdLwO6EiafeuKq6n1BrYkfR4LCfGtr7c6a+NfVRFyKRRMHGJWCyEfF27h9uziucEQG3KFfNj6sNjTbSWQwU5/hXGwLPbmKnLGt/iDK1VPOtnfnVMM/Fy/XH0E+fuy9p9EFsTu9zXgPuSMdrchdbfOcai9uaXMfs38wN0oWObfgT6RWRqVMCKE7t6o9ahVUbFlkPAtHlLzfz7dKkB9n+OH0uaWIaCG0I6bjbRnC43KVD8/bQbw2U7+SaXpxvON99NtuR7lheR220P1j7D3Psu0UaCQ6UuARqEPCssqIwLVrkS//U4Ls2tjCd8+ku69nbhRLynavgsdAENuOyQ/Gz+P7BWSWY4mXAwblwM5BZh3gPe+IsCNzuHXGKzbap2946zBMBeUYKpzi/u3S3eywyckFx2aev9GMjqSQzuCDAfGwfC5UQ6L8mRwJQ3zlGZsOATbFejK8H31na4wgx/6Cy6lRUpilykAXgRYnsnJuQTFmsPZWT0e6O0lpSSYwzGHvo3oFN8yZSymTWe671md28TXUtenVbrhT88fIo0pzm5OyLq+Sr854sVc1XujN7f+TOTmaYojOzoaGIIwcsVPuBOAAAVpS6zJmcjlzoJFNsK+/giMTxOwMeSP79QTSZ2LKz/642ZBCuIrBU5gQzZxuJpkstxXnm01z+L0s5WgDtVowFbfgsTuVuTSZ/yliEOPMVukirYX2BJptrZ9Uvrg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR01MB6445.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData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sup0WhflLb8YiGPEkUuYrvwsRich1qzRDr9DBn6yNQ1s66lFBHLp8JYkj/EVgcakwZo5QQ4JpqkBpZ+159gSJlFuc1qn1aSKuJr3Z8rmrlHLwdr6w4lpuknEOgN2leBFm8leKtU8ozIstX55kRWD2F1q11BWxHADTvQeDJBtOzwKLwbDnDvzLjImLxDJug+mtaQUfPELm7jiGsdLevJDCqRCyBgVdlF4nQiFfoRb8nHerS4QaxbtZVTZDt71dH2KHlMhEXQ1FnPpYqzNIJnLknae8vfchypy5gC9wqZ+Q/qBaSQ/2Rv6maJmZuc9UyFMUInySb7dEZ8VGAigysg6gVw3/N6gykGR7yQDHGpK9Xl5Euaoy99CJv2vQxrjpYJGDWCMtvAZqulZO4rzotPMCRpL8jaMy3klY9mt5PGWHJY84NxxDF8EaqrnYP0Tezb86qmK3xQL7fr0SM8YgVzbvaFiAwL4ba03eQ+/d74XGoEnRFH4KVpTI8/SRY3YPTC2MYMZ/C1VSa4f+Ihyat2+VkK5cUKCq6xyprl2QqHq6r1Lt1xi72RTugO7O4p3ZxgSbXUNmEHQ/4SG5G1Kk= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3381ad0b-c5f4-407d-c3fa-08dcce3ad3ac X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB6445.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 06:12:03.9710 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +lY3Ec3KV1olBnYdXTipm6RnISeut6jEppq0XjxK2+U5EZytxDn7Z3tYmj8AKdAkrRkQzkHXDF3Rb7Dgk6SWLuZOibJ3fQl3gGNv/ol88RX5fZWLP9WQJfw8LCZlaFH0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8077 Allocation for mlx5_frag_buf.frags[i].buf is node-aware. Make mlx5_frag_buf.frags allocation node-aware too. Signed-off-by: Adam Li Reviewed-by: Christoph Lameter (Ampere) Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c index 6aca004e88cd..fda17b41ff17 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c @@ -79,8 +79,8 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size, buf->size = size; buf->npages = DIV_ROUND_UP(size, PAGE_SIZE); buf->page_shift = PAGE_SHIFT; - buf->frags = kcalloc(buf->npages, sizeof(struct mlx5_buf_list), - GFP_KERNEL); + buf->frags = kcalloc_node(buf->npages, sizeof(struct mlx5_buf_list), + GFP_KERNEL, node); if (!buf->frags) goto err_out;