From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5396AC43381 for ; Wed, 20 Feb 2019 19:32:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 221722089F for ; Wed, 20 Feb 2019 19:32:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="GDKepzG+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbfBTTcR (ORCPT ); Wed, 20 Feb 2019 14:32:17 -0500 Received: from mail-eopbgr00045.outbound.protection.outlook.com ([40.107.0.45]:11872 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725847AbfBTTcQ (ORCPT ); Wed, 20 Feb 2019 14:32:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pin2Pl4xmzEGu+/8ATZLKTa6fNY2myYa+6FGV1Bj8JI=; b=GDKepzG+MKWEuXVwR+bapSklwn1dbsItrZFR/KWs1KVKOQdoS+/QoIjB1rCOrQFDMTvdXFXtFoVqq5qWnH1GOgo5c0G/8pJx/PNVKJQ8zvDwOqKu/CncJpudGF2XG5ruOgGTs4aHNpmQzbbCfpbYKFMPmJH7ovTwD42OVeptF0A= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB4871.eurprd05.prod.outlook.com (20.177.34.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.19; Wed, 20 Feb 2019 19:32:10 +0000 Received: from AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866]) by AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866%5]) with mapi id 15.20.1643.014; Wed, 20 Feb 2019 19:32:10 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , mlxsw , Ido Schimmel Subject: [PATCH net-next 00/10] mlxsw: Support for shared buffers in Spectrum-2 Thread-Topic: [PATCH net-next 00/10] mlxsw: Support for shared buffers in Spectrum-2 Thread-Index: AQHUyVL5f1YImhv0/0WcIUpYaQFQzQ== Date: Wed, 20 Feb 2019 19:32:10 +0000 Message-ID: <20190220193141.16498-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR10CA0061.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::38) To AM6PR05MB5240.eurprd05.prod.outlook.com (2603:10a6:20b:64::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [77.138.249.209] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5b92ec4e-caa7-43bb-47a9-08d6976a1b48 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB4871; x-ms-traffictypediagnostic: AM6PR05MB4871: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1;AM6PR05MB4871;23:02gySpcEX1n4iWqIMPplLZkx457/vfRwr4EkTfC?= =?iso-8859-1?Q?BonaxLrCj3uhbkjpKAKRnunmhc0sa/VhdqUh8yGnwcSzy0BQz1bCswbkZV?= =?iso-8859-1?Q?kJaf+q3Ky3MUS14W4Ffw1GxYnvPWQfMHNsZleRm247bSAO1K81wlS+GrIv?= =?iso-8859-1?Q?pbvUNR+Io8GWSYOKMEYgUCfTg7QgzYa7gVk3SGt30nEbhUtfB4CZygwoSq?= =?iso-8859-1?Q?Hm/rZJnMrURHh8GmPtvR7/1ERSaoXVnAgOYuaclTo4iWC0BVjO7js7ooFl?= =?iso-8859-1?Q?Jh/Vql449YQoJ88/ZK6201+xU44sNy1U4QeXdiGBt+qeyiEbp0KJMJk0Gn?= =?iso-8859-1?Q?h/xwmGLY4TW7uUwcWqUfISBGdfGj9T63ioP2ZPITyt6KDgyGGGDvN9VIAd?= =?iso-8859-1?Q?CoWjln45XCMeY0qMUlHSMImw3tuUOyuMaa7cHCkDf3Fguw/yxE3EGp6cXD?= =?iso-8859-1?Q?DclhDw5lOpEKzm5AnMm8Qrkai1F6Yj7JebojFjw6CKYbqEiv3px5EK34/E?= =?iso-8859-1?Q?NRe3Vh+NyJzdkaWRwZFOA98ZuLJTervyg9AED4y3IWPlFS2lQaWDWKK2rq?= =?iso-8859-1?Q?+SUKACLFvDyhpJhdeWYjQMHfAP4lyfY1lUJWzeAPB5BBihGECgcCtbMx5q?= =?iso-8859-1?Q?KvRv/JndHZ64vUzI0sn5iPk2i3u9SaUMvzXwjWskwj9DvlB+I5oMSyW191?= =?iso-8859-1?Q?L//aRNQWLtutMQ4KVG6jD4YvZz5HhJ00lGqis0Mt5Cj5cEpH0lyve9N/au?= =?iso-8859-1?Q?O3r6Eckn+N6YGd1u14gTOeqA8bf9gk8AKxf2QPiRZGJ/T+hDFU292XJJZO?= =?iso-8859-1?Q?1nM8Zf/06CFighS1e7QoWiu2JPCZKr0tPq0GOtom9vexapqNxOHk+fj5ep?= =?iso-8859-1?Q?SoPSoAMzxCuhbol2SyJqJLTbG3gaY7//GGMfA8EGZnndfkFaLjDsCc0bU2?= =?iso-8859-1?Q?rfyS23t7xVLnLXKkIB1qVWw8o0XXlFHXxy3DEPAi0LYO5SEWM0i8dAYYrm?= =?iso-8859-1?Q?DhaXGA2QrgkwPqjrCLaQaZ4pw3R3km9kmzHLzooT0guLmw4xTVMnW0xx7X?= =?iso-8859-1?Q?+kqI7rEdpb3ZrqmG5S05b6INupIFOw1vGaMVa9Qq8lgdPJdJa1AI6rWChe?= =?iso-8859-1?Q?yjUl5KzbEdr+Fpey+IoMBhqLdGjFX1JJJYnagqjt7yYdnNh12hSvTPM+i5?= =?iso-8859-1?Q?mgdH/cJWywQVyeuW+3EQL/l0C49ybcRajmg6R0jyDov62Q7cLliy307dJl?= =?iso-8859-1?Q?3Sy6BObBItSFpZxLdjq4OVLiTUT0fPL2RSfICFJ20eHiBQnxeyGfO4b7/j?= =?iso-8859-1?Q?ikpmslchD490N99M9/q/4be?= x-microsoft-antispam-prvs: x-forefront-prvs: 0954EE4910 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(376002)(396003)(39860400002)(346002)(366004)(199004)(189003)(486006)(86362001)(2616005)(4326008)(2351001)(478600001)(2906002)(105586002)(106356001)(107886003)(476003)(68736007)(6916009)(54906003)(316002)(25786009)(6506007)(26005)(102836004)(386003)(53936002)(186003)(6116002)(3846002)(52116002)(99286004)(97736004)(2501003)(256004)(81156014)(6512007)(6486002)(50226002)(5640700003)(81166006)(305945005)(8936002)(7736002)(8676002)(1730700003)(14454004)(1076003)(5660300002)(71190400001)(71200400001)(66066001)(14444005)(36756003)(6436002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB4871;H:AM6PR05MB5240.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: QTWtYPqtZ36ATViRwReeBiYk8CnpuABi3O0IsecCTtraCvYS5lbNZx/lPOlwTQtWuIHeuYep+F6CFpcQ8Oi4dAwDgKG9Fqy4dAfKyCGkkpO4krlnIBEklc8iPwPtglZhH5lB5iTjlqokPkKD1FKJCgLlTsk1WzAL+Rhi3Dyhv1l4IEAZyzngcjT7TtTputHHr8FuAPd2KGlM5IPBZCIOyQfLT4hlMkS6P0C3lgclwYP8/5aoX0Shr8NYFNrZe1TjHnNslI9CyYHsLedqyxFwbAeeB22wTxT+ysVw9dNaquNQzrs/TdFu4nYldA9OXYN2nbzpS8IdTztwt2g+mzxqI9G+BzDV6GrYOoU3BCfd5eS5Ng9YXIziV55kvZ5BLWId+P/ohdAWlBe6aXWjIAr6Ju8u15Y+oTP5cIl/HJPIbDM= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b92ec4e-caa7-43bb-47a9-08d6976a1b48 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2019 19:32:08.7504 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4871 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Petr says: Spectrum-2 will be configured with a different set of pools than Spectrum-1, their sizes will be larger, and the individual quotas will be different as well. It is therefore necessary to make the shared buffer module aware of this dependence on chip type, and adjust the individual tables. In patch #1, introduce a structure for keeping per-chip immutable and default values. In patch #2, structures for keeping current values of SBPM and SBPR (pool configuration and port-pool quota) are allocated dynamically to support varying pool counts. In patches #3 to #7, uses of individual shared buffer configuration tables are migrated from global definitions to fields in struct mlxsw_sp_sb_vals, which was introduced above. Up until this point, the actual configuration is still the one suitable for Spectrum-1. In patch #8 Spectrum-2 configuration is added. In patch #9, port headroom configuration is changed to take into account current recommended value for a 100-Gbps port, and the split factor. In patch #10, requests for overlarge headroom are rejected. This avoids potential chip freeze should such overlarge requests be made. Petr Machata (10): mlxsw: spectrum: Add struct mlxsw_sp_sb_vals mlxsw: spectrum_buffers: Allocate prs & pms dynamically mlxsw: spectrum_buffers: Keep pool descriptors in mlxsw_sp_sb_vals mlxsw: spectrum_buffers: Keep mlxsw_sp_sb_pms in mlxsw_sp_sb_vals mlxsw: spectrum_buffers: Keep mlxsw_sp_sb_prs in mlxsw_sp_sb_vals mlxsw: spectrum_buffers: Keep mlxsw_sp_sb_cm in sb_vals mlxsw: spectrum_buffers: Keep mlxsw_sp_sb_mm in sb_vals mlxsw: spectrum_buffers: Add Spectrum-2 shared buffer configuration mlxsw: spectrum_buffers: Update port headroom configuration mlxsw: spectrum_buffers: Reject overlarge headroom size requests .../net/ethernet/mellanox/mlxsw/resources.h | 2 + .../net/ethernet/mellanox/mlxsw/spectrum.c | 15 +- .../net/ethernet/mellanox/mlxsw/spectrum.h | 6 + .../mellanox/mlxsw/spectrum_buffers.c | 312 ++++++++++++++---- 4 files changed, 267 insertions(+), 68 deletions(-) --=20 2.20.1