From patchwork Wed Dec 8 14:17:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664481 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF4F4C433EF for ; Wed, 8 Dec 2021 14:17:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234953AbhLHOVU (ORCPT ); Wed, 8 Dec 2021 09:21:20 -0500 Received: from mail-bn8nam12on2050.outbound.protection.outlook.com ([40.107.237.50]:36577 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234854AbhLHOVS (ORCPT ); Wed, 8 Dec 2021 09:21:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VvI9EzDtsmSWrdVVyHhOny55Bc8nQQ8dkeWATgrbj9jOJ9Oimi79riT3ANPHIfwBXVx2bjHN+n51AjO+w5FA7oCGNmd5x224Eqf0OOaWy+WllzfM2QxrIo/xiCN6xQtXW7LmWOtjMgZiohI9iSmv8deILcLS9Dyr8KyldvRdC6ggKLAc935LyKM7ygXJ4vAJ/m30T8pi/n+l6okp/OOjNQBc3EZubBMP7mnPS3I2qxKMkAqQ6prkI0Qb1KZ4vvYHds0db5VuD79BkkNHfLKE1mC23ABWW8JssyGBjCk0TauwCTtX+XwFSLbyAqXt36EoK1buKsiRVL6x7tnmilvwOg== 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=90aVpqkTbFJMsC31yGZI3UUVH9eqJVH5bfuuBYGoWGw=; b=oGQ5idlqJPRD2IEGvdsJoVBRvVreWtjEweSdatj1duK6nB0QW1Q0FtqR9aQ4h14ovtRk58A96ePLQg+iG+C7+SuqqdjyhjHlFC2zF8RJNtaXhn5xYxgStRQnkncOWQXLzpgbmjHJ2eOKdl30DOe3LXQUVPtchHOjGBfPmwkagcxQ2fJyCMsvtYTnDqvZudc8APjbbQvXtS5qu8EChfi6xWRUBUH5AkfNYHzhn7I3E8wIZa7cf8PeRFthManpV4NYFW2LzzYkE2Bl4AEpDvs8N73UNvlG5hanAMfg5loN9tKqFog5kIK1eHz0shjpQw0/KETSkjBQU1M/PxOhXH3miw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=90aVpqkTbFJMsC31yGZI3UUVH9eqJVH5bfuuBYGoWGw=; b=SAjspHmfk/XRzotFjHHE1NLJ7c+ngY8PcJ2bAdNS7+DRLcoidDnEELJ7SYC1G6ZDZaQON/lJAOjNTy0innn+LECP+U4GcVtex8Gd5hfGUq/1xQgKL/rzzFlli+iinr7M21UIYB2prrkiHkFjHV1h75JYlB2rxum5YMrKW8T8hTGceBfQXCeXl/Dgm1yY/5yvgrWgWM9VPMwRNYq7zI1GdJmlnXlL9GU+JdRECt4x+DiGsRW4ZoPUPsoarj8tkXuaNMZ/+AIHbQ1jBnPO4psn/3Wf7U/05Cqbz2ojkZfwGOcl9U3F4mOGv/hNPzD5nFEM4Uk3mO2J4uqa4+kyHZe+jg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM4PR12MB5117.namprd12.prod.outlook.com (2603:10b6:5:390::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Wed, 8 Dec 2021 14:17:44 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:44 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory , Moshe Shemesh Subject: [PATCH net-next v3 1/7] net/mlx5: Introduce log_max_current_uc_list_wr_supported bit Date: Wed, 8 Dec 2021 16:17:16 +0200 Message-Id: <20211208141722.13646-2-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7130b6b7-cb5a-49f4-8aa5-08d9ba5580ab X-MS-TrafficTypeDiagnostic: DM4PR12MB5117:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1LO/lY2joI6EtwirwzR1W2Sx4qjB2ARPYGtm1ouXSRe/jzWI34jE17L2ENNBOJtqTiwv4huK1CKzck8JrUbiozpQSgMJ6sWguo9XhEWXce8cesjb3oCYCFSMet5s0EttldCtNorjAPINpSEhmpSH3DBruh8KsuG56PTzh0VotUEB+JtvulW2SZyNCI+jmZustGuMWPwanN1+sv7IW2G0NGhXTXdwUdkjrAMZNINfsakvYZsscB2Kf5JgDBG/VxkPozprOr87EcBpIgEnW9LnnDtPoyAXmGlP+1puWLardxQ5VRWPRghIEs7w93e5lchIWsGjJ5euzsgIBZchC38y07uvCxstPwGn+z0JGGGGaRsQyjausaoPqSmClg3Zn+BSMTvz57/e52McuBzMyu8TWgNFGyZO8IJ2PpbpcgUAEQmUSZD+zXgOR6P4ejJS52yaP9a0Tb4Mu2KmlhGmNt9wQROthGpY05ctw+XMqYsn4OXr3R669WCCD4kCqmDuhFmGNl0483+HNdYRR2KEU9mlrR4q0f5bv5A0hu1A5B4FExAY+T3cPmw0v5DegS7UG2UJU0p4GCjwC8HPvM3YU6RqjkQCIluzN/hKEsxgvdP8GiPc85IYT7XUlZiP/Vg97HJtLUB5D8fLJAB6LZ7+9CBU0O/h9Cu9yEFUc26PTLKUhJNi3LFqwTagz/t4oIpYdguzU9qqI+Ldznlp7i66S79iYw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(5660300002)(316002)(83380400001)(52116002)(4326008)(107886003)(86362001)(54906003)(6486002)(110136005)(6506007)(26005)(66946007)(66476007)(66556008)(4744005)(6666004)(186003)(36756003)(8676002)(6512007)(8936002)(508600001)(1076003)(2906002)(2616005)(956004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PE49YcUKzsCEL7WAqneSrjonRQE1JRYORadr4JB0GrMLa6P/rPRHYYj8BKURev6SwXILqbIGvXUZ5kUlKhhdzGXjStpN14Cvm4LozVBldbdxkO071Qeo5+0zYKAoaDP0DL13eR/Tdx0v1E7CIi5z/TO27aIDg8BT1C5V+ZAH8cr+poY8uYhDdnQY049mHPSt7tpKkPJquryX5oNzdqVdfoYvtm6Tbz6A4Fs3QvTlA9shjRUhXCcgFGP56v7OFovLNvyLlHDYfIff7f2HE3B/oXrAUZ30gz6AkkdDpmdPYnbupsBGw4rPDOCzVozf81gAy197+KvMRI7819X/LI1Q6djHoQOpWQr5/L4ukGIyn22KlRl19xuQXk1N2Pp6IAkdJFXeUBwWzVSiZvVQWcWSotNKGG0JRGjQ4RBMJztQn1XnEcZnMG3Dl4zhKqsNoy3fVXD4q9KUkEWMYtbc0EZxq6RSDZ0MbV2rnm/0E5dtWlwyFG9kU7bAStYHKl3gDW8pSBvQb/5o9Ma9RE3QYmIJfiPcouT2BYHgXynh/vu0wgpqAlWPGNadjJ/pV5o8y0h3XgYI641D/yCoXEZEfurgjgK4Eti0BqAjzW756S9Qin63FBO3me9e71S/mn0RvSqV4365Z14t96t4vVXzM+d7F/LRevewIA9OhG81+83ibvZ10G06Bl+OsVjCAV7Yn8yYMi1fr4XNCCpGWFZ5R7IL7lZd3PkIi/UVSX+RsRbYWbL7JZXnOXEfbtRAfiULsZzdEgtARlrR+h31rCWUdaRIe/bSgpZYnC3bQT8cvQbxbdfVr9KCr2WXVChRTEvSNiPuxPaVomIiqzCayG8Zw/vD/iKTEapknmVhbOn6t+4RDf9VZFSdgqOteVk0qVn/TTobXR0+/kmxXkz7kv91mwNHBUksEQMWHx5ZD4NhSQk1F5z63lnxcnPGG7DS5TWpMLN152W+pwbGE2KKhFezH9v9TS4rw0ec6B5u7UFL2DWZuR3LYL0owk21KbaU1D3QC9PLQULYi9gzwOUH8xni/cu585ITQ8gkYShfDYex5ejv2Ezkyg17Y9m3WAYZEQVbsOEqlgENQM9uvBTEtQQmXHuh2vTnrSbxIopdIoE8nQJR8Ww0zE9ObTMF/vVlRHrN6DG1Kkz4QKGGfPOabN6eyqFyvhELp6FetiFEJNUVeEMgUmUJboEctyJ9o7xVXQhQhfDjeM0PCQLHiFrYFBBBfUTsQf1pLr7Anmi3cceeFo7+Ub6ZPmDsOxHOgO68C3VlsgFTCjLFxo/P9ChwDWXN6Z2O56QPdBwi2TB933sMtmaEAjCqv6CGpX7TKbrgbq4zV+uPPHk1y4SWH0DylOwJoWiu5IRfJ5dmNQQSNzLlyzRkVf2jJi+2/edLEQjNz2UULyZ+5bsqAN0+dRDiUEUbiVSTb+93SaHupZiuXkIFhMjTOmrYrzpQOdKNpvIxq4q3Rwj9tbTkXnTMbJNRj3IePHf+P7EkRILfJii8Uw9V7MbOLFlobtQuEMVNOejoW1FFO91r4btGaDibrcn/y/qYMnxJtqBUtaFbcdd4W4FGucdWu9lnxLTWCtkAa5ImVDvse4Otm2xZixtBhbl8dr0CYbecY0fdFF27wAeLTXxGcREJrFM= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7130b6b7-cb5a-49f4-8aa5-08d9ba5580ab X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:44.5996 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aIgPDjJm1tXeE52jYSQA936yKYsTPEFPjh83Q8K3iE2xG+ehOPxdm5rvqIMCCe1QLMUMpD+Q7/EkAFYGTzBZQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5117 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Downstream patch will use this bit in order to know whether the device supports changing of max_uc_list. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh --- include/linux/mlx5/mlx5_ifc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index fbaab440a484..e9db12aae8f9 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1621,7 +1621,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 ext_stride_num_range[0x1]; u8 roce_rw_supported[0x1]; - u8 reserved_at_3a2[0x1]; + u8 log_max_current_uc_list_wr_supported[0x1]; u8 log_max_stride_sz_rq[0x5]; u8 reserved_at_3a8[0x3]; u8 log_min_stride_sz_rq[0x5]; From patchwork Wed Dec 8 14:17:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664483 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8262C4332F for ; Wed, 8 Dec 2021 14:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234973AbhLHOVV (ORCPT ); Wed, 8 Dec 2021 09:21:21 -0500 Received: from mail-bn8nam12on2050.outbound.protection.outlook.com ([40.107.237.50]:36577 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234948AbhLHOVU (ORCPT ); Wed, 8 Dec 2021 09:21:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KlHecI+K68/ZO+nAMG9awYibI+jP5/YGqiBYVEV8ds4glYYBzm2mnhSsQsI2Xz7V5hEIprgmEWUI2bSB96cowyNsDuODdyC4qkGcMndi39QdYfNKw1F4o9X8ZfGUdtXgqlxb++frTwjo0oqQjFnkk/h/NgVzwXXMII6ktCQISD12vjn8dxkK013bLWkBloR/3MEE+KcCoJRFc946hVYcQjxAQJGc7W4VEoPGrF/OdbIweYzMRS9NpK4fDv3cUYCGCG+3N8pNLp/3A8f0u7tfYvmULOr1K4TLQasECWRUcRrYmc62/1OAjhgUIHHDjfIsFuDwIPGmAZO6RW42As/Stg== 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=c4+owX/Kc51f2qGuomXT+bTD7rCJeOcYuODtOJgND6c=; b=UTjUvN3aD5EjPqmrut8dL57LgfgpkVmvTaND1XIiZ67GSc63scTtY2bcZ7OEUOWcYw8FlrvnB9JN0aXG6wJrcBHvhG/ePwXG9kIMQTZ9U5TiPufI7K0Mai/q/7VTWIwPrT5XQwhglyJFVBxVNQ2JN8SOqPQxNlYOev2dfvNxtfGpdDg02nB8TNWrhgP+B56/zUcehnwHoFfbm0SLSK3NVKwF8+/UVrE+ulnMlQm5ih1HEkxsfKzi4yggpmkpFhr7UUd1t+NFmZ4go35TY0XjcE54OZg1vT+y/jm6JfneiskzU2wcoWnP6AGGvoK2jRVB2mmrU/SDXdx1OsltX+XGmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=c4+owX/Kc51f2qGuomXT+bTD7rCJeOcYuODtOJgND6c=; b=ahuGm1G2uWaaz1qIlgx7raggw3bMgLWonoX5hMbgueSKlBhaSCMpLo5CozzpHcE199mLjPJyDEyZWK2NAPs4rTORaHfG1YjokmwhkYPP0EcP+0nnHMTp4M80etWfV5drv/Qh7Q98mC3P1Wc8FkjeuCKJeX+6ydfiaQi2hmGnQQRdsxW9mhFtM6j+xppL1MWbsHgRhvfdzqDyj+Gcg7tSaE0OZPfuxyB2p2gBHLnBUzn0T7YoBBmw9xd96fLsSFQZh4r5gh6SvbP0Ns7Rv8NKZh2Yh+zP8tSbNkagOmw9fPLCSbzE+Y5aeMY2EM2sYttilvnEHkdpWUgC4pC8/cS1OQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM4PR12MB5117.namprd12.prod.outlook.com (2603:10b6:5:390::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Wed, 8 Dec 2021 14:17:47 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:47 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory , Moshe Shemesh Subject: [PATCH net-next v3 2/7] devlink: Add new "io_eq_size" generic device param Date: Wed, 8 Dec 2021 16:17:17 +0200 Message-Id: <20211208141722.13646-3-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f95fac76-55e6-4028-2d1c-08d9ba558216 X-MS-TrafficTypeDiagnostic: DM4PR12MB5117:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hYDeVFzCc8MY81IxHPvoaxyB/WnI2T7E4GrDN8L1notn3Xg6Fl96gNTvqmh7yUaFF/oXV/eJlQ9c8rqn9WZDwugaOrq6bB9NWdbWe7pEKG9EkJ7YjEhH7vGmU7jCNA6LSEcUwkFiGyxmRdT9hQB1Hn44qZBkoC8aozmr7OJ0E0SUFvyQbnOyXe4GbTMhibdpkqEQT+hBlDIDJXkSlWCLorZ4RLP49onMFYBw1mEsZH/vJ6z8FqmRgrQay8aiiYCxMwLWWFSsSZCtWKAELm4LxJo84yRHwrlSOWfYDV2t0xF/hFaNHRDZprsamONnF78qB1kbJpo/3j5aWNdZ58fB313oKyqK3mQyUxnOvytRjGcH6tJt5IpfXYQN3jhioTvf0IA5pOzpCWGTnI2BlxtWQBx60rdYQqZ62zTf7rF0Rs9IG4wRH9Fo4uTJsE9VvYJHoTTf2fnfd7NpSMnGBIi18i0w60cVa8yj9+yG35/W/k2ZhvMV4jlmvDsPrYAZv8gTcHQ60aoFw124C5Dt7TSU8Jq0m+o4/M1NeFdgiuHT8MUO+//4sRxdPn5WzwH+YLa1QXbXZZgVsqc+1LTjLwQR081OQITJ9wRDLy/UIH83CGYNjwzGHuLFe08s82mQMrb8V2kXBaDC5RRFInDFBgn7gFdbc7qUW5bFA2fGo1HvYpywE0V7Z1E4SbbiljrwVIcNgIe9FpJUBu7Cb2823Cy0t0IOCVNeRIDu2Dv3Ia1CDk4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(5660300002)(316002)(83380400001)(52116002)(4326008)(107886003)(86362001)(54906003)(6486002)(110136005)(6506007)(26005)(66946007)(66476007)(66556008)(6666004)(186003)(36756003)(8676002)(6512007)(8936002)(508600001)(1076003)(2906002)(2616005)(956004)(38100700002)(38350700002)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /5E1EhE5rHu2zdvf8OwH0rzQPK9cFGIY3KSwLpKmWTejw48i1OzCacil0kLLxjML/n4n2Wj99RhyleaEdvcmEf4l2/qqNFZu55GMnHg9OHp1NSLuZxPhYaCzIRO1+GQhqVplny8IRVKTRtiHqpczr7r58UpL010e3Z85TPECJoffONkUHPhptXPk+SI+hOXDiAR8ScufDyGCI+fBHi52ef+lItHNFxZI0F56MdW2o7mfdSHT4/keprOIkZh4sKx/MeOZkYkd6JWgRWenvHFo2m6g1l3Je9dvzdkiQSZ2t5WH4TulRfxpFAiwvUHOvxi3kZKD2gBIeUpGsVZZZhxVmVK7zmdEwqiq/L1bftq+kN/A9J0PkvqW/AGIh74Uxg9GLiZiX7yezQXI2+fnwy2nLt90TGfvHyB4us0miysQ4NEn67SU6yuEgQkvLpx2XWsKquUEy0FCnrmgFUcMeKSXq8Ti6vr4byNH9TKxqMevbdwhuOx7ea4NXUs7w6JW/2s5IDpGdHRDW4r3s5IxZ0KJu6nonfdfCCEL4uzPyu6v5MlWoyIAVGpyNXGyurrp5cplWPMCKfkmpNAuGWl9DGGodHw4MYsCp9/zZKJhRNtmvAvgnJGlmGhXjBI5iJ49cQqyAmptx5+FSu3Ee3C3YtWm17LlVJ8fnHwjAJPEohpyWp9xWmCGiba2/nedV2o4BSif0Jj54Nlq56/COf4z5o+BJWZh3sX5gzM6S1IngXWrE2tIie1hPdgi+rCVnHiYG7esTEYjQs8uKES50mTYXhdbkzoFwX77UcIXHXA/Yp6BAlW5GDV9YImBIVtG+xSfkaGEs11+AusxEPLmxdGPYFZGhTq+rle+7TUzGHkjsDGqCHoEdnWfat2dCz7IzjGRp/9mubKy5WU2N7Ki64ece8mPWwKIIYMrqVskgW/YUBpsGuCH610n7sZnq5FWtwRBXbt0R+HDhq9rByqqtjizOwASov5OAdR2SqfirsUleRQ5CiBN/vBQ78cNrly07G3rTwFTRjtyKPGJUQRxFdZ9WqKiopFuCWROFm4A321V5yDvAuMan3cU+D5TBtWBLzgq2lRlYE1V73/1oNDIpc/pRQNwSzG0TzKt/BLFAPCPrA44RcYvCWyeShUbYhZ2yIJ+wrVuj46fRTqOOe15y0yWPy8+LTDwnWnOEUQxKXQyJoiburoXSTf8ADZMdDUHyRvKb/NibBZwRpOk0Eu+LN8j4wiKAacSehKkofsLz6RXoruN//IUpZoAh0t4GeAwdlhJUuBZPmU5fMKZBA+WJXohGcOgnvj54z3e1TQjgrUUCcYEoRXspC/hNSzEQ48KQORFFLZgBb/6D3xtr7YwGP1nFfHWrsOczOs0pkAiWB/RruiWuIBQi3J6fhQEkgjHHDg6U1TWEMcc043nU611S9BwmJ3jLXxG26jlENJv9EE0LyxyC8WfV8aFNMVmdtIRniy3QRckkeiuckScXnlHyy7uyQujwF15/FEo0gyTri5bEoJGnh7fJnp10eizjZbd1HcNBp2OEl9SmlT2hGGoU0cPY5e5DEji1B1W26vvBo7xEpHH+d0Ody2e8yq5kOJ477pSkSmhBoHIaNhNFdw/NhwJqhhlgk4l7mbwRVyjvd7zN12orF4= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f95fac76-55e6-4028-2d1c-08d9ba558216 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:46.9672 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UnQomFMaWNuJS1FQD15lF0y7yguC4sEoYupelqBfsq+gDGqoPFVrlNw3r1BprdQhjF+B1Xz4yColU8mDE77/xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5117 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add new device generic parameter to determine the size of the I/O completion EQs. For example, to reduce I/O EQ size to 64, execute: $ devlink dev param set pci/0000:06:00.0 \ name io_eq_size value 64 cmode driverinit $ devlink dev reload pci/0000:06:00.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh --- Documentation/networking/devlink/devlink-params.rst | 3 +++ include/net/devlink.h | 4 ++++ net/core/devlink.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst index b7dfe693a332..cd9342305a13 100644 --- a/Documentation/networking/devlink/devlink-params.rst +++ b/Documentation/networking/devlink/devlink-params.rst @@ -129,3 +129,6 @@ own name. will NACK any attempt of other host to reset the device. This parameter is useful for setups where a device is shared by different hosts, such as multi-host setup. + * - ``io_eq_size`` + - u16 + - Control the size of I/O completion EQs. diff --git a/include/net/devlink.h b/include/net/devlink.h index 3276a29f2b81..b5f4acd0e0cd 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -459,6 +459,7 @@ enum devlink_param_generic_id { DEVLINK_PARAM_GENERIC_ID_ENABLE_RDMA, DEVLINK_PARAM_GENERIC_ID_ENABLE_VNET, DEVLINK_PARAM_GENERIC_ID_ENABLE_IWARP, + DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, /* add new param generic ids above here*/ __DEVLINK_PARAM_GENERIC_ID_MAX, @@ -511,6 +512,9 @@ enum devlink_param_generic_id { #define DEVLINK_PARAM_GENERIC_ENABLE_IWARP_NAME "enable_iwarp" #define DEVLINK_PARAM_GENERIC_ENABLE_IWARP_TYPE DEVLINK_PARAM_TYPE_BOOL +#define DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_NAME "io_eq_size" +#define DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_TYPE DEVLINK_PARAM_TYPE_U32 + #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ { \ .id = DEVLINK_PARAM_GENERIC_ID_##_id, \ diff --git a/net/core/devlink.c b/net/core/devlink.c index db3b52110cf2..0d4e63d11585 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4466,6 +4466,11 @@ static const struct devlink_param devlink_param_generic[] = { .name = DEVLINK_PARAM_GENERIC_ENABLE_IWARP_NAME, .type = DEVLINK_PARAM_GENERIC_ENABLE_IWARP_TYPE, }, + { + .id = DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, + .name = DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_NAME, + .type = DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_TYPE, + }, }; static int devlink_param_generic_verify(const struct devlink_param *param) From patchwork Wed Dec 8 14:17:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664485 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AEC9C433F5 for ; Wed, 8 Dec 2021 14:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234854AbhLHOVZ (ORCPT ); Wed, 8 Dec 2021 09:21:25 -0500 Received: from mail-dm6nam12on2053.outbound.protection.outlook.com ([40.107.243.53]:49696 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234950AbhLHOVW (ORCPT ); Wed, 8 Dec 2021 09:21:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZpZAcpxMzF/tHX4R6+Qg1X2JF9Eq7CRrd8kor8eUckM6ORdF3qlPOrN3cc3W+129p/NcPiWrumD/KdPRMStDlX00z5SYmzlxdTRK81RRk7TDUg2azlMLEviWWVe1R1nn2CYkNmf0Yxy7mjoVRVk1mIKFTBHg8fcIaWzOM1qig6ajw3WGe9Kx84WncPtSpmwhF+ItzGoECddcIQu7xrvCIIJ8llf44KtTHqLSX2apVAQBM1jB1kzBfvaHsadyFwnlwgqytJIjTy4bQWpg1S7v4vCI+xhdAfzeWVFkAuexrVZMwWh7eJat2PFSSORTB+3fMFb5uogx13PPYu33BSxGg== 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=fBlgrDTQ7dqnqNMoSVQAssmI+LEq8AF4WB5QjgpPCN0=; b=MhPL2SAEPSlU2244wJinyVqva8PHHF3JzFkbYetGjgqKqFlbXS8ZTOKog5wHuOpc+tkb/EW+fIhh2m6lsjC+idTXgKlteDzZYaRPoNxh6q4RhVPLgjJqwzXdkgA2OrrTyeyKVzHUmpTwRH8l+ZoicjBmnH9rhfB79NmfReQfl1DM7/ss7BsnOm5Q5DpSU9sTJzAoeJjQG/CcRBDGBXXPGHU9UAwc459aqr90I3vDRiWW4jfsCZNEsIOr6ev4+m2//Yns+cSw8lKuB/lIsKuYea180WXvoJTdIDZdztuNOoeLpexxBJ+CXe82z4/skyw36FSgr6jjFVjAA9NJ46kk1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=fBlgrDTQ7dqnqNMoSVQAssmI+LEq8AF4WB5QjgpPCN0=; b=VnRdjyAlny1M3iQrWSGdQFoA1hZbuhAGOX3vfnRVbQm8twyZzYOIpSMBVmDKBNoAyhKZaMz2bgaWq50rewZ4FKec/Hy6ViZt0Aj0preByVKk2vDS1Nqc4PtaUndY7wIaLXWijfbKZfvTkiRX+Zkf4BJavhrx+6vkobCueKkCOBXoHaVU4DxVXAhOQ1AZdBIbMQyahkfSsBv2R7Pl8xANdMnm5ZEiw0S8wZOIeUoSf7olkXik0tyfFQhUdMP77VGNgPWUTROJS4cd2Zs1Ew9hcH3ka0HHDkmJekRes8bS9W4ilmAnkUXV4Iye1PiuB4iYd6j58F7H6kKVjCDO677HAQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM6PR12MB5568.namprd12.prod.outlook.com (2603:10b6:5:20c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Wed, 8 Dec 2021 14:17:49 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:49 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory , Moshe Shemesh Subject: [PATCH net-next v3 3/7] net/mlx5: Let user configure io_eq_size param Date: Wed, 8 Dec 2021 16:17:18 +0200 Message-Id: <20211208141722.13646-4-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 557733f0-1508-400e-fce5-08d9ba55837e X-MS-TrafficTypeDiagnostic: DM6PR12MB5568:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fcUe571HiJyu7U/m6dDemyS1/FQcfxgpVYJE4ZyhhJaD8tv/KVITAKVp+ThRnTmG+KEBvGpcyfKLOZaYFt1nxxge3B2WjLcaBvxQhQZn3CmL9Fg0W+9LBk6O2GvuAe3cW62Uz5tC03xJTBIGV1rSb9awMPebPxaXGHeCcTgUIklXNOa5FWUnvVkDkvtRL7gp8PFTmLPciobC23h/uatxO++2Siy6E26J9lO1erJ6RH1jN2Qvua34vxgyMKQNxfBCiRGmn/DoW5Q8T/gcDQdwqg1H3CjqhPTQTckAXszKtbHjV4TLX0iMemQRoCeemKD7nHbFc8wEv48yAcKOVgKoS377tlN1L5YNic1zEkdniu8DZpP//xJayMDPRTjTuSvxt1PnVyhsCJG//OlBCv2NFUJALvsjq0SjX4455ZdCG054565DA0V+DaYpeB+ITO2JiXQ12PcNg883VpjBejSJmTu7jx1RsMNeuQCcE8Z1JcLV7L5PS3KFcve3vN+gnFacl+HLskuSt1do3fH8K0WHZQpilZpoCkUeCN5IlE0GU9+Oa1Lyo6mckG6BBLa2yuSb4WCNkdHUjouPlGlQOPzV2jrAB0zUaOXZy4Q+LmUjKfBRArv2ht8sDZc9bsMroHZzlgRogMRVzg2U7xdqlHTjTQTuD5BMkI12+GXkeeUGfslFXwr+o347D0JzcV+4fC/4UChHa/Pvu5f4UmoIU8QIGQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(66476007)(66556008)(1076003)(26005)(6512007)(52116002)(6666004)(107886003)(66946007)(6486002)(508600001)(2906002)(5660300002)(4326008)(8936002)(6506007)(36756003)(54906003)(186003)(956004)(38350700002)(8676002)(110136005)(2616005)(83380400001)(38100700002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ge2BZknIGBcj6F3bZ+m7/wSJmSwiKCZmSK7PwMnByCSf25Ki+mQ+YygESiBpn1HOe+zHj1wXmwfR9jCUCgM7z1YiJeOGnLqXPNgQH/fS2wvlAzD2bzKDdWDgyA8l5/HerPspg3MgTPsJr7zgNpkrkO5+7T69SHKozpnuRMi7m3wY8tBGUMSKx4G2Z1xET2YgQbJGxiLn0eglFA6NFYawzjkvOAzK/v1PCSmjg8WtJ5yGPvjjSfdHuLx3hhOf6M4W708JOeRaFQuENQ4HOj092RlsgHp+RsA44C+LnUtileyB9VRgl1vTouL1eUvtZe3BVk+fwzyCX23UyseJGJ4GyFF2It0oGXwgSbH1h1Z96+a474c1sMAUxbIOI057SUmCuZBa0bsHF2BkM43JLDy9hMPox4GbIs0+9q4voCdpJGKf6H0DY6pzTVVKaLiBq53gkAZoAW3c3NgKfjGAWcwe5DKu1GmzpGr6+KrCxAKpG7fbO65xbFwWh8Bj6wmsnHHbr+QnURP7wp1FG4umtsiD/3Hwh/zxTDtnWfAt7s41fmp01iJPJWQAUN3wCp8wgyt1BdvlkT+DjfLGpwo/+4m//+PkgUhIIQybWL9eUTnnjDVWPzBmnNv/yf0Fkimi8Lywl8fl7IoDe/49O7Xm+etS2UDFy83ezNlJVbRnKWvVMEtYBOu2qNbT+nMenIrGiAWHf/p2URIH5BWOn89+XqDAjLZDm9efPdvapBi5hreLIC9tR74mXlz9zUOZtmwXGoSadRWtEh+687UC2dULA0Rvgks8K17wNwyZ9lf2NRZZHqxghChKqcP6lKZUA2hwMKd/0J0BybdClfPtFn2GfKmuQCvSi47Z0eqF2kozvVt+P05Rz8OrBY2ACD2/5qDWJKlPMX40grVfXdupl+jJ5sk/y6Lo0qozfqrxaxt9uR2pjDdm02wtjXqatY/6axk/THJefQrVqpG4JNYFb9/Yvyx5b2vtpAdEvHYGaZPhu8y1VzKKsfxzIZt48dvqcaMWYD8k2C9ryigI3w8r9rcCWZ+ehKHQKoWcScjIZjWFF6NQ8i7momXbch2ECiR9it/isBXmtkePetOluEfHSLSGoSo0Grbwcwa9SQN226J/T07xHddBzZOb2GJ9JC+2z4Q9SY90q9PFi53VOGQKiIQAMhQ7E0dljPjUMX6yxDJtCcR+MaMGdOyEs/vXKwGSUphnN9GHgH1mXeIznj1KP8dPtcKWt4t/CULuK3oIvHH+4GpqACUbL8q9edJ4BRjVoVE5tsY0RwW5yWs1rlgHoPISAY3f33l/o6xqSbNwBo23ZQiDh/oSb0ILHaUDiObTg1Yv0ZZ8wBFl5Mtqtcd397snQ6nQgaXwjD4bElZ4qCh0/YV4CFKubIsjE6H0qyuIbUkUR7/oTkf/1ieK/bE+vmoLHFdCFUgfLAYl0pRnZiUGy4fPD97GTyWwVunY/20uB6S1b/tXOv8hF7BD8XvhfVpHX/E4thnECWwVnAU0ycxbTmnyHyTb0+WOyDAkso5wOKH/Koa3rsSbLnjQal6LNwFv2Ga9jOjAyD2r5iXIo6g3brZk2MmdWKtAe0RH3D7iIOTycEK8SrVbZBXL+Tj6RW6qy4KOvUBmszm9JiL5bLbNas/9kqo= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 557733f0-1508-400e-fce5-08d9ba55837e X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:49.2771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4qvhjJ4XIREMztv7ECtWRlqv9CvqYCabj8zFaG4kdRiyVsQj7z79dv3KnGjvwvYdBXJARpGXcBlWnrwVjUOvRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5568 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently, each I/O EQ is taking 128KB of memory. This size is not needed in all use cases, and is critical with large scale. Hence, allow user to configure the size of I/O EQs. For example, to reduce I/O EQ size to 64, execute: $ devlink dev param set pci/0000:00:0b.0 name io_eq_size value 64 \ cmode driverinit $ devlink dev reload pci/0000:00:0b.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh --- Documentation/networking/devlink/mlx5.rst | 4 ++++ .../net/ethernet/mellanox/mlx5/core/devlink.c | 14 ++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/eq.c | 18 +++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/devlink/mlx5.rst b/Documentation/networking/devlink/mlx5.rst index 4e4b97f7971a..291e7f63af73 100644 --- a/Documentation/networking/devlink/mlx5.rst +++ b/Documentation/networking/devlink/mlx5.rst @@ -14,8 +14,12 @@ Parameters * - Name - Mode + - Validation * - ``enable_roce`` - driverinit + * - ``io_eq_size`` + - driverinit + - The range is between 64 and 4096. The ``mlx5`` driver also implements the following driver-specific parameters. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index 1c98652b244a..177c6e9159f8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -546,6 +546,13 @@ static int mlx5_devlink_enable_remote_dev_reset_get(struct devlink *devlink, u32 return 0; } +static int mlx5_devlink_eq_depth_validate(struct devlink *devlink, u32 id, + union devlink_param_value val, + struct netlink_ext_ack *extack) +{ + return (val.vu16 >= 64 && val.vu16 <= 4096) ? 0 : -EINVAL; +} + static const struct devlink_param mlx5_devlink_params[] = { DEVLINK_PARAM_DRIVER(MLX5_DEVLINK_PARAM_ID_FLOW_STEERING_MODE, "flow_steering_mode", DEVLINK_PARAM_TYPE_STRING, @@ -570,6 +577,8 @@ static const struct devlink_param mlx5_devlink_params[] = { DEVLINK_PARAM_GENERIC(ENABLE_REMOTE_DEV_RESET, BIT(DEVLINK_PARAM_CMODE_RUNTIME), mlx5_devlink_enable_remote_dev_reset_get, mlx5_devlink_enable_remote_dev_reset_set, NULL), + DEVLINK_PARAM_GENERIC(IO_EQ_SIZE, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), + NULL, NULL, mlx5_devlink_eq_depth_validate), }; static void mlx5_devlink_set_params_init_values(struct devlink *devlink) @@ -608,6 +617,11 @@ static void mlx5_devlink_set_params_init_values(struct devlink *devlink) value); } #endif + + value.vu32 = MLX5_COMP_EQ_SIZE; + devlink_param_driverinit_value_set(devlink, + DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, + value); } static const struct devlink_param enable_eth_param = diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 792e0d6aa861..7686d7c9c824 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -19,6 +19,7 @@ #include "lib/clock.h" #include "diag/fw_tracer.h" #include "mlx5_irq.h" +#include "devlink.h" enum { MLX5_EQE_OWNER_INIT_VAL = 0x1, @@ -796,6 +797,21 @@ static void destroy_comp_eqs(struct mlx5_core_dev *dev) } } +static u16 comp_eq_depth_devlink_param_get(struct mlx5_core_dev *dev) +{ + struct devlink *devlink = priv_to_devlink(dev); + union devlink_param_value val; + int err; + + err = devlink_param_driverinit_value_get(devlink, + DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, + &val); + if (!err) + return val.vu32; + mlx5_core_dbg(dev, "Failed to get param. using default. err = %d\n", err); + return MLX5_COMP_EQ_SIZE; +} + static int create_comp_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = dev->priv.eq_table; @@ -807,7 +823,7 @@ static int create_comp_eqs(struct mlx5_core_dev *dev) INIT_LIST_HEAD(&table->comp_eqs_list); ncomp_eqs = table->num_comp_eqs; - nent = MLX5_COMP_EQ_SIZE; + nent = comp_eq_depth_devlink_param_get(dev); for (i = 0; i < ncomp_eqs; i++) { struct mlx5_eq_param param = {}; int vecidx = i; From patchwork Wed Dec 8 14:17:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664487 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5778C433EF for ; Wed, 8 Dec 2021 14:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235024AbhLHOVb (ORCPT ); Wed, 8 Dec 2021 09:21:31 -0500 Received: from mail-dm6nam12on2063.outbound.protection.outlook.com ([40.107.243.63]:3361 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235021AbhLHOV0 (ORCPT ); Wed, 8 Dec 2021 09:21:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jpb6WDc5IjJHtYvD6xFg44QBMCSWec5sKYZEgrXvSjskgIu/lPyKJIYXsiuGosIUxXlsuRzQ8z781FglzaB+IJWddm2FknMTAyeavzfqGAJcqP0xNUd4sqs0d9LmmgHwZa42WHVmlj82Iz4EfVjnmHulygGBDVysGlkawJ50kp6Z8Mrx0T0hz89QJUxLvzPznriZCJopDYPSVGeqWja7tDPB1ET8MbNl6ptGtwDuPBLlGTmXU89IyzMz4aARqJAllslAraBg0N5vZpZ7uoof3ny+kFHGkrj6WFTxyAaQgenU+rY3HW22/khh860EyjAKk4UvMuVHGolghAjKj9rxTA== 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=9iEl/4HDtiYV0Ofdwq8FmKI1rl2DrBhANDwfWtGGXgA=; b=QGcuvHzSn2a4kmqZqx66iX2CU8QaMdrXzxmi6cAAJ5p7AnSJ3y4cBiFG5Rf/DjtQgHlz0QrucUGtQnTDiBmhe2W1bd2+gD3tCLDdo+y0fcMelxMrIFgFiDvgGyLG9L1P2pYrWfK5DZHMwMlRF65DuW6nKXL7uePb5kKa3pgN6nNqD/oaSH1GooJJmw68AtI9tsngXWkDVL2XXq4ZUFRF7hJKiwrcrBtmGmvyfCFf9XLv311AAO/FKxCdweBq4Qz8KgQPAlaxs4K7NL1zmAJa0dYguLQ9h2q5aN2tN+ffu02nz5Bx0uNBGXqcmo3tDaxum3FhELt2KcYeegpHI/HDYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=9iEl/4HDtiYV0Ofdwq8FmKI1rl2DrBhANDwfWtGGXgA=; b=i6b8ccuQZMBvvRoau3p85lIQFbCjXgeGs0PhZtl4SQ81X9kDi3AfhQywFYHfE180Qr8LS38KT8DeBiBa+frcaQCi2mEenjxz1TViPxsV75z8Hr65GC03C1q93dfSbCfGmmmPk7Si4pxrkszwjfl8ZpVocSJLGM+8x1kfQVoRfAFIPutvJf5wB5ogsWief8pGtDmztr0uMYtIDsIR7d6/V2zr+aDbgajVC6Rxmn+9EyJjkBy+PvAJv1sDPv9UPe8tqPCUbJQe3uu7+zzg86g5n7CZn6XS+87J70HAdQJ0VwBXS1hk+hpHHk5pdsaLNndL4b6U8vl05f/Niqo676pRcg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM6PR12MB5568.namprd12.prod.outlook.com (2603:10b6:5:20c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Wed, 8 Dec 2021 14:17:51 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:51 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory , Moshe Shemesh Subject: [PATCH net-next v3 4/7] devlink: Add new "event_eq_size" generic device param Date: Wed, 8 Dec 2021 16:17:19 +0200 Message-Id: <20211208141722.13646-5-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f81253fa-b5de-4680-07b3-08d9ba5584fa X-MS-TrafficTypeDiagnostic: DM6PR12MB5568:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I4GjPzy14a/G/l0EN4QZnpCeUREiD7lRHE7CL3Evh5ClDVBFKu3NS0EzQpeP/6lchyGbrosBxJGHtmEdUxX43jA3q1nyOapEutA81Ts6ZFgp97e9qPavExrsWiOd0IU+f6qoZKn+wUN3WtqAB3ddAf/8ULSEh6D23gxBPvYQ0vOnGgw0Zk7aJjVKOfRGZ0SF6Stf4xZximgpQ5WqVj8v1kp1TvdPnS/lzMqlF7gAj/94dRIoAFBYn3gKLAK5fXTM3Lw1730tjcLz/kCwtHuIi4as78+mh0vGP3aEtFAlaXED7OUad5AS8umDJ6R9/AivWPzR6w2orc3rapUZ/8P+51Vela6WFWuVjjkM2J00bf3XWgJAgTPFxKQ/eVp1mLUP4tDOk8WmUuNa0Qlxa0X1XyGxvyAOOmwa6R2ZQu/W0iATCyIpsbctPAbLgw6v99fSj1WPlK+G+EBSFXTg139PqAmcmEmjSzcMSEuk3uCye+dVi/RsI3HsT6GP3IscNi//boaHWJZSYjGuR81UQJR0ARD5pE4ZMwyl6jRuZoIVVYCAP2R6uf1XGTX37RKpWVat76A66KJr/d+M5nEn7v67elVIBlfPBOEXl/PHU96hMKQ6sfKZNilf/0D+WBHQBpdBSB3RmaPGa+l78SJTpJ74TQ8HEecBn/sDhoImSuL4+1YEyLzK26j1aV1yG+UebDjLG/4RCu1kfmzGtxWuwxrmtiEEVMgwFzn8y9udqudSAwQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(66476007)(66556008)(1076003)(26005)(6512007)(52116002)(6666004)(107886003)(66946007)(6486002)(508600001)(2906002)(5660300002)(4326008)(8936002)(6506007)(36756003)(54906003)(186003)(956004)(38350700002)(8676002)(110136005)(2616005)(83380400001)(38100700002)(316002)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +UwAT/DgvvVPd/ZyKNO5kehfmfzzTrFbjrBmqpGGxTrfE9lyPcSiimTsSCfp1xKAAj4LZ58C5jW/aOPg3cKAAlB6ZsWwO9Tp7xdvX+IUFrwS+RKNof6gK6EQ6vrXrPaI15SnaiKV9U4dCal9rQN/+zEuJMArZxHAawLkbDBLsE7S5ONoo26IeOqGoNLNgy+eU6W+00AWhRe6R7ZBOSlEQABOVMlkuHf6t0L4LT+6M8ltsjHA9LPOiUglr2SUlgtDGiaU2jyHngeOZC1BDgZProdH7prVKbEBl2Q7xPMjdMhLbeFYB/kAZzQznQ3kQ2KMqDwKFpDmbD1zlKyc5I2Av3nZgYEYYrCnhpx4NcvGPb6Ixsocp9iouenx8tasZVZ24Hake/JeEZ6rpn5n/XhYw2uSc2dnk323G5OjRCB33G7il+0PPhNwxXuuSQ921T1nXUVhdkqJxSP9+FCd9NgRZdHf14sj2MFjrROrZ7OZQ/zMFA2FKwsNyrcQEsPt1cEa16BdMLBWuDNGIZm3amr7sVpDRtY+ep6eYIRNebhWjIOt6rWFp/wi+jWK2dekDwSNr25i7VN+LDmiNzEd+P0GSYmRGytnRnb8COPQKIxEy8sywwSY8jss4xluODLx3Gj35J2DfWd8tttr1XX6BZbTHe3DDgCZRvAhTJwKJnljFEM4K9v3DSUgbvO3ZEzIXK6fz58syD+rFGKKm2k+4mHg5shHbS/lZ1y1EiwumFTo+Hj4kamHWtiPJOzk6dCFT6fEy1RITwls6KlEeQ9NV5MTXLoe1Sh3PlzTQaOUCVn6MmSJ7TvoDcf1yII08kt+TL0216Y5ruHFch6yW2zXIBSRSmjKvSlXBZbHVqvYupcVA19XMX5JJWSe+IR4EZd2mh9tHxhqxEf4H0YiXZ1XRBr0jgtorjQouy/gfR1WkXlXHvrxBuLuafF7YDZluIHrVwAtzKxZWMPLKFWGjNSjq0Uwst8RVn2/uidxlTObNCirM6bCFUz9sswvvb+vO7BQHfb5TZ/I7co0L5hTSNByyjcA9cwIxDc7iLXzNXVhfkQ12eLVRMcN75QtQ3JLwcWzVkrF4/747lHxzIGMAq1TmazL9OvDO0r78bC9zGlElXTYLFGXInG4j0/ovmfUOJJKalNKGZM4eGFFs/sDgBSMykJTWVjkHWbEb0t8b4A8ozeosoBw4GFqNx6y3Y65JjDf40CGXFXWwliONK2I8jS8AwBaVdbwvuaiyUMyLytxmNcQ85ZduRkIGjx0PZKToodPKhl1jZKM5KLY+X9hPaQxpY5IB8QIOYV1rOA6q7MG1PuKnAX02b+pBnTVM9eqRyHnCRC4SR7sToSQkT2vb+X+9fe/FVEIlPaFp8dpdMt93mW6qv3PlPFMz8SMuPFkLw0n31YoV4HTdkmC3ZfVn/nMCKx7cLwvxyN76zpFH+Crn3vJxLzrQ26o5T4EPHwky8dhwhMaRqdufT44KHVUCDkLf4JovQ2+NWyFbzbDY/DpkIR6WoWk2BNEaFG/B1Y+8bop5/rPVRGovZizLGOxtBLbxLbDPWwOeZiaeKB+OCJ6wazRQ3EJXnMSvOx4pohFL63MezFf+gepvtCATtvwOqR/acuxNMAfj5qT/EjNRM7Pcn/fnPg= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f81253fa-b5de-4680-07b3-08d9ba5584fa X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:51.6656 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JguPyqeVH0W4h8p0CtKeKL+zjVgimdc5kI4HxaDspndnmtYPRW/3Lg/ITjnY3abnlfBHsWy0c4uxGmnUzgpadA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5568 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add new device generic parameter to determine the size of the asynchronous control events EQ. For example, to reduce event EQ size to 64, execute: $ devlink dev param set pci/0000:06:00.0 \ name event_eq_size value 64 cmode driverinit $ devlink dev reload pci/0000:06:00.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh --- Documentation/networking/devlink/devlink-params.rst | 3 +++ include/net/devlink.h | 4 ++++ net/core/devlink.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst index cd9342305a13..0eddee6e66f3 100644 --- a/Documentation/networking/devlink/devlink-params.rst +++ b/Documentation/networking/devlink/devlink-params.rst @@ -132,3 +132,6 @@ own name. * - ``io_eq_size`` - u16 - Control the size of I/O completion EQs. + * - ``event_eq_size`` + - u16 + - Control the size of asynchronous control events EQ. diff --git a/include/net/devlink.h b/include/net/devlink.h index b5f4acd0e0cd..8d5349d2fb68 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -460,6 +460,7 @@ enum devlink_param_generic_id { DEVLINK_PARAM_GENERIC_ID_ENABLE_VNET, DEVLINK_PARAM_GENERIC_ID_ENABLE_IWARP, DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, + DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE, /* add new param generic ids above here*/ __DEVLINK_PARAM_GENERIC_ID_MAX, @@ -515,6 +516,9 @@ enum devlink_param_generic_id { #define DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_NAME "io_eq_size" #define DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_TYPE DEVLINK_PARAM_TYPE_U32 +#define DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_NAME "event_eq_size" +#define DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_TYPE DEVLINK_PARAM_TYPE_U32 + #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ { \ .id = DEVLINK_PARAM_GENERIC_ID_##_id, \ diff --git a/net/core/devlink.c b/net/core/devlink.c index 0d4e63d11585..d9f3c994e704 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4471,6 +4471,11 @@ static const struct devlink_param devlink_param_generic[] = { .name = DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_NAME, .type = DEVLINK_PARAM_GENERIC_IO_EQ_SIZE_TYPE, }, + { + .id = DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE, + .name = DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_NAME, + .type = DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_TYPE, + }, }; static int devlink_param_generic_verify(const struct devlink_param *param) From patchwork Wed Dec 8 14:17:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664489 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10DBDC433FE for ; Wed, 8 Dec 2021 14:18:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235042AbhLHOVc (ORCPT ); Wed, 8 Dec 2021 09:21:32 -0500 Received: from mail-bn8nam12on2078.outbound.protection.outlook.com ([40.107.237.78]:55328 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235019AbhLHOV1 (ORCPT ); Wed, 8 Dec 2021 09:21:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ya2UzbeeJtIvGbvJF+1qT+msG1OyzjzF5fPGe/ssD8vickohXvrLnu1EpcU75oaK5RCiX9vuRq4jVyn7w5SdX9qRSbphRzJ+YpMR3OjuRPa8a4SNTLIbe74JI1wea6eKRZ+2zvB82JwOPeLx6IAo8PklqqNzjuKdY7rjr8dlRkmzdK6T02KhqQVi+VBRB+NugwRCe2VoLa8rBioPTnHjmBLp//de0HuHnxQrkjwfmebbI0pWEkzUUqrMm8rRueSeWYmoOHG3bxMOITOqfKk7RMOwZJhowgBZ6alYpEMmvh8fDJ3nqKs6cEMCUJ8Or9RRSju07vNN2Mcenpus235kRA== 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=fU+NT6CNaZnpCVz0VZC3APGBXUm+bP1MJtJDlVfCEeg=; b=d8sqZfHajoBavFYLjTzioo5VsjJwXL1xjDrO2pbPJ/A8DChCm6wSE5l/h85/3L79epH/w6C5A8x3TVQaLVGWk5NiGIMk5BPHg8bhbL7DJQXb1WqQBxkdOCfv/EEZG0xddaWqWExyih8+rcSgTNCXwqOPxVDSjSirLXRuIRiYmYD4+KhgZ3DxGxL4fKxD3OuVsi35N4iwvh8x+71UepLs43Pk+oFXJvWj9+T06RGYhon97/3idQWI6+2+uXuCYkJvO8dnHEiYkjdtRm0WsJblaE/oh9WUds7HhFcc4lx6uKcoQifiDZYj8qSX8xrriqVcuMKeOSTVi6JC0LoL7bBGcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=fU+NT6CNaZnpCVz0VZC3APGBXUm+bP1MJtJDlVfCEeg=; b=bmvesXGRD6lVCqhu+m8nJH526hZ+tNfzmDJP2Ff7NciQAJiJ5aLJsPBr7jrFwGsHgSsoVvsvEXSyat3CNDB+8oJ6gtvDNXe18NOUNyyiU5MF1IXjwakn7PcqTGZ/pdhiDLEYvgdLiPGYUs4mgqPPFfLgeIBya+3njuZcGJ1+n50IaQpHe6xyS9JR/46UKRYqnxM90OvJQqzYWjlCYXmvli/xyurBgizsuZb0bQoDvwn1JJd0+6Xvao4m/OSaxR5MvdM7ySz6AGE0Ks7GMIbOPe1swMOF1JzB5gL2mkxjN/6czGoJ6CQfrfJYtrLyqII42/dg9Nuk14Kn060wBEEeeA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM4PR12MB5117.namprd12.prod.outlook.com (2603:10b6:5:390::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Wed, 8 Dec 2021 14:17:54 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:54 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory , Moshe Shemesh Subject: [PATCH net-next v3 5/7] net/mlx5: Let user configure event_eq_size param Date: Wed, 8 Dec 2021 16:17:20 +0200 Message-Id: <20211208141722.13646-6-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32a70bd1-8863-4eac-f716-08d9ba55864c X-MS-TrafficTypeDiagnostic: DM4PR12MB5117:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ywS/FuntE9sq5dffwjzxCRKZZ49/6hJ6V/Vfy7ZGJV6Z/btVeFbXydQPdgoTD660bp6Cg6NRJvAwnaWF4VzWJuRyHcmGVLv1jufx+e4Fq2CPI8tbtqsKx5VVKCSmOS/BaGADjqkOX4/9a8uoQwnR2TrXWdrrus5HAeuR4IlGoGz2woED9vMdIzMgZOOqfM9BFlTNFU7VNowqfZHV/9bUYPgWdwE4MM/Drk9vPGRwcJ8kmXGZd06ZBYMd/gcrtH/kppG4AfxS72Sx672cRtRe7EYzEVC2bRhlgkgY8oDYYLB83Gy64lc14YgxjMpmghJq2ePuAbJySXCRDs8cJ51fQxqOYNU70nmNnnKYY3oUhiU6CMU9j/OMdOZngHRKsFrGrP8f9X1rYvj+pKV82b4J1ZtLJOgLZtBqGy4u6y30LscPCBLeljfIChaQoJONBD8rt4MrXWfyGbd67KRoXjj3XVrMyO+XpXzHb3twWRfdQK78wzhK2GFyH4IVlUiBnNRNXDuMlwsWoPqdmtFFsmcu/qjOwYl66UrRRPnFgH/LbiDtQ5LXAUOaWW3bUj4T+dHGsfoA5jMXLWIpJJ6YiBfeT1NGZruK6mvSlElDxLelH5ahgJc6cwdmeGy+S9yfgRVhAeCHBJHU+/ut4ajTpGeZuaa+/o22EH/6iHOo23WoDzXaW4l1QaKIIwt1bOoC2jx9Zhppz1W6z3EgJOmK9sLzvg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(5660300002)(316002)(83380400001)(52116002)(4326008)(107886003)(86362001)(54906003)(6486002)(110136005)(6506007)(26005)(66946007)(66476007)(66556008)(6666004)(186003)(36756003)(8676002)(6512007)(8936002)(508600001)(1076003)(2906002)(2616005)(956004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q+WJYBBHXUEi51JDjGbshdtaQLGFRewEVZtNMcDDn8WoyCdNJI4I4XiqZhPVoF5VcJtqf/zMdctml6EwCgHSAkXN/mqaD1+Gb/vtFytjmrbBDNJIzGDsBdjRb16sbgZhNaLyA12zcjZk8jPSMgt2Fk28qoj3AyJ6UX30/KSB46Mbl7Ryc0v8keijqs5D/WYuAnSEbN9H5i2jWI1yeNVnd3XesUbyS6hYL3VqXttEt7FcuSskq3UmBMNCFGS9tH5qKw4hOCMYeiDqeo9HSr9Q64Fdv9LzcxQ8sVvYzdamPEWFtThoQkyZJo6o2v89/NTl9GxMPrs6pN2z2njJQbZ87zKzKFSyqicHHacuWoEXIaZH9Te7swNDEQ/tRz/FGPVxl05Is4TEpKOCtrlvMWtxIG9k38rq5i0jYI7xcOaE/kkImP/TqeO+ewhfYvhX12gOTKViU5gg7BEYiydzZ9XWiRdILrvHsIthpL+K8rlB57mDWzNsNjFzeYoa/b1s2msKCOi0oSF+cqZXiolQRs7nzLJkXYPcc79QgQTVwub9nFHGWzj7EYcWah0/7gy35LOjPODBg3TPDLDMTczpDwPgNBQ2DhRvXInXmD9fH609eEF/yIjIoXIBzoU9gt8wwusm74TxE5rlRI4uLFVqd/bumSiafXb+uO8Qn6tRQcW+HI8M2u+xusiI0ApOfpjCyPTXz2501m1md+IDEgbye5DtqHe0xdgztrNPTme2grnL7M+GqyvU2vw9wTI7GwrZ2ARUryvsa5JCA3ztknympGLxPGfeeLJBlfaXZ/P9SIat5XjiQDoy8ynSKJ8JnnyhwJEeCoppZ96cmrvln7ozYsdWk1E+svue8xQYgh+B73DTQr1ssamCCksh7xgGdCAppYp2G8RSNERv3QcGcLaB3QsO5pn4Vh3FRGP3aZBCPhTx/EidGfCQZlGCtHLumLHymDNSv/afntgV3xVWcnEnE/2yNhvHF+C4nWCjcRrzybHrdC3V1FOEhH6dKLSORfhYkFnHqn/S6dY2IzhNDPGvEHxrK5SVILG0CGj3oE8QXd0yOI47a0ZfVwoGCaMHoobCG7Mf7cWK+QLmduRraXFiGMpq2DL6PiYuHviR65BX6W1A7Abpk2uVCh4WxJaeeL+CPSP91ITDpzs1sYrw7/ZlUHYkraScYblV1PjuhnsS46U8UYYGdhE0WUEZRhzTGhrJ0y0fWFH8g3v/YPW0Xp4KVeiCUP4VwRURh3voBsJYSzK5kxsd7Az9H3gQOUjV8bRfwcylfQJg74RPid6ldcCRU59YSU/PBAZG9rAMze6HLwHFpSkxH/IIOHDwZs6NO6bfbBvcjib83Cvmf+JPy1OtNmleJvn0dlFNQHyLLtTUXStglXfau5Cex+Q1ZX7Cc0UaEiOLDdQFRpHblEdFHGRGxbAVyfH7yl5Hlo9ITUaVfh0azVgvLUf5Kia8MDn+FDiJQQlWEoigqH9/BW1bzAsxftkf+zlqrsyWvOZTtj3AU6xlL9rY1ILkucbD+ob9P8emCSQ7J/4DJBnjUk5BOlaq2nwcBroV7l5RKhAwAK4vZ0mF9+PbLQ8YEmG58ppwF2ckIcfMFyBHJ+CBehwP6LFhSmCpkE3Fu+kXq+misq4grjZWrgA= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32a70bd1-8863-4eac-f716-08d9ba55864c X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:53.9436 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wZBX2oqGG4Jt/6CpAabgP5obgmAsFZb+jKZBBxGy0+bqVIkAkmkbtWtqcJ6ZpUt7IKOxH0wg26w3FM0//aFOew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5117 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Event EQ is an EQ which received the notification of almost all the events generated by the NIC. Currently, each event EQ is taking 512KB of memory. This size is not needed in most use cases, and is critical with large scale. Hence, allow user to configure the size of the event EQ. For example to reduce event EQ size to 64, execute:: $ devlink dev param set pci/0000:00:0b.0 name event_eq_size value 64 \ cmode driverinit $ devlink dev reload pci/0000:00:0b.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh --- Documentation/networking/devlink/mlx5.rst | 3 +++ .../net/ethernet/mellanox/mlx5/core/devlink.c | 7 +++++++ drivers/net/ethernet/mellanox/mlx5/core/eq.c | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/devlink/mlx5.rst b/Documentation/networking/devlink/mlx5.rst index 291e7f63af73..38089f0aefcf 100644 --- a/Documentation/networking/devlink/mlx5.rst +++ b/Documentation/networking/devlink/mlx5.rst @@ -20,6 +20,9 @@ Parameters * - ``io_eq_size`` - driverinit - The range is between 64 and 4096. + * - ``event_eq_size`` + - driverinit + - The range is between 64 and 4096. The ``mlx5`` driver also implements the following driver-specific parameters. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index 177c6e9159f8..37b7600c5545 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -579,6 +579,8 @@ static const struct devlink_param mlx5_devlink_params[] = { mlx5_devlink_enable_remote_dev_reset_set, NULL), DEVLINK_PARAM_GENERIC(IO_EQ_SIZE, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), NULL, NULL, mlx5_devlink_eq_depth_validate), + DEVLINK_PARAM_GENERIC(EVENT_EQ_SIZE, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), + NULL, NULL, mlx5_devlink_eq_depth_validate), }; static void mlx5_devlink_set_params_init_values(struct devlink *devlink) @@ -622,6 +624,11 @@ static void mlx5_devlink_set_params_init_values(struct devlink *devlink) devlink_param_driverinit_value_set(devlink, DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, value); + + value.vu32 = MLX5_NUM_ASYNC_EQE; + devlink_param_driverinit_value_set(devlink, + DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE, + value); } static const struct devlink_param enable_eth_param = diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 7686d7c9c824..b695aad71ee1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -623,6 +623,20 @@ static void cleanup_async_eq(struct mlx5_core_dev *dev, name, err); } +static u16 async_eq_depth_devlink_param_get(struct mlx5_core_dev *dev) +{ + struct devlink *devlink = priv_to_devlink(dev); + union devlink_param_value val; + int err; + + err = devlink_param_driverinit_value_get(devlink, + DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE, + &val); + if (!err) + return val.vu32; + mlx5_core_dbg(dev, "Failed to get param. using default. err = %d\n", err); + return MLX5_NUM_ASYNC_EQE; +} static int create_async_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = dev->priv.eq_table; @@ -647,7 +661,7 @@ static int create_async_eqs(struct mlx5_core_dev *dev) param = (struct mlx5_eq_param) { .irq_index = MLX5_IRQ_EQ_CTRL, - .nent = MLX5_NUM_ASYNC_EQE, + .nent = async_eq_depth_devlink_param_get(dev), }; gather_async_events_mask(dev, param.mask); From patchwork Wed Dec 8 14:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664491 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E68CC433F5 for ; Wed, 8 Dec 2021 14:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235014AbhLHOVo (ORCPT ); Wed, 8 Dec 2021 09:21:44 -0500 Received: from mail-dm6nam12on2063.outbound.protection.outlook.com ([40.107.243.63]:3361 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235061AbhLHOVb (ORCPT ); Wed, 8 Dec 2021 09:21:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F17f7j5HQVqX/h9DuMvFepaSpIGvzIbWWF0w029Hi8jnhmrFSW21T4GGVtuMPV4rz4FgabXwc7Wn+CrTenrs+7Fw+Yp8CzD4QSlvrPDJf4Ex/FKmtMJeigaiIW+acC6fa46aFYpNqgAbO2rM6exqVQGaiKF/3EVBowK0Yp29PtztZMcA2gzqbdbB/pFpUQzxUjYO+ji0ArmjIzW7PSjavFbtRoBC4XfgpIJKO6j5u52QuHwTt6gn5d0R2/m3gS4Gf2rbwUuTGmHLR77CVgg5z4b8Eupzztpxc1ZPk684rgOh6I91a/BAgbqx4YP0WDX18wKO0j6xub/H8q7lB61QbA== 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=1LSE8cjKCVgUDXkmMRZbIiGt3SQSFpFkZLawUh3kQdc=; b=b1jNhtYrIEsHghzos0UHHzEjtuq2CYdaSSLYFLjvBYoLLZTGXaROUgaT3wde/cALNFjQ7oPFvqJjrwgAkI+PX6hWvJ+tWYvPSBH2jkFTwbWeiyTVvbhqm0aw9BrXtyzgsiJ63Epdy7JXr4iYDxd+sKd+7hRV2g6DifF33NPWWe+kwxZ4WUVzxOYJ35gr+idX+pplCho5xsTpien/HjLfyQgpC69GO1z9YB2KstFj560rDZK5SNgMYllmAkbETdtEempK4/aPvPMY3Ey7hekVrQdB69y3xvbfqo9jxFci0Hw5NTXKwQfUzlVdUfOsK15JZXk1mx9SKE5Q80Qf5KXIsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=1LSE8cjKCVgUDXkmMRZbIiGt3SQSFpFkZLawUh3kQdc=; b=X1tTFdgsN42m8hTWcdA5mwoWZ4sdrxGvGdapkL/XPJol8v9jp8ar6zXTG+q5xULJ84j10quAWKp8mLvUYd5f7dnw4aQU1eihO84ntWRkzRQcfhNH099djg+iZBrU7Gm2ALrkFn0ePcOaWWtKUwyjJ7gu+aSuwbBMMDokLUDpdQLQnjORh/PVN70YT/ca3/sel+qFYJOT2odqrsWMRxDGJvTsU+iyhY8uZjJSUQAC9Or46Pg86oNzdiX/hLddS6n5Pvri0GgnSnUgWlGe3ob97QcMrApefZ18Va2H2g7hjErmge3D4hD52dnzcTLlzYzdbnf2h7T4nQWiEbNtu1FhLA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM6PR12MB5568.namprd12.prod.outlook.com (2603:10b6:5:20c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Wed, 8 Dec 2021 14:17:56 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:56 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory Subject: [PATCH net-next v3 6/7] devlink: Clarifies max_macs generic devlink param Date: Wed, 8 Dec 2021 16:17:21 +0200 Message-Id: <20211208141722.13646-7-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39b04edc-5f1d-44d9-335b-08d9ba558788 X-MS-TrafficTypeDiagnostic: DM6PR12MB5568:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: owztJhh9UKfYTPXaAF/gVvsoQyawcIgK00wBGAg4jgWTmV0B1+MwTZhxPjH3OQNB+xG16Sf57/5CfwjIc8cnauhvepX8vcdp/qOQLqo1ia/ARro4v61CGA7W1QaCnAaePonhpxYOFr5JM17FnyT18DV3XGr3uOazAlY7c/YPLYfbSNM8j/T6yS+lQKmlD2DCbnTgZqEBfLtjTxwFf+xz4hQ4jKqE/Dm54b/tgy+g9iuKCKIVcd6nXa6p/KihS/vG2fq2PtJvKpKc2PsYcKIC5hQLlmCk4ytmOmFuf5evuuApTu2mhR8SXxYdx0Tjm/kM1MTHfP0ZtcYBTef4TimUObd7wtOUI2oZ6qMTYscuS3cTQbsQJ3CHiDHb3Cek8g6sFcSjRvZaoScRVLhm6D572lT6JiKYhSzMvBwFCzKS5ahXRFOZ/lnxX8Vh54Nxjha3OfZt1lkXahusctvxJASJoyfB9esp04pg0kGBBmE5OIirIMUuzvXGyDwweEBIVSQhbo3cr3UTUwk7m6G/uouLqrcJZu56r6xtM8wZgk+AogkrwiXS2FeZY14CIRcHfquOWvKftRodfJEpaIQuBjCNVDTmD27Nvsr6LMiX0PyJigYG6VQURKDlNcc/N8b5Ur1ACmfK+3gcsSrhajJ4Lv2466P+uNJKztmFJVd2efK7t8Sr60i89Mal+TtwgJe7vJc/un4rY3Zx08A0x8Tt8YS+J0jckblvtNTy3+LuXU+sRg4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(66476007)(66556008)(1076003)(26005)(6512007)(52116002)(6666004)(107886003)(66946007)(6486002)(508600001)(2906002)(5660300002)(4326008)(8936002)(6506007)(36756003)(186003)(956004)(38350700002)(8676002)(110136005)(2616005)(83380400001)(38100700002)(316002)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OTywo5120e8jptQZStttY2AtkkXSIuZGTGFIVeOQMSGYbaezhpCGcRd0vPO/xIlhiyqUjFqSzR/VVqoo5PUYnkJ36dq0Ezg030AATRIeTMXWyXzFxX1SFZa4pNgE3R6I4MSl0Id1t+Pq2vCnNvNUpGXYm/Y6FOgRjUoHvD0vUMKwq6KOZNULWu8DtSOpt1M5olDSc9QXn5VQJc1jc3WNHrEwjgkTuGg2C/q+DA2ELaO/vUUGxoRsXfv47h2dTWxD/MvvedBHlDuSg9vgQynfPdLZbFoRvm0E2afMxB6YozMya7fSGpOKI7A8wU+Jf9GsplOresnhp2i/NDS1/UHXUm25pRLellS79MxjKqoqdXJwPMIvLCyQRBpYWPGDFcAqSknIR+eSSNY2WZE9SynDwxa/xPWPkzVEXATeFHIcinCGiUoGJVKCqtyTQsm39Yv3qP8v/2gI/aT6FjmAmX1uiE5n45drTTpT3tZdWyblpYen+Evv9kBV5uMBLGkNjT2VVTOL+NlHVwlx5v0KthAp/gJpQqHGQZh6OEUFcn+73YtNlN5/98QbB1ZlfnxUXzLTR9L9ojSuiFQSfF7dt4zlkO4+DttCu+l71c0/WEBPttLkV83vLy3iIlLetR/RmyK0QJQdLEdDaCiW5FalyXgCCVDBwNdGFD0OQZll7YKYNBC47WwVEMX0uwpQp7ugc/9TN1Et70BT70nqlprLPJs5g0U2CrIyWI1bLg6aeedyN71M/eQCNUxvRYYrzGuvE4oOPFPQsu/vkweznOQzTQQ4sm2pA+uJoHHpeHEt3fX2RC/Ni7nVdBsCdEa0TVLiPuxuktgYtFHpdaZIN5IiyjaTmuE2inZTf49nRRex/TGx4lJ+NUvPBab5MULwxn4u/LURyAx4kxqiCiHiTIApxGqRU4S7ccneNpyGSEz2nJwODZZVPL8PtAKc5vwyOuuFS/nXnKa/qu8lJCdn6UTBiU+G3D0lqqo2pRRfMpCKtzvDfqcfk6uw+B6knzryam2zKSRTX4IZJ6bSTRK26MMalWvlR9SJBG9SAbd8aHt5dAB21Yhk1wCmEzNDqhRFZujXW48bk3aJaM3XUxnDkvdZgvPE34TD39hMGS90cY0gVnPCo5R1EeEvnpXtRy47OPxknvmtlQoKvhUVpXZJ6OrRfIXcgPOjDkN1QscGJ5Lu6XPCuBavGGrrVcL8V36efnDWIcq3wDXSKQsBX2kxBC5/iRBXNhITpZX1XWKVGmIZnBQDmug1cT0woxhbvKkVau0GYPijqmirUoaMfP3bTjhEW8hOBnIqmWOue79Ss0BG67pCp/G5Elq4PoG7uu2O5YUL8cPn0cQ9ci/dwmFwhZKWETBSaYpxvKYRjVIMNMMMBqyhqEtl2FTPaAW6Ln/033BVKWBqPUBzcBDE9lOkFoHLgotZ4eIUDQ+n1Nnp1EwdZlQF/oVwCjoNg41yhDKBZOGvxa7PV127zGc1Y/46kxlL/sZxNngAXtombJ3rPIupbwGDo8uZaJjTV+RNLfe8PI8b4ynOf3JlUH74Y+RuztjABNUBVGxwrAqhRF4IK+PD5199momC6cN7rykbKo8yGVwZeM0iguA7TfgApovLN3ClmIJ+vbjr05nwHRBvrCbP0hrrU80= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39b04edc-5f1d-44d9-335b-08d9ba558788 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:56.1250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hrJU5mhQ0KN9hprYBC5OAt9evq02mT/6GafUYE7Ydd1jKsZW2G319/rA4VX06osuX+qgkq0y/CGeGz/NMGwfBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5568 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The generic param max_macs documentation isn't clear. Replace it with a more descriptive documentation Signed-off-by: Shay Drory Reviewed-by: Jiri Pirko --- Documentation/networking/devlink/devlink-params.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst index 0eddee6e66f3..2cbdce4e6a1f 100644 --- a/Documentation/networking/devlink/devlink-params.rst +++ b/Documentation/networking/devlink/devlink-params.rst @@ -118,8 +118,10 @@ own name. errors. * - ``max_macs`` - u32 - - Specifies the maximum number of MAC addresses per ethernet port of - this device. + - Typically macvlan, vlan net devices mac are also programmed in their + parent netdevice's Function rx filter. This parameter limit the + maximum number of unicast mac address filters to receive traffic from + per ethernet port of this device. * - ``region_snapshot_enable`` - Boolean - Enable capture of ``devlink-region`` snapshots. From patchwork Wed Dec 8 14:17:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12664493 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DF3BC433EF for ; Wed, 8 Dec 2021 14:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235110AbhLHOV6 (ORCPT ); Wed, 8 Dec 2021 09:21:58 -0500 Received: from mail-dm6nam12on2063.outbound.protection.outlook.com ([40.107.243.63]:3361 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235154AbhLHOVo (ORCPT ); Wed, 8 Dec 2021 09:21:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2HqXSVPYYZK4TPExI+M1D4iFsMxG/FBk6TTpO7lvCiNAShyzkbLf2KBkwYqeX/sjRrxGOm9N24XC6/EkMDixu8zZsDe8KHA/dq/iAMOFFPcs41f6M4wG5yOc3KNhOZVd0N90L1rjI9kXYqVHHPx40OSX+rKj2d2g3Sh0SEUlGx5eJT7SFyxYgC6IbS/rggt/dFvYPZME1ApJyAxbOe0N4cKOibf6Eof3DUM0gK+AHNGP84sHT1vAw5uYljdxt2m/zFZnkt+zN8lXmJLNcDj8kbvdm05Phxu6XHCMpbfych6HFsldLj+s2BxzNcQmaIUfRvNdIwADslKFOvnxRkfVw== 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=c8d0TGroU7tkaElytOMwuSVvj7oxDRdutempO4+6cGY=; b=CJdkcWVLbOo4PCiGK68xq5lW3iImaAdpWgGNowYeAy/6LrVmkvmZ8CT0R80auXJ1aCYK1dAV34UgFxfQ6J923K0e14xArcQvBTCuSE1kfSPLIbrnTYRJ+Iu5xZEvXs9eeRo/Qbfz2JzQMV7D+ordFsZGe8TfEx+taUUd8fBFg82KpreYMlB6Dj34Jzd17qs3g6iX0317GKwxc9wDaN23xU6DNB4Q1HRh0gjBrdhMVvOOH5t1uki33seJMFIZ+oF2KwTdlxxhBHPv2ZpcQA7kJELtG7vZHsITx5fVJS/aVdz6tKbllxBgbQYNFjUAFxPIHp0cvxUeUg+4Eanm/SqVuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=c8d0TGroU7tkaElytOMwuSVvj7oxDRdutempO4+6cGY=; b=ut5xY7P4tOV2XbCfB/aWXEL18vDSyhVLb7Am0ZYcBQGgMoBX2m+Qt/b1LaviJMQEh0gwspbYWxsEqpD36Ji0hHDfa4iv3FggnS7oL6vgLnm8ZEV45O1irUkN9HSQB/uiJntdaQpzQEozktst6wt6TAbGhdipCQ8j0Q9+bw9TaCBSr3NAU4GTkayr10289BqPIBlX9mtYarUKtAezEO0hBljfSOuA85kO1XilmIOFSuXAtwzRM8pOQjlo56ymiOe0PNeuNjMeuSWvjHzEJXrnGVcEOIXIZWLikd3Eu5ftmivoV8LT1d+2DmdB63mESrFayxsFwlpnoj7ViyAFoiH3Lg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM6PR12MB5568.namprd12.prod.outlook.com (2603:10b6:5:20c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Wed, 8 Dec 2021 14:17:58 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::10d0:8c16:3110:f8ac%7]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 14:17:58 +0000 From: Shay Drory To: "David S . Miller" , Jakub Kicinski Cc: jiri@nvidia.com, saeedm@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shay Drory , Moshe Shemesh , Parav Pandit Subject: [PATCH net-next v3 7/7] net/mlx5: Let user configure max_macs generic param Date: Wed, 8 Dec 2021 16:17:22 +0200 Message-Id: <20211208141722.13646-8-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211208141722.13646-1-shayd@nvidia.com> References: <20211208141722.13646-1-shayd@nvidia.com> X-ClientProxiedBy: AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) To DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) MIME-Version: 1.0 Received: from nps-server-23.mtl.labs.mlnx (94.188.199.18) by AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Wed, 8 Dec 2021 14:17:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80a01573-d14a-48ec-f0cf-08d9ba55890e X-MS-TrafficTypeDiagnostic: DM6PR12MB5568:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AJxR9I14HzjYmucE2NaSqqUfNnazZ2NUSqKuBiSt0vUVskS6h5atC4qYwZfaPf/gZrem273a8BtVKswND1Hxe3SMIm7z34kp0TXSmo/e32lZ8EcDCUYlfAQcRdjjHtA8QugWn9MrxSWxqG7JiYRJ+rhYe2rB2+2oLm+Gvl7JteYweiRJnEUbnR5ygDF5H1PCpCCHd8j5X/SCbUaABvsbSmXRRacH/7uzN2po7s/OZjVlTtC9Ng8fZaDNDKtlWngrM+jTMHlxS/6yEGzDxoBGW1uBmhlDnFKCtR/gpY1MScUZvdOaNxVcy5OCuTvph3Dmrn8MhNgQncAEa9cp169Sk3p+zAvnWtvNVzLKmFFiaPObROVN40QA1hBP0RIx7XJuPCqAsUWmI2BuZoiLwna9bNdaz9P5fK+b2iQdmcmY/pPERxsEolWf6otIUMxA+LVeKEOHeCw0IezcF0IEVFHaKjW6TBTLGJEnrYN5uY1Gg+cYoKrkY3jJUZur1FrCiTUQJq43Vi7xs5TeTEHjFe8UnMN9jORhVhcgmZlrABcMxeF5fJEC/xECYdKXgbgCjzLQ/tceKr1g4KWCoyZ7WAuVxyouKcW/LdEUkJO9UV5dHFmR4R8NVSss7p2mF3Rq+HJ/lmXhj3fXIupMU0pUT7d/cdRYz+lMlciVliNjmMn58lI3hZBMfg1bEFVAQvwyVFRoeRoaHRmdHKxmSNoZnrHizcAY4O4DdiAEgM06h0FP0uM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(66476007)(66556008)(1076003)(26005)(6512007)(52116002)(6666004)(107886003)(66946007)(6486002)(508600001)(2906002)(5660300002)(4326008)(8936002)(6506007)(36756003)(54906003)(186003)(956004)(38350700002)(8676002)(110136005)(2616005)(83380400001)(38100700002)(316002)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: X1R71b6gNuOFxy4SF08zMSGqfN/U0VSL4bDvYLVLSosBmYPO15odHjCdGBgYjwd8CdyQv+52XmoqQanxZHHC6TAg4T4LHyn7IgaCBUfx7bkRIqykJyS18J3MHjsPVO5VVp/PMywTKPzquVigGfQbbOlutqghSDlO0Ps+blldDPHIGCsU25mYONIzCQq2KgPTi/VwzNbNxVumHWz1Z/w7kRZ7G9Z1X8OvycxEV7uD3srw0mGBwqPmtUoQHikgcMl1miEhT51j6IZjJSjJj9FIBU2nZxBzrd6kXtchXg6nx+dvM5Mvwq765JslCtKCTpkV+b4I2pzCMo6gwW2sVS8MLdGnKsna/xqLMg7oe3Ax9Mll1r3AGunK2tI34M0xiX1hh+Rh+LKVqfIuURX/f8351cmyLrPxQbClRKxBxTGl1FhcYW9LkejZ/zjmOAz2/T1ktibxoPFEHBrEinSgGEsxQk9cjIZXCzCtN5wykpmInfHruD3zeR7Nrx0jeTQkKLn0mggQcHuNHpbyeqNTfGBaulY892Q3EWBbU0PMpInFRzWIDbTbGQIzn6Zdaa16Bfr1x2PyS/JSqC4uBDdjpN6LEbkH96SsSos5Pjc/+CM6sMd6VUItza/IakR/PeAwRYPwxmUgwckRbCTtezxHUhRF3EDIShhGBoV5DrfNHs2UwUXLanhQYTnLZy7xPK+D4pc44nxV2jiv92fpTKQY4tK6/cTFcbNMEYFr6zLceMEf4cCDK+8Fnmdfl+N2qwzC2lZcLi5ipdAVoqUmaE4ZhNJljsxTCSOL6GXM+75x3hu6VP4+S55yCbqul0LjSKD4VCqUTrWja+Bcp5MnZpHOBBd/WWlbh7FW/k9kRG4IC/O++0kQq5J7khynTS8hQLd/XKQe0jMUrUAA3XeMpedXGE7ukd67ck5UVVVMEJakbyNErSgsTQQuYXgnLeyY6nGe4T+Gf0W6XrM4wxfSySkTo8zZrpB//6BuZdCEOAKshzt7FDAWM3w1GbIM/ykXOXzXAbupdz972oEVnqeYhXYvMrvDs6AQuXP3dSqgwtiiNuI9VZ2/U7X0cEr7Z6pchheqUEf/ssjxaJHHEY7HiJZmZNJp/gDA/CFyFnVu8H3DsbfwbVW+r4pkurpNTLjS7Nt/DfGazsb+ZYmLM43QSyldSgDWh+7OkRdYZcGX08wRbPUqNhSmXh7mHcOQvVoq6sqE8N2rUGF3bE/Z7VvSxvLMuw+bC4k3NCOY1qx2LuSUnSdurVNp/YdK3R8iHgIP6vGRlXN+A9j1nJcGznLkX3SfyqQvmPRoHucjl6GMBkla+XIhTJ2rA4qcXgm/RCsAwaYysuf6zRaWlDmalSPQJ3V0cw+3ASSJzfE/pCCGxwi/pLrYQZUXuf0Qc7A3wUZjIZ+n6hy92DyjymaqukjR7j/ixGA7FxfBvEox7Dn7bNb3T1dSRMTsn8aLcZg7eyB4SoigFGMbpo7O9DhpinYvH48nr3jWswQNC9HOd/SBraVUbPS/6XNWZsf2yt7OaQckxVzu767aHYW/OXo366zJhic94y9nzsfpz+CyQCDw5K1yVNe3LS4mxuJ/6uJY32ZgJn5ywf1IJmVTWO2Lk0/3JrFQgspl64lufhLymunzW0ObHRJHH+A= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80a01573-d14a-48ec-f0cf-08d9ba55890e X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2021 14:17:58.6041 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pUnjnUg5tJixRJ7Qxh/n+sDVgvo83UDmY31jvVA+uwz8LoRwuzEZB1KSE+Z7IcBTPDvSjP9mVxf5CNNjx34Rdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5568 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently, max_macs is taking 70Kbytes of memory per function. This size is not needed in all use cases, and is critical with large scale. Hence, allow user to configure the number of max_macs. For example, to reduce the number of max_macs to 1, execute:: $ devlink dev param set pci/0000:00:0b.0 name max_macs value 1 \ cmode driverinit $ devlink dev reload pci/0000:00:0b.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Parav Pandit --- Documentation/networking/devlink/mlx5.rst | 3 + .../net/ethernet/mellanox/mlx5/core/devlink.c | 67 +++++++++++++++++++ .../net/ethernet/mellanox/mlx5/core/main.c | 21 ++++++ 3 files changed, 91 insertions(+) diff --git a/Documentation/networking/devlink/mlx5.rst b/Documentation/networking/devlink/mlx5.rst index 38089f0aefcf..38e94ed65936 100644 --- a/Documentation/networking/devlink/mlx5.rst +++ b/Documentation/networking/devlink/mlx5.rst @@ -23,6 +23,9 @@ Parameters * - ``event_eq_size`` - driverinit - The range is between 64 and 4096. + * - ``max_macs`` + - driverinit + - The range is between 1 and 2^31. Only power of 2 values are supported. The ``mlx5`` driver also implements the following driver-specific parameters. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index 37b7600c5545..d1093bb2d436 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -773,6 +773,66 @@ static void mlx5_devlink_auxdev_params_unregister(struct devlink *devlink) mlx5_devlink_eth_param_unregister(devlink); } +static int mlx5_devlink_max_uc_list_validate(struct devlink *devlink, u32 id, + union devlink_param_value val, + struct netlink_ext_ack *extack) +{ + struct mlx5_core_dev *dev = devlink_priv(devlink); + + if (val.vu32 == 0) { + NL_SET_ERR_MSG_MOD(extack, "max_macs value must be greater than 0"); + return -EINVAL; + } + + if (!is_power_of_2(val.vu32)) { + NL_SET_ERR_MSG_MOD(extack, "Only power of 2 values are supported for max_macs"); + return -EINVAL; + } + + if (ilog2(val.vu32) > + MLX5_CAP_GEN_MAX(dev, log_max_current_uc_list)) { + NL_SET_ERR_MSG_MOD(extack, "max_macs value is out of the supported range"); + return -EINVAL; + } + + return 0; +} + +static const struct devlink_param max_uc_list_param = + DEVLINK_PARAM_GENERIC(MAX_MACS, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), + NULL, NULL, mlx5_devlink_max_uc_list_validate); + +static int mlx5_devlink_max_uc_list_param_register(struct devlink *devlink) +{ + struct mlx5_core_dev *dev = devlink_priv(devlink); + union devlink_param_value value; + int err; + + if (!MLX5_CAP_GEN_MAX(dev, log_max_current_uc_list_wr_supported)) + return 0; + + err = devlink_param_register(devlink, &max_uc_list_param); + if (err) + return err; + + value.vu32 = 1 << MLX5_CAP_GEN(dev, log_max_current_uc_list); + devlink_param_driverinit_value_set(devlink, + DEVLINK_PARAM_GENERIC_ID_MAX_MACS, + value); + return 0; +} + +static void +mlx5_devlink_max_uc_list_param_unregister(struct devlink *devlink) +{ + struct mlx5_core_dev *dev = devlink_priv(devlink); + + if (!MLX5_CAP_GEN_MAX(dev, log_max_current_uc_list_wr_supported)) + return; + + devlink_param_unregister(devlink, &max_uc_list_param); +} + #define MLX5_TRAP_DROP(_id, _group_id) \ DEVLINK_TRAP_GENERIC(DROP, DROP, _id, \ DEVLINK_TRAP_GROUP_GENERIC_ID_##_group_id, \ @@ -832,6 +892,10 @@ int mlx5_devlink_register(struct devlink *devlink) if (err) goto auxdev_reg_err; + err = mlx5_devlink_max_uc_list_param_register(devlink); + if (err) + goto max_uc_list_err; + err = mlx5_devlink_traps_register(devlink); if (err) goto traps_reg_err; @@ -842,6 +906,8 @@ int mlx5_devlink_register(struct devlink *devlink) return 0; traps_reg_err: + mlx5_devlink_max_uc_list_param_unregister(devlink); +max_uc_list_err: mlx5_devlink_auxdev_params_unregister(devlink); auxdev_reg_err: devlink_params_unregister(devlink, mlx5_devlink_params, @@ -852,6 +918,7 @@ int mlx5_devlink_register(struct devlink *devlink) void mlx5_devlink_unregister(struct devlink *devlink) { mlx5_devlink_traps_unregister(devlink); + mlx5_devlink_max_uc_list_param_unregister(devlink); mlx5_devlink_auxdev_params_unregister(devlink); devlink_params_unregister(devlink, mlx5_devlink_params, ARRAY_SIZE(mlx5_devlink_params)); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index d97c9e86d7b3..b1a82226623c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -484,10 +484,26 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev, void *set_ctx) return set_caps(dev, set_ctx, MLX5_SET_HCA_CAP_OP_MOD_ODP); } +static int max_uc_list_get_devlink_param(struct mlx5_core_dev *dev) +{ + struct devlink *devlink = priv_to_devlink(dev); + union devlink_param_value val; + int err; + + err = devlink_param_driverinit_value_get(devlink, + DEVLINK_PARAM_GENERIC_ID_MAX_MACS, + &val); + if (!err) + return val.vu32; + mlx5_core_dbg(dev, "Failed to get param. err = %d\n", err); + return err; +} + static int handle_hca_cap(struct mlx5_core_dev *dev, void *set_ctx) { struct mlx5_profile *prof = &dev->profile; void *set_hca_cap; + int max_uc_list; int err; err = mlx5_core_get_caps(dev, MLX5_CAP_GENERAL); @@ -561,6 +577,11 @@ static int handle_hca_cap(struct mlx5_core_dev *dev, void *set_ctx) if (MLX5_CAP_GEN(dev, roce_rw_supported)) MLX5_SET(cmd_hca_cap, set_hca_cap, roce, mlx5_is_roce_init_enabled(dev)); + max_uc_list = max_uc_list_get_devlink_param(dev); + if (max_uc_list > 0) + MLX5_SET(cmd_hca_cap, set_hca_cap, log_max_current_uc_list, + ilog2(max_uc_list)); + return set_caps(dev, set_ctx, MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE); }