From patchwork Thu Dec 9 10:09:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666281 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 ABF7AC433EF for ; Thu, 9 Dec 2021 10:09:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233196AbhLIKNa (ORCPT ); Thu, 9 Dec 2021 05:13:30 -0500 Received: from mail-dm6nam10on2081.outbound.protection.outlook.com ([40.107.93.81]:9145 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233194AbhLIKN3 (ORCPT ); Thu, 9 Dec 2021 05:13:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rk8A15IDRgdBuiyVQq3GRKGVWy+HSiMLCnj62SYNlOcuHTgkcVDZTz5GohHvYkV1X4B8Ssqm9CrMrMTmb95pPxHrCnjPy88yvR4nUUjNa7xdtDxCEr9gz+cqq47zCMIX11Qu6DruK13qoaYfHkr8Xzy/d3hX6/a0BjaYoQj3yfN9Q360NdvycLYyPPSRAxRIveE6lBYeK26tH1bZCbLk5Yiwc/D+TEqIOsf+q3gzs4xZuZFU6TL2sJHhhsixTGaMrxZrHzPjNQFoJFtprBk/FvsEoRonsG0Hgs72eC2KcKc6KEo986Oi7HkOosAiWxqO/0jCUIGkjJe80Zqntn5Ktg== 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=nKS/4vZ921ipRDmqT0zW2yUWqanJC6iR6PrFRxcy++XRt/wXD+uGcLow6euq2WYnL4p7dSVhl/HNDE62PEYGkJ7/cJMJOy4oyE05cbs7zwhi/2QoG5R9KITB4laUt4XXgqLTaWjURJ849ZbGs2BXTELVleNUvSuRe8xkl587+RebybEc305Unzvt2aNX8IMGJSBM7sLjDFscyBUfXT+Uf3ma6N6uGrJSEMrraqLBd9Aj/+EW03YnaVpZ1Mm0XlEyVEuD6GgZpRs4Tiia+51gnLgUyNeSXa815Stld9eohIeK6lTj11dTuq9GiqgxV44h/bNbmsXQgUzH6KrFgTPvKw== 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=V6+MqDuTAPYWg2Su6Y+f8jgheGQM7U4XOqGEPK645CcKBYQrFlXmfl9vSVsjPQFaKLjJ2Ml0HHulc+g62RzS+Ku6SC9SfqAB0eU20SYnsgC/yBH/bSiy50coYpbuyMO+CHcbcknRjQ+S5u9fWNROcPso3bpaDTAs8IAy+gnpjz94O/VqDCmdkC65pH3AF7qauaH76wrq6DZfwl99E8uU3CKluwKjRdia92lku6IjsxUER6zJMTZqq5rHjrN72/Q2MpacYtOvrKdeJ4WPm6we+xc2I20CM6rTJsCdE17Vxztyz8bEopgPjwcHq94SQyVvQIomUL+C9/GWJWtZmZiXuw== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:09:55 +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; Thu, 9 Dec 2021 10:09:55 +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 v4 1/7] net/mlx5: Introduce log_max_current_uc_list_wr_supported bit Date: Thu, 9 Dec 2021 12:09:23 +0200 Message-Id: <20211209100929.28115-2-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:09:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdb1a576-303c-4aca-ab9e-08d9bafc0c5a X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: WSNwn8EPV1SKXsnQK3MQ/iO4IeSBqCRk6MJRo13IKpMEPWepHYwnz4oPpPeMO7p2yt5bDeOHaCSXbTphqnazzicL2yOk0dRwJTiRwcEqmKbeID8HJQxKfREHT0HIXfv9w8BhqtnD7BIb8mWTbyjrQbqrj9c8h3cKbIThrFWj39kW/EcH7QaMlsKKdDPJkiDKYSG4GbSLioKShpoikOxsd5xqOgMQ6LvQkSpesGiHKuZxA68pJdpMkxAkRtWoQtbCvL6Mrt0FlGQAp82JFVhSGI27P5vIW2EyuQsHRmWWq9na3dFA+AlKNWUS+dFXMG1UhmvSqZUg0/IB4OG1FgNOrTe/aQOwJE+PICkWhLsIQ12ivwmv8VHH9RIQnMqRpdOf/C9OtVxMcZjiGeC1lJ27XqglCZopLA8cnitoN/D7EhaPjf9vO1xDHlb4uwnDtlNTXm3EksAjeUgL9VLPtEXNXcdZQ6YSJKzsLZ42Ks8W6/newL7nis5LwSLx725XdNyxL14/yswcpdgrgKgqVeVV8txgILz1dFvPyTHrOf29mNMewL4+Fs7CMvzrZmaeAim1AOsWan08dSIr4wq4Y9CKYlIOG4RAM75f116ZpGo5LcRRtaoZ4g5AJ7AP77J8OFPb0qHibu0zmBQT+zjtzrnQbkSFtxzsJr6b6m1yHryo6ewFcrg7OuDwhlaE13g64GTI88527oD384ZhhO/qvrclYg== 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(4744005)(316002)(8936002)(54906003)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ABKJtSI9h08/AqEhF9yTZxco295nqgwcgpogfj/7/Ms6A64b6SgZlMEPJH+57+xv0ckmWNN/fHLzMRzElOJct+kI2gFq8lhsqT3Oeg2miAr6F9FtkSZJ1y2YhawFDNex7G3ytTspabapkgz13HK/zVqFqr5kggBFoNYnpacrRBaT/FTBY73kzOsQ6uz+5+tyUeJoYJFTiJaySeFq/42N3bfMwqqMb065Y2l8BAg5yu4+aikWQLgj/Zl+jBflxHzwy/Knqg92RyvHuR/O2soUUIqAT/+ROl6zoD8vgsoPE4GmYD8GdEFE5j9NzkIWHzZnnwkQ8gMlN81+Z8H+AWaQf3g1ng0QWk6abX/O16u3KHzpyS9O2bPIh0eU+6bfOygKgHFARcIfs65YDfWlcrjwEyiXZH0UwgNvXSUCNHlJfVduVzY12w1llyYC+cZLNUdjuFFzQbF2iEY6YhocTpbnCggLhZi45lbrKTes5CH5ilUKyRs+MwoE3v7DloA58KNSu+BUIm0tg4lnyWpC5PkRjnRkQ+X/J0en8BUreek2zGyhHV9g216Gxh4WzJquDYUHIohZbyVB7G5+6kPJ2VW7RqyEfcL8g0IM7sgd1lxmQN3fa7/KdVlZQ49ob6MzBRhfS+gzN9ESA7HJ6VNrTXq73F7W8nQk/qO/n+qEBpLesols1xPO/45M3mAc7roII+kWVk7dciz/jZlY6ZfniDzl7wvUx4UYyJCoHIgobOPpcAj3NWfTKjdZgCQKdBk2GS3pt+iuXuSk+fl+7di76w2DySPjn+18NgbidhFRJd36ekqIBQUk58U23JVe2nY8bhqyyPIKN5YhVtzxFZzOOss7PV++F+V8lH4AvkaxL82P19ysyJ+obP6jYHG0E8yih2MC6ls9AT7ftQe6m5g3cBFZxGpkI13DPpyswOpP/ebp5du9lkDX5elCnVgxSaba2tsWo3OR0vrD2DdquRJDVukqtmtRtFxTPtTDH1zUvNDova+m2cI2yJ0UwFGgC/rROqZVLxZfPeqL31GEqEizD7/ooOQb/+h+NnAH5dWMnKQARfBGPfa6+WahHE0KSVo7mzBdsWItJko8d5XeL4apTdcnUJd2TnLHW8RR8/7wRfjKG3fz5voGZtRQFO1j4X4IXSc8IQUCj2T7WVhTMN5QJC+2tLjtzbYWv7llfTBqLzJvubSd9ydKRJNfdbEZ7A2zksSr9G4AnKTki/vy2hWbqY+ChCKqGv5Jm3nT+bbS8BUFfTcXNRQ9KZfjcHFO/TNfNwUIrENaD2bW0Uq1LXD3JTiCx4ng7WtTdzglO0KGp3nqGau7VzgTOB+AgLy7ZZm9pvHw/WB+Fmgaqozg8B5K3+oCa9EpROQl0uABk0udsZ38q3YFL4Jk6AcStd3PCqzDWZh0Tipv989xgjFpry/2iJcVy/OKGmR6FiY7NT5w8c6RziGVXuzhm55HvQlEUkY+FS7HMVleBr42wI1FmW8mMVkbmxUUwKWaLweqiYC3fEg05MKC+MKoc7KALAinb04DOEJhlDwso8EEBkmdFO094bnpwc08v4vbkWTTIa8FJ+ByOc98UIrBjOKbfUUHs3QJWjusbr4d22Ln8AXNLxLe3fwYy30uAK6uVGrwtUzUw7kTG54= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdb1a576-303c-4aca-ab9e-08d9bafc0c5a X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:09:55.4077 (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: QgAv/+tVsJNXpwpO9g25XEZHAZoVA2COsShReFIN40kwHxgMT7uUvjqu3IpQmgCDRolqJHQVV8vB2IR7BhkEKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 Thu Dec 9 10:09:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666283 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 5D35CC433EF for ; Thu, 9 Dec 2021 10:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233452AbhLIKNf (ORCPT ); Thu, 9 Dec 2021 05:13:35 -0500 Received: from mail-dm6nam10on2079.outbound.protection.outlook.com ([40.107.93.79]:64193 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233309AbhLIKNb (ORCPT ); Thu, 9 Dec 2021 05:13:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lw+jn5A05Q+MbjtPmHPVEk4lzuLHBZLCLGAiazPIvoPiHFR6etmL8+XoiAalgvgX21MO0mlOiTWcSKPAmTtzNrdMtEoZ2DKOHfsUqAKqVWVLEZfGAIid4TrpUozP+vGIWrc4A/i/+L72cMmYle/1uJpI+KlMZdh8ONOXCzVRxDAna7j+U2KhJwLXAOc1RzR8Zd9/BgGSSkvTLwG6Axzh9Jg88tdvW3koEgV3OQtHCNCsJp9qIAo/QbnCDRC3rDNhsMA9MbamIvjCdJjwrgciSQ1QQmJoTwMNf6ckbAvDHFUs+UvgGM4XnVgKj7jWlR/Lf5O0kibFnS+CYTRcEo2RhA== 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=EfLRM5MdjIvJYbsA2o1YUXIGui7mM+kVozGeuUV29+w=; b=GH+3wj/hy59sdokCtDbB2rFyOflklR+4qII3qpTlWNsV6Z4BNC8gH/NDvdoZD6PGaThoenpU0I/nF2b1Z78BTiP6Y7vUjcO2SlKj8BCuuPZzdHhCiW8A6DeRlRYKtwleXCzYXrFvh4HD4Q3JDVh5fDbJ0wz+1o5/miX7KnqA9wk3OEblKk/vNP1SJI6sZVBayEVR79pfkKV+Ladj4rJ3bs+17N8YgqMqB1Mf+iTBgmQDBGLS8D1rJmwJx8hUsoA0mysL8B/YpvVlcrO8/AOlKdHuprUBhsC1WMQ+nIPgLP59uM8Wt+jxQ+zkBOEQwniCQShDofsNPbuwvRgAu2+VGQ== 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=EfLRM5MdjIvJYbsA2o1YUXIGui7mM+kVozGeuUV29+w=; b=MvDFRlUUT6tye/MYgU7IH65j3QtWHubwU5p2jQ4B1HnQlKWo9XJ8GHDBCMP1xb2/Az4orpyonnIfuFYdokrdb7MD+nQKNMFYiuWYBDWjhss3ODlWP/dPM8c6J3LaIAJX4BMuyV0S8IfwzHpm3cJv0oHeUrXBntM2Fh/ntR4PnLQ17bn6tmb+03OD2gbMtBdQ9q3i3xXlFWHElaLGCiReS2MdnP9IjzakYzmLFl8nzAmZQyo2Vi8GZm4DM4wVXvPz89YsZhu6/HxDmON/jEZguWjfSdQqMOccfZU/YfM4XAE6S8VSegdcF7tvCajX1cbpX4cc05o3OO8lehcxHqWDXw== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:09:57 +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; Thu, 9 Dec 2021 10:09:57 +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 v4 2/7] devlink: Add new "io_eq_size" generic device param Date: Thu, 9 Dec 2021 12:09:24 +0200 Message-Id: <20211209100929.28115-3-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:09:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 412cdcca-8be2-41ad-204b-08d9bafc0dbb X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: jh5oRg2i8KZ7eQpZm2GhIW3kfZ3oRD71H4SW16BZ13y5LTg4SiyjyQPH58tPAb6+otDmZ2DuPXDtbncIjhjbCTgylsiyMX6+/dgQLSjF+xiCrNPEnzmxJmhLac3UqdgL2QGrmT1sDB3grKWgkSlV2v2VqRp0ZJAk02+6vkJfSjHl6sogrRh981+DhjOW8i4YCZ09z/OzcCrvfx+/6izv4zYME4B/arcm6k4HMgvyarmF7lBDVH8+vyn4NIo/wSv/Mp5rAtOzDkpH1okvuUoC6QPEcyhnxrPWiQu3dSGwryKCIucMs23QAtpjWHooa5qWn6PBplPgphmaK/prxnHlcY63i7ETIThOKh/v9Uw3M0hIFaFZK0bDV0kbnbTd76bVcqp+fXlhNJJOCAHhq5I2bWNpV1MmhuDa0RHajjLx9bL1kl2nmCIFGz9pWYD4cTYBuHRPxTbb5OSkFBa0woBfkn1p8NBJh1SfUzyGR8YhDtNvncXGxEN+q5q0cZObGquq7G2es7rWhsBxx5ulO4knjiY/FfRbWAHXUi5IhTebs9Jf7zKCbeEnB65baDpPqRRUP3fFN1wljHg6/1FtvXbgklcl+YsCKs0ma9LP+4PY5+fIRu1U20WcOnq1b6RgLqYM6ADdqrFAJe2eiaFF7McDmeYlD0TumS/HhFq8YUB13neFzaFwaB45DSacOFGtGJNw9UeUnYtZEPEjw4buQASJfKhGU132oxf0OZCfgC9ucy4= 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(316002)(8936002)(54906003)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rC4qUpuZFyhXFn9Pw3B1B+aCiivcbatFzmY8G3olJDEmJkywDwLthsYJCxX8sCrdglwCbTmOEVU3SJeLAcHmat2BBYICMSf5AHMIYVBe6yX0jAi0j1Bz4TA4NBJiD0ci7ukGGdXHFCFkC83tJCNyKesLGlx9nhTFZPSLauRd7ZsE3vlRE+BrZ6VaUYqi0YOwl1e67RrskcAof6J7eqixhsgUfCrdnY6M3naZzUS6FPtVUgYrRiLrKHKPhAqAzkSfYrY9Jl3R+NTvIbQ0iEkr3cExo39pzmN8RNTnlTlwbRbnf4onnv++8TrHKoVyt86x8j0cNFqJTqwNT4w0PMZZpQ5TSvfVFrFLfK8BM3D/NIscmnfDRMCYXoZKkS4sa2zgtKbToREi89Hz+eF1F5daHNlN4uxBx5wt6eLcxCDy8sRBF5WwRFt59BJEd8oO2G1GOBwMWtU0yLu3nwD4Vski8zmYR1Lb2EWFAcOEk3papjT2crbA/MzVh2xjdaYIZDQczLJbrp/Kz9emDkRykmpFPx3EU9sGPE3mBs3uOeQzVXX+G/EvzznWBZNdoU3gRKlqT1fof3u3V21DHzhPci41AyuwQ+3aX3rkgEV8FpzJQh5beamXQoDeDYNRmyjnbsr5Grv+j9S4L1XeE3CRq8WX+3Y3ings3fzhZVBHVmQv28qaTDzK+NCrv3IDjSA8gK8OSlf9vI6F0ewAI59WKwtcsxJlZTGQHRMC5zTHUuD08jzhX95sBDn3JL9/sV2kqW21t40pLnMkLC+iwOXNQXX4ZuKKsnmncFCs3kYxBGC1lQEiKLiDlakQZDD7MHeqLtDdvA/OoV1JowkB1Lk32T5Q2AEC/jS/KI3QzYGLQ9zd/Kw7LSnkgHpz3yNDS/8RE7EqdMTEENM5EDP/BmlUwKyGOgOGBP1bEpgie2rEVLcJI/mZ3iEqHFUQfkNQAMqRFQZvtafcELqkgOsh8woYIR/LkYeEsWDjf+Xfm9CKzJ9iNQyeT1JTW3BcXB1uO+QNrICKMHseQAwPimIoWyxNxALvEtfCqIJKg3BWcmpgVpRfQulvFH6tiaZEWEJrH9teVpiAQadtl+MHvzFmQkAUHTY2qtA3BuCg9hFWrQXqfDrNj69mlY+to1nJNEyHkxIq9mc2Omcw2bp3KaLOZ8sSfny5MIenncv1es0r8wpriVROSzzlcedGFjuk9Hx8r1WKtlGtz5ROPFHmVIXiImudoWXSdtjplm/DxC7CTjTUFeHGPFDPo0cjKWG5MH7FpePZbSsQHfp6LTT2WnWWm7IfwcFYnkaJGFb7qDhmF/ThwPGa8buVOX0ZnkGkPS9anDZ9OX1xmtPShMp/jjOqh0ZHePbywKofJLwAeeZ/1Bqu9AJ9Ss4BS7x1+sSMtSULmNj9lvFMpi2GtXGQiWf9CCqb3RfPv4/VcZyiF5fga3nDozkOO6zP6p9LLnIkEpwoG0CndtQer+kBfTZ7cqDdKO4JRWvZiDMRdQQG1ZZZ1uPSai/SS8m6jnP1X10Bb0ztnft4MlegGYVr06tb808lkAFIIZEg+waSHkv2UvMnbMe0srcgttBlA0aQlLcI4J3ORYGvgg3iU4LhHrpWMOFn76o/WbGHkTVXKJL52LyPJwDPu0xWNRc= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 412cdcca-8be2-41ad-204b-08d9bafc0dbb X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:09:57.6808 (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: VytJVOTjHE0elYocKfthCURk0Bti+UJCNocnBsUKdgYzd9rluc+if0KUz85YsJAZjkvkg4EBFxAWBKWugsMwuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 Reviewed-by: Jiri Pirko --- 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..547c0b430c9e 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`` + - u32 + - 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 Thu Dec 9 10:09:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666285 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 02A13C433F5 for ; Thu, 9 Dec 2021 10:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233508AbhLIKNk (ORCPT ); Thu, 9 Dec 2021 05:13:40 -0500 Received: from mail-bn8nam11on2070.outbound.protection.outlook.com ([40.107.236.70]:2973 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233438AbhLIKNg (ORCPT ); Thu, 9 Dec 2021 05:13:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVxGdEprVMllX1NG+DRWbPrFHSnV+Q87TrDQT19NZ2hZzZpuiLlQj+6a4Ji+uGSBjHg+R26nXOoVLKxYi5gJOyuKzyunmq8QtQz/yvPAPDjBggx9BR7w2SZ+5ATJxHiXGYMBqOiH8rJ1KRFJhYWaqU/U0i4AEcFUtkNcdqsj/LON4tOPzZ9tzDUTFa2HcihoaHahGj4SUdxQqe3ZmEQz+C29BcriNhYCaq8HTRrnf1BxGBcjYyXAGUCducMwygB4WoGNwgpv8YE6IMeTCVWZTTvdkcT24Jwgmlv2tpl/A9iP05Hj31IoE1TvReySMFhdTLpZqUgOuFefqomgI6DYmg== 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=iIqCCf2oo3uHhUekqaSC/L1fWSG4LqPAm91x6qlVb+YTT0JgbVBjOSySRwVqWyLEIcmSZ0aRWW+E8hTJ1AMwwLsP+EYTLbaxiLDv4oF1YlvehOFEcxFkR3SKPVOcw2rmYuzZsK5sMYObu+kUtbVB8V7bmyp6MEHKj/KUOOVFvxsHSMQVXCxp8moBBhDz+qMWDGJPrSQ8kX8KmItNyVa9pRcWham1cjIID2jrgopT5SACTGLntPrO+qFbR6zmlBA+yKA03ekbYaanjCJYMvhh2E0nRT3YS2PT3mTNLonVoydhQ0lOZuFfs74jigrgDBAMqneO3edWZle24AQRkva8Sw== 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=TT3zL7sZDIvm+5fQIkjv1+RFKs5U6ePAqnFmOCXeKZ2/VH9QPahFu60fw/6QvWGbVFLE6JKUtqrFsWudJdESxbn3qHvcbNMpDofCZUnr1+sEzqNeNCg0DO7au16fxcPpgUGFPjV70vofoMtvkquUjulN2BXBqCcDyh1NyofcKC2Ki5bbbrvYtlmw0M4kTTL753M6z1awmq0+lBqPQLiObZnp1iWGOOQmG6FFLHBZnJxZpnYsDTxF3havZe4ozXIKFNuQSwCfkTNudHzBCtbnbEzo5aEwWvXBxfGMGfs7ka3c8CMi6aOIjSM0gxEIs8PxxIONeEFjQxRdDuSyebMbuA== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:10:00 +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; Thu, 9 Dec 2021 10:10:00 +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 v4 3/7] net/mlx5: Let user configure io_eq_size param Date: Thu, 9 Dec 2021 12:09:25 +0200 Message-Id: <20211209100929.28115-4-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:09:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15eccf68-c18f-4a24-39e9-08d9bafc0f13 X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: J7Cb9C8U/Mjatkq0XKiQG54ndr+iGHtgXwSJJqMwO0ebWECCgVtlTCTbzF7QFFG2MZeVvXy1CvIyNR8X2qxGYAXb0uDTh3oI28BJEkvilZXd5UT5KqYBciAEhvIaS6/iIBDwPX5xHocS0TXwAqfsUvqsBvB+eAMNqfdUg2ddiDyfNleM/UIH1uxEnOdIQ3ONp6t3qG58giFc6LGFia6Xp1sRO8rmdfBLuKBjlo/WuifYvWLDHoKsqiuMkoDPAcyOXno39pT5uhvlqbSzKNYZh5imH0i1r4B4UfBQuHZjEY5q+UM4dY75W9cM5EPDtxpxpTG7zXzjiQ5vQiZNcYS8C7Yt52vgHdDkSb9mOx6SrMfRjMmN79UOD5NhQ0bhmi1LwQcGYT9ROX/AVImiGx67C2jAghw9tMi2t+uDKrqKLUaKuBk1lYLbZMHOtqco0MuhvChUbOYe0Kf6wjAUaoQXcJu8Js4fex8AQXkf7Q344HG9SLxeKWO2yP8FIcRYwLyfrGLhOQSjAOA/1MY/lCNj1I9QRqpcFBIExH83NACMbCJXDIecu1wFssrUjxxDfex6HizxPawEv9GBYfbJjsXrKE9qRRSXUhEaUSpwFcvHYEInmMy8ZJ+pNUS8RJSS60PoMNLI7Lfj99cbd9yiVsVG0oBJWQnn1zDZR5MtPAbCGaEPyNrItTRtMy2k8T7t+N3LsN1abprU0Lx7c2iIzqzQow== 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(316002)(8936002)(54906003)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gq5yVg+eMzBdbbBqVzOZjCNF9x+0D9mqPSV5pinmZWiumeCjAso5HZjWFmYc8tzn2WTWt5zmiw81xlM0U8gzS1TJQb3lACNKe0YZK0yQEAIORXg1IvyPcu+ti+dXQl3zIlacOY+96+oozgcGgVlXjD+uLwfqNXoScXsSwtrsdNCWta2bvN2a8edko9B9TFniEQSByClZ2w2nkOt5f0muTLJpniIpYxVIjLjzKdq9H/g4yxofQvJxVj6AILlmP7pP62xQb+Bfc2Y9R7eilt6sPo/CqWCTPnSMrELG0rY32YHt1ZlAkorv2nLKbYM6KVx/3Dk+zIYYxO7XdpxWs20KPcbVXn49hiUS5tcWUBD/5ZeVnBV1TsO3dzvbwENyevDdZdgQMyULgu4bIbA3T9VfF3T58tdhN3p1hZE2mlJo3msnzYCVycg4M353rQul3pLE3jRbXj4GH5z120GBqg2Kc3LZvDW2L7GKjnOVnZWtSipjbUnTKua93zvd4sH3O22U4CvCEY9jc+k0y6Vm/bIHPYyoo4hGLVkF8OJUzsao38uwOln+cPVF13sUT3Mt/qF/l4hNROCWeC+9acpmNtno7p/fhDRO8G/i3/T2h5JPadN8W/kNmTovVBAL2pIjU7oUxFBetOipf+1zwCZsgNm2AtlkjcLPVFDgLdACOE+5aSYQzEQ/0yid+i9uJMlnJqy93GUeMkC0XV+Ithv2AJxBUnxHQvKLq1wjXpJA97hB3UNtg3eaoY5hiHxLWIgtY/C5huaIJaTTYjqM1bXLvBL3z2N8ebzt8f16c/zdBdojDq4Z+tSptmEE5YjokEPrGMCDPPISNr4Skf8fO5X1EbkPEPXj5pNOjFt3dzvABUSBqj7t/5DbwiNyJRqMjcC8mAQhC337dq2NfI4N88AWFFgdAXAnb+WXusNqQOwpKZAOr2MbxdaywuM+v7AuxYxss/2q1oYx5A7TzyW9hmGrA3fwpWPxxUsjoJfKvDuZtmrM9TzICS2HqK5CLwzRbPjLo3eVEK4flH/lGntI/9NAiZxEkh1F1STFt0ZON9tBCs8Xy6TJJT/+ZtP0ufBslCp6az56MCyFWtEJ9KaUKBRIV1uCRUAopGkBd/lWrwL5WcWZ5NMZFi7EJYX04zgtNNOW+eIAGu7EvI2pQYU902ROvQNM8tHrg5cGK7U5s72PreHKb8SNgI+9mHV612g0MWMW274E7DXtHCM63HBBdB9FHqXKAeqW8snigJjLezSqol30+A3UmjJ2fXAW4QEyHVXUWLfgpoOU2eaj5im+pznXXi1HfyyfS0/vRMs56nDP7jI/itaQqMMpnoe/r+WBwx0N8lr0FD9eaU9UzW/ddTJLbwgUh53X9pn/gc1OlmUle0GqcbtsfW2S1Pe1D0bxDT0QGbVQ6ZsBcUHuI5NbSptzJMq0FLwff7LBcpH/zNL7bZrmdmVSoPHtpZkgvuwS9z8iOTPG07diCI87L/zDM81t/8rDmDgRQQVWKdt2/4Sg3kWZKV99WiPf19tjUc+JfNYqOHwtXBk4gjjabXKLg5rq9f6co8F4aIjzoTyRMdFPWI8avEKYCvNbnIxIqmVMgGftXd3VBZsqZK38G6c9fS6qf4whBCaJC7GhE1O/yq41FLkFdvs= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15eccf68-c18f-4a24-39e9-08d9bafc0f13 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:09:59.8861 (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: ufed+p2OORwFwUNFkcgwJ29MpwTIYMqPWCyWg4dr+UsvaLrZp1V3gwtV6bfhu9I7TfG/iUqwprxuiYiy1xsZzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 Thu Dec 9 10:09:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666287 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 5A6E7C433EF for ; Thu, 9 Dec 2021 10:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbhLIKNm (ORCPT ); Thu, 9 Dec 2021 05:13:42 -0500 Received: from mail-bn8nam11on2070.outbound.protection.outlook.com ([40.107.236.70]:2973 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233411AbhLIKNj (ORCPT ); Thu, 9 Dec 2021 05:13:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PesFbvErJE62Z55kQ/MnGlir2fZG9+bYoiZ3HVj0/ASM/BKuE9zzmAwIciJMyXxTlJMeyGV8Twe4Are9sxx4m2fd7qQDbHMfX6AMo2e4iWVhNCwvH4s3wGGv1YMXqY5NR0SXLyQzvK7g6gCrooBRbcpUNd3ZVGnFwDHzegb4ulXmaeuZ+syZrYBXn++CQ3mmWadgOn/s1jt3dy8bCkZ7dwttC28AlHDlmrnXMt8sNmMJTQz6yaPe3VUuF9inUVxYshKh8YcvmNGs/5JangL/3V8gP4KUyo+aPPISuO0sLeLzPwPe5I1oG8HahmlwsiSIUb/GDKh4nfCWpq8El5Db6A== 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=w0V32gMh5k4hgcyDR1IeLLzIaLRympZJveubgaOjqY0=; b=avUq+VIP/Xdu9gVO4iV+Tezt4sAduUVywi6ARfl7X4pqH4VCqg6Q/OuWc0Z5skMrL6KsWgWcyERaheSCylV7JsLlbszTP3fGK8SBSpQlkLI5164bE8RTHpfNIgQdXhGTB6inCm8fV7OGykYE9W/1dKguUtqOYSRc2Y4zxyrizGUwUYK6S7xCgl3UCYnp2Ow4QG2czQZjJyuIS7YxaqcwekK+UzvbpInVnZD/RTWuT/mlWn2zLxHocAWNuyndsD6Jemv99GvsByLlhLyNOiC3Vcy4FiClthUuWFsl2LtoH10l3DzF1uEZSh8id5L20yS6UuhlXBgZ4wq8ZOYP9VvNbg== 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=w0V32gMh5k4hgcyDR1IeLLzIaLRympZJveubgaOjqY0=; b=oQJfAglq39swDlhSBoB8F+pkpoHSH/FGboSajCVUG2+YWa8RjQr+s8C3owTOgT9R0rz7liIHcPapJiVgfesJNk5J3OJ93jom39Kc//1ts3DBKfCs4JTzBoyMfS9bURuXudLz2UQlHP6NCgtFfsSplXD7KZ9/a4NGNvczD60z6y3N55teu3DvNFnehhfWkN9BcIVVExHuwq5gZwtxN6BXxUhQ5jKfZa+rEREdua9jXKa9YelIlAQswteYaEGbGe0vDCObE2QOqli30Xj+W3mV0iSDQA41/+KgA3CNvaGvfvHXymhgdikIiGYinRwd8YYtgrYbXM9TjWtYcKGw6w4M2Q== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:10:02 +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; Thu, 9 Dec 2021 10:10:02 +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 v4 4/7] devlink: Add new "event_eq_size" generic device param Date: Thu, 9 Dec 2021 12:09:26 +0200 Message-Id: <20211209100929.28115-5-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:10:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dac5f934-e2b4-477e-a7c1-08d9bafc1069 X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: I4UgetTK7K1V6xj9f6sB0EYzxQhJHSocHNQrs+XnTGE2SCDwPYlaE7vQzJAktHyhxvZVUBeYEAgQpNEU20bzH0nJ8rtdwyQ3K1ZkakokH/ofxrUGpB9Hrt3NcAd+RhFtCA5F8qwMBWbsaev6UIN0BjqlrzfBHMuHTcbFmjSIusP7IB0wgwsRMWzBi+pO4xIWSlV+21p7HKOM5M91TWrea2pwT24U2r5OaHzBpsRdXNE6CmwZh7BkYK10xgp4sYdSt3g/LS0MFoJHcx0tq6ETqOv+VFXnt6GDPZTgDCoxYQothOg6ANEBual9E1yESDOp1gduapU+uqCyx9jXmPF4dww21s+iH8lBYPch0jGcPi5BaolhNmuafUxQ3DdcL+ocuo2WNj2mbJYu65XYKAiZT7RBQnKaykJVikYG7+Dutlkg7qBzGQA6d/429v/6tlaA/tip7Y41+1J9udYTgAzdTvBCdYQ+TPJqd2AjMVM+8BaPxmglSgwBSu8Oj/oKVcrORZdRgPIFj3fyLac/t7nAxRA8uo288SLoFg0xmn7sT5NC6HEJGRUWnhoHXBoEosP90n/2+ldBEZ6wvpGRrQMDfoMdLGTKoec3c7m6vTCK7FL5sC9S3tTEZP6P0huqdJ+s6RJvtthMionWG8stMCPDkRbfVvLt/jMcxNaBImsLmJ1MzASsKlcLVayCMUQl9pTd7LER4ysQcLcF2fjSnDcQlWDqlrmMiAbHWz8omFa7w3s= 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(316002)(8936002)(54906003)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +8MUh6JkXDc0DmR9Say8O+NBqmxVSaqm8tW77Q6ufKCDvbxgW13CxGoCq0W3whMbe2Z8FUjuLqchTtpPcNNmUx4VeTm8+e/5jfuf9eKG/M9HQql3x8m5FTXz+dI9nl4m/laMK9Fsu3urq9UF6C5L7FxfxqAVnvCXdl+GQDt8Ap1/D6g8BY8ryDI8gU6tfGZ54ibgbVQnphcyQguzTMGcaiR50Mlnaz5PDii8ERgoMkE1A5tTJ1rcFVx3pjXHb8wqaLymIes09OmKB9T0qVuzPO8MMuoP05/rFmJe+qyYGsEO2YlPyCVKLfKODmwVnvaMzI3XcowzdgPXVr3i/6XAJrXWfNosDRfk62eyMOKwVP2ot0PsnWrrrzUBXFJM6Nn5lUC6MoI/7l4jE3i4+SfoHCK14ABPF8t5rj+5n7TnLzG1v8ywKhnM3kuU+Aldcafx/2rRc2t4hY4L8iY6OcEtf+XAcjlqcwQ9l0/99pBCgY4GK3Ip4oUIiv8GjOdg3rlCLe0c3Y8L+eyoGARY75xiyIv0HK0EXi08Xgw2oj8iEvGL98Px3S5Io+j+mYSMrZoILA2QF+ovCaaLyi/da6ou0EEDbvZr1X/KrTdr0c/jksogpzZFzp2lNEJT32bVVe/kuI7JjaNTdAn4Rj20c6+HZPPoaKcX1c/qeICYjjHs6Lpba/l9PHY1K/JQpwaCfldwcWbLR3RZuolBxlZosmpWhUHotr5NeVlPyZLJf9eYYuSB/By/KirqpPLRntsWF1LgH745Ef+MLNV4K4/2Cy8tfUtvogTeXn/Fsgs+JPNHo1JD7WLEmCAxNvHAVLd783mottAF0FqbtG/c1Ayx4ZwLoZBLcKURaE3Jaz7Fb22YeR+9ZzB5ro2quVZb8mi7N+KGUyt9cyP56yi8jlVlFdOzIpMzRTpo7GJf5euzagutPALAe3koXmdmPulFVC7S0xuMr6HjBiyVACR05X9jpZ3/ZDrrJbFgOVLYnKdbb4ZyJjZBUwLRpQppw2O4AHPC9qR6LRN7dj3t7gCaolwMArnAgpTDTOdSoksEAoAm74rdN1NcX6crzrWZkLshg548szYkx9TuZBpG8uYaSE9XbaxUBkBuoXdrmnkPW2C1eIE2RR00J2RGeexufMJeQJ7wA1J2KjHfLA+yUX7gPYg3lyYiOSGbZKy5W4aNQ3pByKxqOflb9R4FUNMxX8mN5txWTfRzSomYl8AFGbHy646LHbuCX6BHH1Ui4DIua3y55bKTU+WOyJgAn9jGg9zcU8UA6oktyXCriCXs9l2qlJ2C2qLh7AFPvBX2ZbpksbQs/KKdkX5A5/JGw2gph0u9v2mvosZ1WE47tpl7grm3uNt4B2q9ChDdXu1gHNtNg67q6QqTjs1Yy6P0nF4bDytNUkp/fPcrdA8cBEdnzhZeg0+4yuRT9c/zfZ/YslEN7PU1Rx/nunyGTk5TMtb5B58ppGmzNLzDruaTcaqF2lnLUnXcvsZRtbcVizR3ggLWLbbHLab3a9SAU7TNNdfMOPCZS5xYw3G7kNpli3dOoNlRZSiVf5Sf+piTVWbhs18RRanJ6rEnvrVBOl2p1z/XS6xVbWzLll+qvjfuLNnr1Lzw5xfCI6P5+0YOiCyP0j1z5lXWIFPXCGc= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: dac5f934-e2b4-477e-a7c1-08d9bafc1069 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:10:02.1422 (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: 6U1mA8OCyusc5eHWlEurJe4j5LxEStSdXwE2WkhD8w2oSs7pqtHxwia8OMIM0ee7qqh9PkeXI7pb2LCgcYjFMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 Reviewed-by: Jiri Pirko --- 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 547c0b430c9e..da0b5e7f8eec 100644 --- a/Documentation/networking/devlink/devlink-params.rst +++ b/Documentation/networking/devlink/devlink-params.rst @@ -132,3 +132,6 @@ own name. * - ``io_eq_size`` - u32 - Control the size of I/O completion EQs. + * - ``event_eq_size`` + - u32 + - 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 Thu Dec 9 10:09:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666289 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 95BF0C433F5 for ; Thu, 9 Dec 2021 10:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233641AbhLIKNp (ORCPT ); Thu, 9 Dec 2021 05:13:45 -0500 Received: from mail-bn8nam11on2070.outbound.protection.outlook.com ([40.107.236.70]:2973 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233296AbhLIKNk (ORCPT ); Thu, 9 Dec 2021 05:13:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MavpZaSeIoZaNpnc6o20jFqQ7WNfI082d/CN1FVvylMYKp8lq4bKRAXaQTBWbF4OFNb99egEZvIngVgfWulHVaO1cj067JEllmvGomIAqgWDM5f6xcdz/C2Ml5DWtRNIqKtWLwwvYPW118+cX4X7V0L14Yiiw9UsJvnrjghuJ8kvok7raFeKpuIBsDcGPb2zXt9zBTlhiAazShdGyVa2g5HNT4anmjIQB1c6bssyuywQ6pwxgXeoDX95SwX3Nekra9GfH3B3Ot9qUNgxHJNocO6eylOb2KSM2CRJDzZe/TmkmvI8jIxyWJeQbruMW1Dgvs17cqmb9NG8+ih4LumGug== 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=MLAxRH3CVnngG4+33ylWfbnY/RSkYErfVKgSBL2+z2ra1E5s288YTGhWbSj9k1QXGDxoh9SlpcolJYgyxbaGvy1O7ayabjmfRka9tiKOY7e5+7ElwSQaOhzz52DIVETPqMECxRGiOsU+OLanKoxp5xxg6chxx5dPrRmeZKsC54P3vGTZLLEopEoXx4SlE6A6PIE1CLE01VJTAU/Q5YAssT5mF5j+lQZ9s3HD3S91SWrg0agrJNFlVwbUOWswgg6GvRH0iTaCkgDtBoGCpczFXju4XG8QLozNUtq/SxYcNwkPxblQ/6rtnFNSYBrM4dhSRXmUcxmT/P8dFZq0gr5A0A== 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=gR32r7XWKuhfVV02hfrj6BnmGHApEnAivvf2+DX4TJK6U8Ft6hRRuFPRRM4+Potd5YeRna91SVQidVlBbTU+ZVyO2h66PeRuIqRTJZBrF5GABFfbcTtfJxLDBzFZMTMgvl/Fzl41CtNqPMZQPRCFTEayCC0xD6uZ0ZmfBni5MzOjTSpsNG7XosP1e6gZ/K1kS34RBWY8JoRTuRCQWnksl98hLveBbOfTRja4nB1YxEVdvJMhLXYD4BIXd/Q1YgpCO5KoeG0Y9aykRba6LLdMMCHSoBxjUGzKumdpl38MU5dkNuGDrqmgUP14Lhxh9BrM/5Ezcx0BleCZ+KFnrYXHMQ== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:10:04 +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; Thu, 9 Dec 2021 10:10:04 +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 v4 5/7] net/mlx5: Let user configure event_eq_size param Date: Thu, 9 Dec 2021 12:09:27 +0200 Message-Id: <20211209100929.28115-6-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:10:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 488501ea-0338-46f3-9705-08d9bafc11bc X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: AA1SEOHz+UIc45LF2+XKX1Ymks09imGWPHtbfftt+gi8pzW23xW7gi94+opwUg/LU1y1QlQ7YsqY6AmgyubhU3AxenkBmIE1respQuWK5+LzCQBn1gWeoiUQGjI63H6/6e8B9DvYFqLvBnvQ3a/HnKBhq5wi1gyZWQrdMuQe27LjfSu43Ime605qBjc4CsYtMNtCY5ujuAtM87YyCSaL69CqyEb/oVdg7n68vxi2NizGlScKJeL0TFVZ8MsJlsNlcLmd3us1Wrv8uqMuBqXu7u+rBNxHeVySBBfbXSnVVGPYeulGiKtf9XrNwvCC3DhpwnTLfQo2chNygFpbny7dH/jUQ94wJxnBJsxdu+QDfywvXG96paWIICdHZbBnE7I84DLNcYFP6Prtuocgt80B4/aDk9lm5f9ZtolQ37kyxxaSPV8n/qo44qNkL1kgXiRKH5IMkjhPpTOtQbO2LBvzD7fVs9B3g3hlltu05AFcZIeTyFEUnb+m86M3lCevTAV1VXopOzs45d6iRDZBE/BUjlYJJJ2kmET1gyC75PhMNx/YK2yD/MAgG9PXT+jT7/OjGsC0nrH4ossvCj6y5OQCetbFkNJGUoOf/2mQ5/DeK4maTnTgQuOZzMxt1axmtUd36HPyrJRh1ZjyUlyPwWF4xToUfTgy/4BsxB62wros+8EpZ4HGR/Sp4ymgWjwdLRMchatY1RJXZuAIelMuUodd5A== 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(316002)(8936002)(54906003)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: omiN4RAUf4piPM9Cwx1hxtYJnY4iY+Fb3Bhq3iZVBWEglsoSOslHFWTGVSoIId+3NCEijoQK6RiS30WMntk3Wyd1W+CDKUEfCBemPKG6EcS4iwiDWW+xbJtst6sMmD4GyGCfYym9YitpkBXTIAahHIi7NZKCuP2GTWu1WDGkv8RjTvKfBdeLbMwtZFW35FLbFhZUk5Qr787HODzAIrYf2IsacLIVEcMtlGFwQSasFZ/gYa91fOwDXK+jFocRV0ARn63aoYoYTeHzitGA2XD+dMnA39Q2rJQ8I/qTuJZIKbUhnB80uHdUvFJwcDv4Ss/MKeT9Jti6OMOlV3+w7BVRWL4FeTgEbs8eEulA/R3h3583B04qX8Au/lhw4UlQ3rjZDS5Z5s7M0FhLpVGiITCebf7Mf19O7evQDpSaNxWpZTOkKHatfNiBJ8QhloeIFeExZ3z+3O+5NGbW8nWP1lci/rMQH1obyT7T08TxcPjcdXZOnVM6e/8BUeIRh9Md+60TA8LuAK2BtfDKN6toFrygtUzXk2ZbGuUNLI/vmzHfDpeDk/bT7cVt+v5Bjcx8+TPFvSSJYvc5ePqYjOIz0q1kDVxpg22w4zUBux6NNuk4ACgy2guizq0wqF7kZdaJgVO/5f8bo4Cjda9ST8nKC0M23omK1E2lP+HAi9shBi4JQXJpWq7g9M4gckqGUjQksylR5QUp+DJ0vzw07aTR5pSTXNq9NEtw7WtGGmtD/nvMdpFRieyeQq4OKs8Jan3CEprZaRJ/OFT+SZ2fuFKqh6fJXHxYin5J2UP5dcAfJ+jb9fVllCT4Ipp/NJ/cpu29z0uRQ/InupUhv9eXL3fqa59m9Njde8tAmfXkHJY+0SMLmQ/j7qv3JC3yxSlbNt4hpt9Tn9tU81EW/6i5Tig9fF1Mpe/h00WsdzOxkcEpW4TIrpAaa/CmyYgcI9zDNlFgXc/BUMJJGG2GFy/yxI8WJvmYQ06GK9NF6qCiM6Z7TkgrS3jEMUiL9WGR6qn9itVtKBv2ZJVKtdiFylSb4aG5aQ0sZY5mZUd27cEn4o3cmhip4Q0u0VFssW0PbtladKjkIXNuhfrIOeoNViU5ztze/joG5xqgTHrNp0JX3Yx0QhM9ZXMuI20xCDtYocwr+YqsuQKdimIlhRY3Ru984EDVuKWM0DoEAg/chTt5hC+S+ApD9nnd1rm00+Ey00jd/KRRNwqx78+V4tm2lqJKPogaRWZOFflTd2RdgARG2JFqdbPShWGF+LGYgy8p0KL7KGLeGguzpBBEvUSNqMP3owu/9qAtU4G8r7w4up15LIrW8XX34WiY6gZv4z8A7Rbyqr9cjgULQw68nnRczmpgDeFpkYLMnI1db4gtK+QwdN6AzcU3NwPo1L1u3EdwJMFTd6uxH38EjjXofuRgNkmP49J0k+243nMy4mh9O5fxZgfDLMH3D2Iy8pVzSIBL4RewlfT0IGW9/Z69ljkoFzkUb1bQMSgh3uDmKviRQDaN01/aJJE6gR/axk60yq8UGhZkAS//cFYA85VmpaEBxFrNguyJ3v62+uSMsYgwmQ6WcYrvacFJoN0JpnOnFBr5pkNNN4TYgJTnzXyKWVN0x1wFzPBUSxAe0tOBZQemGSi5XpdBg7dSgB4= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 488501ea-0338-46f3-9705-08d9bafc11bc X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:10:04.4042 (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: EUsbCcbe1/PbGO6M8hMLTMbi8pFVgodgXHTIva8l40n5GsAlFuFISjKN9O15QzPnEhuTgUv9BNWVozog/XMjSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 Thu Dec 9 10:09:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666291 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 834E5C4332F for ; Thu, 9 Dec 2021 10:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233519AbhLIKNt (ORCPT ); Thu, 9 Dec 2021 05:13:49 -0500 Received: from mail-bn8nam11on2070.outbound.protection.outlook.com ([40.107.236.70]:2973 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233438AbhLIKNn (ORCPT ); Thu, 9 Dec 2021 05:13:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WZi3n+GdRBMOne3MgIYA7MqMklqEjHzDw++0g2EVxSaq2y1ODwz8/QveMIawkXmXwLqxMKY52eT2Y+njX3N4xmye2LWhuX5rju7nkZQDA8fV2fHQNYtR7YQY3nV7Fok7XVZEFgMM97Tb+qNa13qTtQEZxijy+kALs0Bpn7LzuFt/mRd195RKjAb30+0O/G//OelcvL0gXkSAPZ1d6eAzGJ/R0YfB+9LqeQQ3IwpZY2+EwnyZn1vv5K0b+L7IapvrICNjUvnB/hNDVG2WwvURqvHvZf1s3zzsPLc7iXCiUwmM510dYe86thZWzcMZjz0RCHobr7NuDGzfiD6X6gt/bw== 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=R3rQPdzukWcOqII/j6oOO9RMUwFQTX7Nj4xP/3itdzM=; b=CTB7/OweM45DsgtX8GHYIE3SwcJMKZFhvZnvznbF81Ag4uzo1d46/iw14syK6lajNebqeQtIAoLdjFWGPODbTwbQBu687XZnhPPCBGu9lhcd0Or402/3HB1le0iAwKb3qdoqTiC7El5pXDjn/sr83CU7+TbzMSfiQWx0IuizjWteEPmEPmexjaj84eH8DQUsqZolx5SWEL78WfcizK7Ad6jzyVWnMnkOLT2DXSGcbtX3TORHWCC8mprlY1MM4wyeE98zCSrPgOobj7ywgZYHEiQt88j1K+9glTYsvXhmRZHTXZiXYXdesIyBa7GLVVlEcx8JPZSkLKlqqIrMau957g== 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=R3rQPdzukWcOqII/j6oOO9RMUwFQTX7Nj4xP/3itdzM=; b=UrE3hl8Dcg9jsSX7kdDgrsyEVgmbBkUlVpRDNlRZ8KC5RntsydhnjBLLIFelc91+1l9i7yXLeDr7P8DEjVaY3k4gO0IruQOO2WJgzgmCYZDxaYSDZlQjw7W3Gfe8z4EcpkH3TRNW098yIb8R7tmlPpoCYTtX4NFJ9oFOM1IHSwfUKhUxsVvnyYMMIN5QK2APe7QC0vYV467psxl3bZS4OmBspUXLyuh9aps57rECuz3VIPojYLAYD2TX+tN22Z0/3aNmMhRTCp5pLbneHe5pcrRuDKi1/+BMATp/sl9BtQUr4C5pGeek5DMNALBmoZ+5Z/OpDvcwSmnAI/xxTLXVaA== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:10:06 +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; Thu, 9 Dec 2021 10:10:06 +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 v4 6/7] devlink: Clarifies max_macs generic devlink param Date: Thu, 9 Dec 2021 12:09:28 +0200 Message-Id: <20211209100929.28115-7-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:10:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70fb3309-057a-44b0-fa90-08d9bafc1303 X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: NdxSnJAgcXyK08W66IW9ugMVllvNJ9zmXqeeCAEkXn6vP62Ok12rS6/NjoUt4eGkKvewjbP7kv4XKLLKY9HqcfTBnkzO89GP1sT8Ddg4+m3xA1Z1fdetaXmy9UD0Pdf1vGHkrsj7myiFWj5ISrGEIQSUVqt/dFE+VGgMT1M71MKUZMlpEWzQhKcCm3Zpgv4GbTWPD+36/nPVgmHdOeYXKT6gPwz+TepJt64EP+PbkUEQYI0OSTypI7EQreARyw5F+oR+m9y9VgXLQ6bVdrkD+g27Ip3t/PSyuU0A3+c3HpMTUdQC/Wep645yRsNYqzi5gxXNLgMfd2Wzb2YS9YwHzUx532zb2TaM7UP1I4c9vVBiaDtwgV1z+iptEHUFhGbv/nIzCHzGW4yIDlcZ5XLbVhhRw0Qke6AF0VZPAda9U7b6nbBPxtbLyr91BzRhZidToCxs0P4O4X2TIaT8Zz9hHPiokluM8UiUr/VxwAkMJbOuImWZ5m1KIxeujjKC+7pRQ/VmstIQMZYDpG8XLVKnxk8ldF/2cAtToicpDpptUh2OTDBHfcpELzh3bB+oRAAXiiUxEk7V/7CvlCLNPXjAPNWcv1PtTqVrBUlNNfHQUCqEvbo9wrdsOgRMR9srAigyqTgtkkkRUpkMMfmbctfKxDztY+QAe1HamG4ZAlQBiKZLlxtoi9SuvW3p2wmOKoHDms/zcop0WeMRo4/TqdgnzlNyW5/Z4OZLxNtUkJxpbRk= 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(316002)(8936002)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uZJSjgzWlrb5NOqufyN573/5uq64oRmiY5wX4jnmlxHoKfLgazRiFJXWtvbG4wD3Dv5LY5R1J3owUc2Qjjp2XPcboayZXb3pr/AMVo/I2LAn1uNipIXr7nyLxa7JWP8fe41XxuO6z0/ZM5pb09zTFQtVSzS9+lu2EO9nx9XP/nRT7Ysbd1HCqZRPDUZLjbJDSip0ZcYST3emFYtjn628fYk0QbZtVedfqLL7+N9jJuMCyCNeWg+ctvCRG1vKIGDe//LXg26hOEYjsikpSRi6eFTuXT4mqWl/Nx7ns3rRClJB2ANWpLfmeGMsmiErl5YnpJJSoBDuegMbuM9qmnDbLr3RfVDSOe5I6y0om8+raGFp2sg+cmi4Li/YGx6Zc6Fe8Sc5IHivt3+aCLXLAc9v04WDO2IfmS6ogfMr+qPLOmcZmIBJC3tqtlrYYJXZdejQ2AglhlgoCiJupLnRhfSGiiCwqeqaFDfQ8DcIZfLNj33/W+ZkYwrIJnmpRKvxNjvZqwb7PqGRE9S0A+kTnMDGe8XOooCDKlMeKiAB3XEbJZBh7JDtaC0FRuZ0LIXTHjwd/2FCZG1SZ5Raf28MGRbxuECUgbtBlXGqC8FFie5yx9mSnFKaenAaqtW2JKAqS+eYO5kzOIXx5tk/ABdCsUVkfMWaNEMSvVZwPDIIroKszThjBniGIfbqeyodHgr3fp+FkMuk/LCnaWoH4qIBp6LcmHT98FXWxW5Rln9gIPPvg1hqfhmXJZXUwYqqPO0dvKoybehRsNdwYFjuXSBvYGWNAaWu8c+o4eUgxi5Y2A9DJWYEigCHPmRdVGzJKK+wr01qK88sXI4o34DsW5GuvMnBwSnTv0EF8mZ914xQNRY5p4kQ7Hl62Yy0rChjJtKC0ePAywJdfMNpbEPv9xxmiwQ3NZCT7kwY7C7eaA2ZfbH1udLoIpgUmLNhbdq2tEihrzGyC8jw6W9EKIx4aermFgBnrkkBGC0Sbg5hvwUHGuCn04mWTbQAq8QjyMFkGH2bTbikG8OLR8jwQsnFI5dFTS6itK6aZ4Q/A7VdskHEpWnu+d2p2XhiGQvnobgcBtPDtL6KywE3Tm+cSwWPlMMLA5h1EErR6F3OpvyydzJnDupIzJ/batN5wxaNHREy5W6Z5oaFyB5hOfb6TJ3yMebxLJgs3IuElYBD0k4WeFqvkwiUykDVNqBcsdfYcnR7M977NtMq9c5ny8QuTt4vqQ0WLtpRTbJG2kjfcCdQjws3R9FYjz13TGf706cb/5mrj0XV7H4P76T6Y2cM24fyKWAhFxr0im3jRFi6o6hGUCWbetfx7kvGj5fxMEgiLvc7nONY7h+EXlFpii35JbuWi3KWgfOFjXbn4DHpxPc4Cadp3/xiZPnNXBYgzaoI6IQfM9ihXBSSbzB4d/BHGlu82+8DqNcdtTIfKH5eRBi6gGt6O2i9OmBLZNPJWByLBWH/Xuha4jpGRtmUON+5gLpCFwKaJa6NKrR5PxWn8tNaliOPSfWt0nxRBnUb7YagUHwyqRWxkQo4NuvQdghV/tmTx/Z/5vI5VWe7GJuz3ATLelc8UmiTjKEIq4qQ8QSlQIsW0DUFqoQG3J1dYDlej417RMjLHTO2jHJHBMw3eyigEyn2bwMWa9E= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70fb3309-057a-44b0-fa90-08d9bafc1303 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:10:06.6374 (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: 12/5k4ETGOp/M0JhaFlvMcHreLlJoEbbNQexax43Dg+K063ddDERzkrH6pcJT6NDWcbTQl1poBsMbtZGuczFxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 da0b5e7f8eec..4e01dc32bc08 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 Thu Dec 9 10:09:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Drori X-Patchwork-Id: 12666293 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 885ACC433F5 for ; Thu, 9 Dec 2021 10:10:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234120AbhLIKOA (ORCPT ); Thu, 9 Dec 2021 05:14:00 -0500 Received: from mail-bn8nam11on2070.outbound.protection.outlook.com ([40.107.236.70]:2973 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233364AbhLIKNs (ORCPT ); Thu, 9 Dec 2021 05:13:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lRVzj/M/LB7wE6uEQ7tftuL1nH2HbwcqmHDYr1eN06DCnGWoRhuh1pmm49diQSDoHkjkg0wB5IR8CzDXjVfiPQwqe83OQPl2ydi0DwvraT+mSii0CbdDNdI2IJa7qb/rpMdJgkiZ+G3AeXMzkR2Itt0L6LlqXBj/pSxAR6wHD/VygghWNTJVKuLal/CfOqJDLiEu+5zbv/WunUHTziOBDLF7c6hToOSIGWJQTBWHImcRM4sRL9CiCTcP1Yj90aj7UwUtrJwpZeKob2Ebzp0KljyIh+BWdd0caaGG7tY4VI7FvtLk987ZAisRl9CyrCAN7u6aqk4DqcGUEhw+dCPVSw== 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=i8j3/RHJjJewzJBOSoLO2Qcct46elO2CCynywX7HSSp5EDVpQbvM5YQc+b4+lq7UUfx7+d9M61KZ2bT8b7aT41Oeb/V/SiB0Cdf9Zxaer4jpFduqySsW/baaBiKGd03az75b5CLraiE8c8qkZ97tO0U8+PfQt4tShHE7wDRCOkSWebo/0kf/5SeQMyCQHlaLYL6O2yEZATseYifftC8ZQ/uDX6I/yxVkPtQUD56XICFAGAnQ3z2xliAB8ZhzZdcFF4B5Bn/qmM8BFzEU82RhxRuZXjdoTGIkZedZuJMpVXoOG1/H2qCddhGi7U/qDpG+2BPLV9dHgDUk16g3vyvIMA== 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=N8/qP0qbq7u3tuCSuf17ih09u3upyUWDMKBR4swwLLpU11FERdcCsKabyZTPR1olq4BLt7buTHu69C3YjPmrWDH7elYdIKY6GHV2Y8SaGxUmSiavgjwEYJMXvbtJCMgICIWMzSvZqmMACGWBk0a2FdsNxPc7ERGRVmhXA8/MFUWUu0DAphNZ0qeWpgy/eC2ApXwVbwWEYI4H/wdGpZ7UlWWdrkekkbikfbO4E/pQ+MWm0JGkhv+7VnXCVoBSMPQ+GGeeOxOXoKgio+qSf6OegLLz+77pqJSqiMpUJ5aQ7jRVTXo31R5gRH0zOL+HIoDYKQfbMAKNJ0fz3Ric303i4Q== 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 DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 9 Dec 2021 10:10:09 +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; Thu, 9 Dec 2021 10:10:09 +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 v4 7/7] net/mlx5: Let user configure max_macs generic param Date: Thu, 9 Dec 2021 12:09:29 +0200 Message-Id: <20211209100929.28115-8-shayd@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211209100929.28115-1-shayd@nvidia.com> References: <20211209100929.28115-1-shayd@nvidia.com> X-ClientProxiedBy: AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) 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 AM6P193CA0076.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 9 Dec 2021 10:10:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0361eafa-60da-4b3e-15f3-08d9bafc148c X-MS-TrafficTypeDiagnostic: DM4PR12MB5311: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: DGB9jfgDykYwkzT4e7mT3+LR+nnEjzFCQCWTIqEzhyV2z1gijksgk/LkKQuhYlkE6X04nwS6EtFvYTDaNtAulBPw4d4h5PYJ7KgJWPj7Qmn5/z5OgKLwvlRlf4fc4RziaXLmNTg4Wxk3z/dCT6CGA91WElG5bSiddu3vLMosXhTbQ6jmi3SdSwpo5foX5kq0J0CzwmwxXwMxo2nYpo9/5KjCzTfXvOLqponBEbsFlZZIM1vxuZv9jKYJNSWXDc1oPuEPeeNcOlRpcMNgjzqJtfsID4gcatKGd4Qw6OAKjVyFQXrgvmuYFtWiVeYj9mZcz6WyjDkvpu0vS5N4eQMou32J2CDd7PlvOUq5yee9mQLbEPQ75ATCzHLOhacMl9x2MzYAVoSbjRI8w4EnACtAJPbTyjq8d13gCwCUasRRE2Z2uwhxSYV5Md3ilvLXnWdifQ7hV6iXxQMvMa5GtUpjSWH8ZCiO8TAIp2ckkACiCX9AKh99f/6+xqyKnyogKTrg6CwWSbBeaJzKgYjAfyWspMvB/dpAeHYWJogJyIRjzMY4QcbJLr6fZqsOFXmvWfyEW+qe56BaZ5l8p//c/fcpG0R5ZntEDAfIPs6nYs+JT1bD5hFnbfXK1452j0RtF9YD08fbSaaPh7o9KUk3laVsvqGe/vApZlOKNVW6HTkvyQ2jeYbSpc5ueWk4BSfOOrt29DddsI12ajMlceFulv+8v/rHQlznyWtsyUFy0bJwnII= 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)(66946007)(66476007)(66556008)(956004)(38100700002)(38350700002)(2616005)(508600001)(6666004)(26005)(6506007)(1076003)(4326008)(52116002)(5660300002)(316002)(8936002)(54906003)(110136005)(107886003)(2906002)(8676002)(186003)(6512007)(36756003)(6486002)(86362001)(83380400001)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P5RHMScSVQGfmvni6YbQsPr5t8UyEgtEV6l5tpvmK7my/g3QtcKI9VyEUVY3SIANWZblJ/LuP4f5UFJIKZlwFwpnEUAKmVv1CXAn1iVVTjc7co1VnEidUew/Tjx1khcn7NobyP+i64Jr5zeqSs04Q3Jl2lyH4pZ2GGaQ7jQPzWXStcdxuuwPGEy3BJqyb6Pvda39pusUyfXMwhxSyD9KkJIN0tNdlBRElbZfr4K/mznxSgDGmO4SeIrtGvdfLfuakktAXzkWIXOn8U/mhw6TLDRUThjkAvuQH1fBU6S3R8248S2iU4xb3w4Rf6jk+rf0hjJfZnJS/3X93nJUWH4QihtNSe2DUsBXBEGQx+ge1WbrI8HrB/aQEGYiLm7ers/mhcSRw92vi9keki95zEao7HG0fqPjwjZpZFwNRaZGOxGVaAioA1s13+nxOGjjEwjHaJgzhMigSLImbj/xuWLeEVRcYWc/TTbMOJHwCxn47k1z6KmguGuvyl3HVQFPlV40hcaaQN9jX5RJRgXJmssG2E0THnpaU29Kq6OhT7pFGPQKiQbOUF+f0FpXqZlUp2qY6zyR+DiMN+iIvsha0KJnKgsLAUN3zFgM91fxBbbAEuisT7U/bdaIGNPPwUY6D3LKMvPlsmPQdfhFN0qaCobJHRCZ0E2bwP1zlAZ1DKGe/w+170r7lRO3dDPh+A+2DDxW2F7Ilvy1ScfB/ni0ADM7lUu34UuALN220jlXfj6jjXA1CKiwMHnMN2TTZESIUiYJM/PSKNEl3xm2bdmMVvY2FGNMB8bE9ZRebYpvK3zRcAQZMXLNkb3+7lFu/SnNT2RKeZuR0MolN0Fr2LWmjLdqM1Hdrs/JGVoRZaAnIJBg7Lqslte7SYldsJ60lmaCnbkHHxdJ6u0VltR9arE9xL1e5dBGDAudf+6MZSyF1/0E65UTObzt3EV6TtcaMxXSM32RqP1fsodRjJOZ/5ou7O4tI0DoafWKr3b1DD5nfv8kl3lRDyv/2zyV68K5a3A8Ncl659b3bqfYhm12868wQ6eag2ZnjhzeRUiPsGgAhUl20mQnhpPNxDcHmrpZf/oUct271uKXXsaNNtZf2o3W65EsCpkWldE9BKRcYALL2SndehxLWEa/muk/G/4hW1DtrrWmbrZ350q5H8VeIXH9gyZX2MAoCllYRzMjA5idPevC2mmQ3i/cU9cNDZ5P1okAaa8p7XElTLqlqGPBMQeRe/jzv979gBnuWTHY2Z3JRy0AIkAHzuCPbk1lw6RDwHz0kJplBOry8CI3193VUyUihbOeKDTChyi1raSD3spHgMDV0zaAHWmUix6kqe+FG1E6xIpkp4XhKPC8hivKt171j58IBf3f0BAL+0qlB4Qo5lilAp0J1UYXzzpafd1+K9Lf9t9Qok9eSlafOwqdyJHDkogyA45O2UeavzpCwmGqUPesK0gK/5BNBWunSGuz3ErQZ0PGF4u23wFo177mqpvzmhQ3aOmpTTufM1QEfLcB2TTm5P78ccPeLhv8bfCr6dsSG8s9Fq6G83mo185AVYMIHsT/d6ezzjDa8z3dvCFWzV8ISP60+TCc1fytNFgwqsO4iy1r06jrzfH8Ekb3Nc5Qy6DjeozMrjoPc11x6/n2RNio0kw= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0361eafa-60da-4b3e-15f3-08d9bafc148c X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 10:10:09.0847 (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: udWIug0D4gGhJNBGb84zIsJDc1ny/jxdrCSXtNFWzeXBtoUGCCwUWnX0x0oZVGEhBOkPnUVtLwc4eSH3RVwaWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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); }