From patchwork Thu Jan 21 13:10:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 369297 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=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 D21F3C43381 for ; Thu, 21 Jan 2021 13:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81A7623A51 for ; Thu, 21 Jan 2021 13:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731679AbhAUNNF (ORCPT ); Thu, 21 Jan 2021 08:13:05 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:47213 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731628AbhAUNMK (ORCPT ); Thu, 21 Jan 2021 08:12:10 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id BD3F25C0070; Thu, 21 Jan 2021 08:11:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 21 Jan 2021 08:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=RuvE8+BS5f0IXZL0q qYDisBeK67D9E1EKo+IQ4J3RKE=; b=IkHfUUseZmk5bhOuRtJ5I4U3B/Q0KFD8l EF9WbzMWWwcN4jTW3Idg5fWp1scEyEHW5F+OJLKOf1VITLC291JwR2rrnNUYpNxm d5M5ElxGS7SNocFTc/c0H4Uxey/RIrZ5KMbmIjVzaxdKQO/XPjxgJ/byvJyyaTKW vKGhPsphdVNWi7Ck6fjT2ePYAUQJl5OZtsid0cq83bol4fH1/fQlriG24I4nqlcc JmfMf7LpOqvtffYazOyRlq485zAYA7Js8tIGkspLfyYDL5qXtfjkSoJ35D0HeOgQ 1mtACCbjc7K5jUs08axYbSLDKaUp3gPrxVdn6osXyqyVvUV7b+NBA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeggdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhstghh rdhorhhgqeenucggtffrrghtthgvrhhnpeetveeghfevgffgffekueffuedvhfeuheehte ffieekgeehveefvdegledvffduhfenucfkphepkeegrddvvdelrdduheefrdeggeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthh esihguohhstghhrdhorhhg X-ME-Proxy: Received: from shredder.mellanox.com (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id C35B4240062; Thu, 21 Jan 2021 08:11:01 -0500 (EST) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, jiri@nvidia.com, danieller@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next v2 0/2] mlxsw: Expose number of physical ports Date: Thu, 21 Jan 2021 15:10:22 +0200 Message-Id: <20210121131024.2656154-1-idosch@idosch.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel The switch ASIC has a limited capacity of physical ports that it can support. While each system is brought up with a different number of ports, this number can be increased via splitting up to the ASIC's limit. Expose physical ports as a devlink resource so that user space will have visibility into the maximum number of ports that can be supported and the current occupancy. With this resource it is possible, for example, to write generic (i.e., not platform dependent) tests for port splitting. Patch #1 adds the new resource and patch #2 adds a selftest. v2: * Add the physical ports resource as a generic devlink resource so that it could be re-used by other device drivers Danielle Ratson (2): mlxsw: Register physical ports as a devlink resource selftests: mlxsw: Add a scale test for physical ports .../networking/devlink/devlink-resource.rst | 14 ++++ drivers/net/ethernet/mellanox/mlxsw/core.c | 77 ++++++++++++++++--- drivers/net/ethernet/mellanox/mlxsw/core.h | 5 ++ .../net/ethernet/mellanox/mlxsw/spectrum.h | 2 +- include/net/devlink.h | 2 + net/core/devlink.c | 4 + .../selftests/drivers/net/mlxsw/port_scale.sh | 64 +++++++++++++++ .../net/mlxsw/spectrum-2/port_scale.sh | 16 ++++ .../net/mlxsw/spectrum-2/resource_scale.sh | 2 +- .../drivers/net/mlxsw/spectrum/port_scale.sh | 16 ++++ .../net/mlxsw/spectrum/resource_scale.sh | 2 +- 11 files changed, 191 insertions(+), 13 deletions(-) create mode 100644 tools/testing/selftests/drivers/net/mlxsw/port_scale.sh create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum-2/port_scale.sh create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum/port_scale.sh