From patchwork Wed Dec 29 08:55:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12700797 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 64411C433EF for ; Wed, 29 Dec 2021 08:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239416AbhL2Izn (ORCPT ); Wed, 29 Dec 2021 03:55:43 -0500 Received: from mail-bn8nam08on2040.outbound.protection.outlook.com ([40.107.100.40]:1857 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239391AbhL2Izm (ORCPT ); Wed, 29 Dec 2021 03:55:42 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OPprQn7pEn7OJKuPXeBEN4RUEkUyHLbEKzyaBpijKkpRsDnquRqtKzoFXGOESgkvSkrLgodbZbBRD7DYG7uxMw31K2WAL8VWgyfR/mvSNSziSRBCOz8u37UZECLbzXWem1d6ffzvGTpAwgdsRXQWyn7R/rdwJpITNNRuBlLpRA9eIfUPGDt1WvC4NG6Bh9ksmeOc3HpIpgk3xV9Sfq3onMv99c7kcWGOcPsmfOxZJJIFtcCS8Nba0JOEglrp7dgeTzp2Jtcla5iXEAqRtkGDrjQkXxUVJBWFmv4tnVnm5z3o3yzZj45u5aANqeIN1/FOGPHngSN1qfmlaw9n/KT03Q== 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=cwlh+pNVdMWw758S/aBn54CWIlx0mXGUZRdTgEnftzc=; b=P9gfEe7fZOwZOWJoHDtsn1sjZylI+6vVyWJz760opTHy9YCz9VrUs3+1O5USQSssH5CHA2XILpimJQ2uG1DjDiqvaNXgSp2KzWsqyYnlDTW7Yxt5H8dy0qcGkw4H2iQebi4qCm/eVprAxutIsAYqlLCui/UlOlNCeMW+3yWhOdpwJQ6IcSgg7fg5d0EzIkVBF5OsgCmsrfZ1dVUyC94lKpYE59Xx55djNNHhgMvdICFjSVM+Yljt5GKjFTofPvjQWN6lpwIYX4x6gFs2G4IJdML6xPyUwFOVTr5ZM12wb0mPGqBCF36MPSFLnSwQiXtwi5WwAZh/84i1xe+AJBoFLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=cwlh+pNVdMWw758S/aBn54CWIlx0mXGUZRdTgEnftzc=; b=RR8xlR6Gc81nNPkxBLvrktly29iPeoM3yi5zE82twitMWmelvggGQQBGsZi3LE5+fTRWbj3QzeRZtucRQskjvPpNfKz8ErAE+eZ5DVRIjj9m1euGAvfLcWYZTPNGN/KU6hzwJxILQTA9iYRZMndwiX15JZgLRJEJbZLhZQvVhg36MDVxDLZnpaBmvhfIj8zzAeeXXfJHAzwemgFsbblmEsZtcP9WucAHKiy23AeAiZHWfKao7+Yg44ocmTNfudt5aNzfHVhvoBldzyKbiCdCpoBK0P0DjLJ/qtlMFbzUi+VTWPXwKhz4QYt9KEtURdRbH0t3cs5hav6TUzMtnPOloA== Received: from DM5PR15CA0070.namprd15.prod.outlook.com (2603:10b6:3:ae::32) by CH2PR12MB4166.namprd12.prod.outlook.com (2603:10b6:610:78::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Wed, 29 Dec 2021 08:55:40 +0000 Received: from DM6NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:3:ae:cafe::42) by DM5PR15CA0070.outlook.office365.com (2603:10b6:3:ae::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.13 via Frontend Transport; Wed, 29 Dec 2021 08:55:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT041.mail.protection.outlook.com (10.13.172.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4844.14 via Frontend Transport; Wed, 29 Dec 2021 08:55:40 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Dec 2021 08:55:39 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Dec 2021 08:55:39 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 29 Dec 2021 08:55:37 +0000 From: Yishai Hadas To: CC: , , , , Subject: [PATCH rdma-core 1/3] verbs: Extend support of NDR rates Date: Wed, 29 Dec 2021 10:55:00 +0200 Message-ID: <20211229085502.167651-2-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20211229085502.167651-1-yishaih@nvidia.com> References: <20211229085502.167651-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6de740cb-855e-4dcb-0682-08d9caa8fd3c X-MS-TrafficTypeDiagnostic: CH2PR12MB4166:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cTdcJ+GHsUA50EvbQm3L3HSMyQTJyYiTK2nZl70ucG62NkVDt/IKBt92CEQRtkpb+Oz60sx0EacupQ9qSeQocydSdetjduFSRn7gFr3uwoBa5uGPL6wCHKVgaS2OYwvSX35Y5kIC05NY/CO/LAs9guoX8wbfSPjuZX5Ej6K6fNLHAbeDA31fxncrjUh412NZ415YztRpHqRngS92Nsl3RMNgLlc00y2yP95XWbjcAtThe6uUkGHZ6iUHfOxcR8nF/cwYVzKigpvqI4aI51KLtqD8NMBGUVeJk0VSslGs0cxJkZjMFOVLRyzr5X94ne3HJHUJklPM2bgRW3X3UXJHn6OCCoUtS91g+OQSuvvAhvZTwKnp8mkVb2I+cZeW28rluAtSwnWYPRwrr6vBYTSiYzpzXyTqIkFKneYJxuiTfuzqljPmJUWBEuFeLzeBQL8FVWqdy7f8Js0nigK4if/LzYu8HN+zWQaEveVt1FP/XLMHHUaNDxz9OcoYJDhRimwPPlZFYCrmm6U9m/ZgWuZBGL9oQh2J52JzrqoxriqDuJD1g39YcaASuxC28NU9VEboHMVmb9U8awHSyPm+XTUFe9gX8YoZ2rzAYkOgnLdp7LgUIrbZmPpp6qRno3Oqcbabh+Ps6eRI8JV3j7r4UiHNbxQbPYBTiS65i0bwLfib0O7XyDKRRpzlPBd5WGLkud19IqO29awYwZEUXtA70EwWsp9ME9OXLSngLYFMYEw1itgi1A8ICIUDSUKvh8CVEwcQFLveCip9PK9v/vDtJrBWUUqrqrPuYcXn2lAo9C3kAm0= X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(4636009)(40470700002)(46966006)(36840700001)(6916009)(2906002)(47076005)(4326008)(83380400001)(336012)(36860700001)(508600001)(82310400004)(6666004)(19627235002)(40460700001)(36756003)(186003)(26005)(7696005)(1076003)(426003)(54906003)(2616005)(86362001)(356005)(5660300002)(107886003)(70206006)(8936002)(70586007)(81166007)(316002)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2021 08:55:40.0271 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6de740cb-855e-4dcb-0682-08d9caa8fd3c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4166 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Maher Sanalla NDR(106.25 Gbps) support exposed new data rates: 800 Gbps - NDR 8x. 1200 Gbps - NDR 12x. Utility methods were updated to support the new rates mentioned above: 1) Rate to mult - Convert the IB rate enum to a multiple of 2.5 Gbps. 2) Rate to mbps - Convert IB rate enum to the mbps value. The NDR support bit from PortInfo.CapabilityMask2 was added to libibverbs, as well as the new link speeds mentioned above. In addition, speed_str() of ibv_devinfo was updated to consider the new NDR rate. Reference: IB Spec Release 1.5 Signed-off-by: Maher Sanalla Signed-off-by: Yishai Hadas --- libibverbs/examples/devinfo.c | 1 + libibverbs/verbs.c | 8 ++++++++ libibverbs/verbs.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c index 5db568b..cef6e2e 100644 --- a/libibverbs/examples/devinfo.c +++ b/libibverbs/examples/devinfo.c @@ -147,6 +147,7 @@ static const char *speed_str(uint8_t speed) case 16: return "14.0 Gbps"; case 32: return "25.0 Gbps"; case 64: return "50.0 Gbps"; + case 128: return "100.0 Gbps"; default: return "invalid speed"; } } diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c index ee26b1d..69f82e5 100644 --- a/libibverbs/verbs.c +++ b/libibverbs/verbs.c @@ -72,6 +72,8 @@ int __attribute__((const)) ibv_rate_to_mult(enum ibv_rate rate) case IBV_RATE_50_GBPS: return 20; case IBV_RATE_400_GBPS: return 160; case IBV_RATE_600_GBPS: return 240; + case IBV_RATE_800_GBPS: return 320; + case IBV_RATE_1200_GBPS: return 480; default: return -1; } } @@ -92,6 +94,8 @@ enum ibv_rate __attribute__((const)) mult_to_ibv_rate(int mult) case 20: return IBV_RATE_50_GBPS; case 160: return IBV_RATE_400_GBPS; case 240: return IBV_RATE_600_GBPS; + case 320: return IBV_RATE_800_GBPS; + case 480: return IBV_RATE_1200_GBPS; default: return IBV_RATE_MAX; } } @@ -120,6 +124,8 @@ int __attribute__((const)) ibv_rate_to_mbps(enum ibv_rate rate) case IBV_RATE_50_GBPS: return 53125; case IBV_RATE_400_GBPS: return 425000; case IBV_RATE_600_GBPS: return 637500; + case IBV_RATE_800_GBPS: return 850000; + case IBV_RATE_1200_GBPS: return 1275000; default: return -1; } } @@ -148,6 +154,8 @@ enum ibv_rate __attribute__((const)) mbps_to_ibv_rate(int mbps) case 53125: return IBV_RATE_50_GBPS; case 425000: return IBV_RATE_400_GBPS; case 637500: return IBV_RATE_600_GBPS; + case 850000: return IBV_RATE_800_GBPS; + case 1275000: return IBV_RATE_1200_GBPS; default: return IBV_RATE_MAX; } } diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 36b4142..6f7910b 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -418,6 +418,7 @@ enum ibv_port_cap_flags2 { IBV_PORT_SWITCH_PORT_STATE_TABLE_SUP = 1 << 3, IBV_PORT_LINK_WIDTH_2X_SUP = 1 << 4, IBV_PORT_LINK_SPEED_HDR_SUP = 1 << 5, + IBV_PORT_LINK_SPEED_NDR_SUP = 1 << 10, }; struct ibv_port_attr { @@ -721,6 +722,8 @@ enum ibv_rate { IBV_RATE_50_GBPS = 20, IBV_RATE_400_GBPS = 21, IBV_RATE_600_GBPS = 22, + IBV_RATE_800_GBPS = 23, + IBV_RATE_1200_GBPS = 24, }; /** From patchwork Wed Dec 29 08:55:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12700798 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 1C2C6C433FE for ; Wed, 29 Dec 2021 08:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239415AbhL2Izp (ORCPT ); Wed, 29 Dec 2021 03:55:45 -0500 Received: from mail-dm6nam08on2047.outbound.protection.outlook.com ([40.107.102.47]:55393 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239412AbhL2Izp (ORCPT ); Wed, 29 Dec 2021 03:55:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mAzQKnusYLST+NZIaBMqpYq9SDmDwarbH/PPGiu5MMTVOwj5P9EXMUX/LMNps0dVbS0+LGLjUobWxp8rcCJ3M8OSJVU7N0jkTqNjMp181eKZsbax5oEy4EX/2M4R8xPDuZbNyrDKoQmTMl7WrcLDoK4c39oRBdP6MPql8neYaLyJ6CZ/YFvCQHRKkqmlKXA1AaYU2BZl24gq0xaMPb3lkz8lvYo3O3FlJTVQnWZXTBcePqlx/bYoVRSajW7HkBKqgP34DLmW70OZ/KmRgl15viaI78tSKH0JqrC4NBiE+I1SzkAPLYnVi5EFog+76rCe3sU1dpSFSaNpLcLqdGeb/w== 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=4xzYxaRt1eXkOhIWU0Rz9HKkbwTZtz+tlicKf3woDkA=; b=KHJxukLQiq6t2W4F/NWJ11uTz7mpO2CSvUdN3rngjoYakKMhUmv1kHiAk3hiak+1d11NADob3zgqwSPxUeCemryaLop/TBdl6qxBTl/dYZxqyptkYvsVexfV/wmVOEa1nJsBx+K6wIrfkbWoRc7Tkvmhb1cqwilUxNL/Fly7lvT++XpJvxPEJyWjJc4VIVAUOTp90YWmnVLIgX4anSDcRMKAKwmiU1jp8lvT11bJXR/lMvwvcyKWso5ykQx0MyrKtmLA6IwJYtd9eAajZD1aeYxrA9a4GIJIl4Emqjh56DxOOCSvngzNEORDEEb3iCRSuMrf1jXKPulQnxkdB2XmzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=4xzYxaRt1eXkOhIWU0Rz9HKkbwTZtz+tlicKf3woDkA=; b=N/ToRwzVqcidKDggav/wflgDFor0pJ7N9Mm5+2k0vm/AAt/GA+8sI4JNcQU3EfPBkADLtSmU6tjk579rKWJwKFbVrI/uuXZKfFJNTKV1a3sYLenJ5torGmHigU+O6Lk5CUJm4rCBqb5E7BjeQjeReBT57VXWkrCGCM7GMn+u0azmnt/2WAKizl2p1Aqc7wqHGqFuBPdu6AtejVUZdhXQgY8Uio9phImnyuQWJaHeOv4CZ4oLANDQ3wpkF8+GwV/AhzNHakMroUjh2dHIjPqYOC99WpzblAgzdWt535nuYvmUfNtVXEGL+iZs/jVNJa/a/t0iQ/wgZo3cshR6Fmhe9A== Received: from CO2PR04CA0060.namprd04.prod.outlook.com (2603:10b6:102:1::28) by MW2PR12MB2588.namprd12.prod.outlook.com (2603:10b6:907:a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Wed, 29 Dec 2021 08:55:42 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:102:1:cafe::c8) by CO2PR04CA0060.outlook.office365.com (2603:10b6:102:1::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.13 via Frontend Transport; Wed, 29 Dec 2021 08:55:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4844.14 via Frontend Transport; Wed, 29 Dec 2021 08:55:41 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Dec 2021 08:55:41 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Dec 2021 08:55:40 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 29 Dec 2021 08:55:39 +0000 From: Yishai Hadas To: CC: , , , , Subject: [PATCH rdma-core 2/3] ibdiags: Extend support of NDR rates Date: Wed, 29 Dec 2021 10:55:01 +0200 Message-ID: <20211229085502.167651-3-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20211229085502.167651-1-yishaih@nvidia.com> References: <20211229085502.167651-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69ed807e-ca36-4a45-161c-08d9caa8fe58 X-MS-TrafficTypeDiagnostic: MW2PR12MB2588: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: 6I14F9IxJI7B5sDtCviCS2RkH8tI4FcRXkNTVTd5x/+Bxntmc+zdaC9LDA08ng/43FCH9lgYFzVjnRbYQBYwjbsmycc+uk3Jg1/g+Dsvx57c0H4m9FH4VxMHkG4CBVYX8EpcfxUG0OHeMnWp2ilipWHopzBCBlDwJ3LKxNlg0JxhAjPcQalHwV0uUXMiMaHB6CYZAKSwT1yEne+nHRozt21ptaS/4XIqJDCkJb0Qeqv59nF4/18QXXFJmU1hf9SDSPj6FjCyvYDI8gRVvgWfXKJnsxhO5MRBwHl2gwyAsMd9oYc5ZDU8S2Mvaroi1wRzVmxm6q+/cdvGu2E3X7/D+64nKrwHMagypgkV8ZvVKMT40VAF5giKSM6c8mVKCXVPbls5baeJiXdyE2YlEN8DOjwpuuTWpK7eCU14K7lCUWYdOqrMxiFWRCulCmVg5Py+YsvMVFiEydxKid8XKt7Fd6Q6ySXgELPm0ihp5oz8yyO32Mqi6cJr4fN2hDxjIHjEZcupZXn4bYgWjjDEvoNkElIERbbeHCaPMoxeySWG5vUIWfFMyAziwwgHTEsoM7qnVMcHtIKF+Vg2AlcgfmG5TER2O0ckJibJ2RQfSbfDaE29A8fkot6EYa/SqMNM1OvMa1+RzkovkJ2Gm/uzlP2n+1c2fzrO6wEKv7R4Ya5BX17Z+dtjfD8z8YjUeA3BlX8/tx9wRAQQU1lq/UlXSKYnmWULUKhC92Poq8weDKzlt+fbLgNsgBpQVvq6/zuvBYc7ZB370stYHUtw/CLXwf1wjsiz0dWLF+OztUO+WSkbPz4= X-Forefront-Antispam-Report: CIP:12.22.5.236;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(40470700002)(1076003)(83380400001)(508600001)(36860700001)(70586007)(356005)(6916009)(54906003)(81166007)(36756003)(336012)(82310400004)(19627235002)(70206006)(7696005)(316002)(6666004)(2906002)(47076005)(8936002)(4326008)(26005)(5660300002)(107886003)(86362001)(2616005)(186003)(8676002)(426003)(40460700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2021 08:55:41.8888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 69ed807e-ca36-4a45-161c-08d9caa8fe58 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.236];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2588 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Maher Sanalla NDR(106.25 Gbps) support exposed new data rates: 800 Gbps - NDR 8x. 1200 Gbps - NDR 12x. The NDR support bit from PortInfo.CapabilityMask2 was added to libibmad as well as the new link speeds mentioned above. validate_extended_speed() function in infiniband-diags was adjusted to validate NDR speed. Reference: IB Spec Release 1.5 Signed-off-by: Maher Sanalla Signed-off-by: Yishai Hadas --- infiniband-diags/ibportstate.c | 8 +++++++- libibmad/iba_types.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/infiniband-diags/ibportstate.c b/infiniband-diags/ibportstate.c index 7f3afb8..5319e68 100644 --- a/infiniband-diags/ibportstate.c +++ b/infiniband-diags/ibportstate.c @@ -353,7 +353,13 @@ static void validate_speed(int peerspeed, int lsa) static void validate_extended_speed(int peerespeed, int lsea) { - if ((espeed & peerespeed & 0x4)) { + + if ((espeed & peerespeed & 0x8)) { + if (lsea != 8) + IBWARN + ("Peer ports operating at active extended speed %d rather than 8 (106.25 Gbps)", + lsea); + } else if ((espeed & peerespeed & 0x4)) { if (lsea != 4) IBWARN ("Peer ports operating at active extended speed %d rather than 4 (53.125 Gbps)", diff --git a/libibmad/iba_types.h b/libibmad/iba_types.h index 0805aa9..f0c15ef 100644 --- a/libibmad/iba_types.h +++ b/libibmad/iba_types.h @@ -749,6 +749,7 @@ typedef struct { #define IB_PORT_CAP2_IS_SWITCH_PORT_STATE_TBL_SUPP htobe16(0x0008) #define IB_PORT_CAP2_IS_LINK_WIDTH_2X_SUPPORTED htobe16(0x0010) #define IB_PORT_CAP2_IS_LINK_SPEED_HDR_SUPPORTED htobe16(0x0020) +#define IB_PORT_CAP2_IS_LINK_SPEED_NDR_SUPPORTED htobe16(0x0400) typedef struct { __be32 cap_mask; __be16 fec_mode_active; @@ -803,6 +804,8 @@ typedef struct { #define IB_PATH_RECORD_RATE_50_GBS 20 #define IB_PATH_RECORD_RATE_400_GBS 21 #define IB_PATH_RECORD_RATE_600_GBS 22 +#define IB_PATH_RECORD_RATE_800_GBS 23 +#define IB_PATH_RECORD_RATE_1200_GBS 24 #define FDR10 0x01 typedef struct { uint8_t resvd1[3]; From patchwork Wed Dec 29 08:55:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12700799 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 1468BC433EF for ; Wed, 29 Dec 2021 08:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239424AbhL2Izq (ORCPT ); Wed, 29 Dec 2021 03:55:46 -0500 Received: from mail-mw2nam12on2042.outbound.protection.outlook.com ([40.107.244.42]:55456 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239412AbhL2Izq (ORCPT ); Wed, 29 Dec 2021 03:55:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QDOoqhbwJVkQn3WXVpL+HXUx8ypRyvmvtOoH6RHANriYTrqq3uKQE55FCpdF7hIwZ/qPF1NtWtQBYPPEFa2qzvvNsihY+B9kXKDO50S2498NKZVsK7YJ4wSnwTlB1YJ2RqUAzOKW/zfaOAhmPodcQdVS8C7j0kwcPbgY3MVFThP2+PTfev06fKPwk2SInGjTIx59rErbdzUEpTwOzOFW3somsoJD0EeSZukj/fadRL+aHF7d9GmfE4TCYWGtLRU/mM7LdnGlnPkA+4ABWSQmdVs8DHch56KKiSqalCSfpqQuvP2elv+l3RJL2snXcZaIPVypRE/cw6x+HdMOauGPrg== 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=leBCODyVFOt7A0lN+Mv2DWMy9XvvxY0xsOwnmyScAyM=; b=P3f5EE1nuHPIOTIaUp2hoBpl8jiKW1dJwVKG2iaSzNBOXyEFQwFAFJ87AXaClHyR8qlYWO00ToHdmY1b3pP/7wjmLwfaVHArPpZ1USMJrgB8iAApgvzc/w46XDxkxaOIDrj6ufsMl0tTqJbciUuR4xkexf8ZFPCCDWTBLuSfTnBJykhmCcFDHMRr11FqY3Fv/kju9BLIJ/eCPSoyxYRX1M33N+LeJB9RGSn1i774f6Q+l+LIp/YY2OrIuOOKsQKEdfmiUMEfXTmH6D8wSoF+sekgbRvIxDNwUBPbDwJS+R5/bC277BEUDCI/ogQ9hyMwrL0OhCaISSWi4+6OkSAUfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=leBCODyVFOt7A0lN+Mv2DWMy9XvvxY0xsOwnmyScAyM=; b=adqZAhuIJcaak5J5gkEsSuX3BlgLcmGee909jkfu/2V8BUGJO1sNQRmo6E+t0Au7G2ucG4QxK1iW6BmnATWjVWtFU98fqXhhfmY03McLIn66IbLF47yqSqp1n/jPHQ/S3sNA66A9INaAomaExhGKXepURAckFWxbMXQJnPtXQVnZkQrh3vTi+/Mz2yKryuOnLF9iMLbvysAvyB3hIfxrpB4FXiDHsMnMLPsk4ct+BhrsZ2Zh47tkz1UgIVFW7rioLzefcaHes99Z9FA7V5l55sZY0TWRqWiqgoccOv90h8wFTJZKYnUszMkVNQ2REHE1sdMCvkJpTkdW3LuXshnhVg== Received: from DM6PR13CA0057.namprd13.prod.outlook.com (2603:10b6:5:134::34) by MWHPR12MB1839.namprd12.prod.outlook.com (2603:10b6:300:10b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Wed, 29 Dec 2021 08:55:44 +0000 Received: from DM6NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::31) by DM6PR13CA0057.outlook.office365.com (2603:10b6:5:134::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.13 via Frontend Transport; Wed, 29 Dec 2021 08:55:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT005.mail.protection.outlook.com (10.13.172.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4844.14 via Frontend Transport; Wed, 29 Dec 2021 08:55:44 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Dec 2021 08:55:43 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Dec 2021 08:55:43 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 29 Dec 2021 08:55:41 +0000 From: Yishai Hadas To: CC: , , , , Subject: [PATCH rdma-core 3/3] pyverbs: Extend support of NDR rates Date: Wed, 29 Dec 2021 10:55:02 +0200 Message-ID: <20211229085502.167651-4-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20211229085502.167651-1-yishaih@nvidia.com> References: <20211229085502.167651-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d0885c4-d104-42d4-309b-08d9caa8ffaa X-MS-TrafficTypeDiagnostic: MWHPR12MB1839:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZvsimKQcrs4XHrSsgG4prWlkT8t7tbzhB7KuN6FQx8S+vQ+DSWHDRNAQ5K072aDo+ETrv7+nC+ecaXByRqZWm0ZpIZFuJIuS50fRy9zSSRsVoKtZWekcl+k9gc8ECE9ae5S/C0f6R4VytrS1PoNCwQ6zN+ok9gDydrYxot23VGTNB8V/zZ7wlG3+/xGuaeVx68pAmRA9vX4SMu+e1ZtzNjfqC84WT6HMx/kRd9zA2hkYlyUnBcdDCYIc5arrJZHjru48DS5u+TAmuyUSLsqVsbLXbGi61/PKcUI1nXqAxCXj/srPlsVSRDd093KITGebXk+2wWaAF+wyDILVDIfIJws01ixtBzQvfY9zpTSUR97puOOM3nm7+5q0We7zk3BDCATYfKi1JIa+gz5lUZqM5PS4AbUSmupVM6CaKyzMN7bPuh4Ff7Ges6ebIS1yVm+dQNcYnDmomRBnQB+/eypM8kx9TPhnUCerPACCktI/Sh6GOQFZHM0Du+MPtgdx+1tWdlNBMxfUso0bqsPHQj+bA6Xwn6GEWWh+gO1hEPQ6HIu7YeN3GP8b08CaY4+IuJp176/hVP2UVEBeF6yGMEjUHrnI9IMgd/M2q22r4gGiELz9+CmsUppLvtr4K/G5PYu9oznK2BGnEraHITljea1oj1guSWArCy6WAuNS15bqgowlF+zzpvmMCjx2boOroZ24FWKnI/gGJOgdWh4B/XY1BvN2Q6VVxWi/A8YLkV/XJncFfLpNbkdmcjWLyALnetT6imUqTrB97qc6XaW+HpkVn8eZHbQIK55mITJH19ospMU= X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(40470700002)(4326008)(36756003)(36860700001)(186003)(5660300002)(8676002)(6916009)(26005)(2906002)(54906003)(316002)(107886003)(6666004)(86362001)(8936002)(1076003)(70586007)(508600001)(83380400001)(81166007)(82310400004)(336012)(356005)(7696005)(47076005)(426003)(2616005)(70206006)(40460700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2021 08:55:44.1196 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d0885c4-d104-42d4-309b-08d9caa8ffaa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1839 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Edward Srouji Add new NDR speed definitions/enums to support the new data rates. Signed-off-by: Edward Srouji --- pyverbs/device.pyx | 3 ++- pyverbs/libibverbs_enums.pxd | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyverbs/device.pyx b/pyverbs/device.pyx index 55d708e..6f68a68 100644 --- a/pyverbs/device.pyx +++ b/pyverbs/device.pyx @@ -1091,7 +1091,8 @@ def translate_port_cap_flags2(flags): e.IBV_PORT_VIRT_SUP: 'IBV_PORT_VIRT_SUP', e.IBV_PORT_SWITCH_PORT_STATE_TABLE_SUP: 'IBV_PORT_SWITCH_PORT_STATE_TABLE_SUP', e.IBV_PORT_LINK_WIDTH_2X_SUP: 'IBV_PORT_LINK_WIDTH_2X_SUP', - e.IBV_PORT_LINK_SPEED_HDR_SUP: 'IBV_PORT_LINK_SPEED_HDR_SUP'} + e.IBV_PORT_LINK_SPEED_HDR_SUP: 'IBV_PORT_LINK_SPEED_HDR_SUP', + e.IBV_PORT_LINK_SPEED_NDR_SUP: 'IBV_PORT_LINK_SPEED_NDR_SUP'} return str_from_flags(flags, l) diff --git a/pyverbs/libibverbs_enums.pxd b/pyverbs/libibverbs_enums.pxd index 93a0f13..b3ea226 100644 --- a/pyverbs/libibverbs_enums.pxd +++ b/pyverbs/libibverbs_enums.pxd @@ -74,6 +74,7 @@ cdef extern from '': IBV_PORT_SWITCH_PORT_STATE_TABLE_SUP IBV_PORT_LINK_WIDTH_2X_SUP IBV_PORT_LINK_SPEED_HDR_SUP + IBV_PORT_LINK_SPEED_NDR_SUP cpdef enum ibv_mtu: IBV_MTU_256