From patchwork Tue Dec 17 16:56:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3362821 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B66A2C0D4A for ; Tue, 17 Dec 2013 16:57:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F2B320381 for ; Tue, 17 Dec 2013 16:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B36812031C for ; Tue, 17 Dec 2013 16:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753671Ab3LQQ45 (ORCPT ); Tue, 17 Dec 2013 11:56:57 -0500 Received: from alln-iport-5.cisco.com ([173.37.142.92]:36752 "EHLO alln-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753246Ab3LQQ45 convert rfc822-to-8bit (ORCPT ); Tue, 17 Dec 2013 11:56:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2905; q=dns/txt; s=iport; t=1387299416; x=1388509016; h=from:to:subject:date:message-id:content-id: content-transfer-encoding:mime-version; bh=MbwVQjYHEevVjrf3DouE/EcJrykgpVNS+azo3NI2pJ8=; b=mu6ws45O9nxjAAd9XxOBPvZU2cNmJPZaIaYMMdE5vaPbrt6RMyDTPRsP iqB13lNmIgOr9inXm07LnO5r2h/nwhdC0/OAqNoMs0KtvXF6IvWRd6EqN geE/jm6HhDoObdzXzr6ctIeK/mojTMdzyV6j0s6OqqIwtC87v5L7c2JS5 4=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkFANCBsFKtJXHA/2dsb2JhbABZgwqBDaZskxsWdIIsJxNRAT5CJwQTiASiBKdrF5I8gRMEmBaSFIMrgio X-IronPort-AV: E=Sophos;i="4.95,502,1384300800"; d="scan'208";a="7409950" Received: from rcdn-core2-5.cisco.com ([173.37.113.192]) by alln-iport-5.cisco.com with ESMTP; 17 Dec 2013 16:56:56 +0000 Received: from xhc-aln-x03.cisco.com (xhc-aln-x03.cisco.com [173.36.12.77]) by rcdn-core2-5.cisco.com (8.14.5/8.14.5) with ESMTP id rBHGuuFa025532 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 17 Dec 2013 16:56:56 GMT Received: from xmb-rcd-x09.cisco.com ([169.254.9.86]) by xhc-aln-x03.cisco.com ([173.36.12.77]) with mapi id 14.03.0123.003; Tue, 17 Dec 2013 10:56:56 -0600 From: "Upinder Malhi (umalhi)" To: "" Subject: [PATCH] libibverbs: Add support for usNIC node and transport Thread-Topic: [PATCH] libibverbs: Add support for usNIC node and transport Thread-Index: AQHO+0j9kQ7u2diGqUCtkYWJ9Tb9lw== Date: Tue, 17 Dec 2013 16:56:55 +0000 Message-ID: <3A16F43E-69AF-42D7-959E-9A979D2974E4@cisco.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.155.161.43] Content-ID: <2AC9CD628CE52D40B8C765ADFBE04AB0@emea.cisco.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 180771a3707a4c0577cbf4f830c754dbabfdfccb adds core support for usNIC node and transport in the kernel. This patch adds the corresponding support to libibverbs. Signed-off-by: Upinder Malhi --- examples/devinfo.c | 1 + include/infiniband/verbs.h | 6 ++++-- src/enum_strs.c | 5 +++-- src/init.c | 5 ++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/devinfo.c b/examples/devinfo.c index ff078e4..479c513 100644 --- a/examples/devinfo.c +++ b/examples/devinfo.c @@ -72,6 +72,7 @@ static const char *transport_str(enum ibv_transport_type transport) switch (transport) { case IBV_TRANSPORT_IB: return "InfiniBand"; case IBV_TRANSPORT_IWARP: return "iWARP"; + case IBV_TRANSPORT_USNIC: return "usNIC"; default: return "invalid transport"; } } diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index 4b1ab57..38cea25 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -68,13 +68,15 @@ enum ibv_node_type { IBV_NODE_CA = 1, IBV_NODE_SWITCH, IBV_NODE_ROUTER, - IBV_NODE_RNIC + IBV_NODE_RNIC, + IBV_NODE_USNIC, }; enum ibv_transport_type { IBV_TRANSPORT_UNKNOWN = -1, IBV_TRANSPORT_IB = 0, - IBV_TRANSPORT_IWARP + IBV_TRANSPORT_IWARP, + IBV_TRANSPORT_USNIC, }; enum ibv_device_cap_flags { diff --git a/src/enum_strs.c b/src/enum_strs.c index 54d71a6..971a82f 100644 --- a/src/enum_strs.c +++ b/src/enum_strs.c @@ -38,10 +38,11 @@ const char *ibv_node_type_str(enum ibv_node_type node_type) [IBV_NODE_CA] = "InfiniBand channel adapter", [IBV_NODE_SWITCH] = "InfiniBand switch", [IBV_NODE_ROUTER] = "InfiniBand router", - [IBV_NODE_RNIC] = "iWARP NIC" + [IBV_NODE_RNIC] = "iWARP NIC", + [IBV_NODE_USNIC] = "usNIC", }; - if (node_type < IBV_NODE_CA || node_type > IBV_NODE_RNIC) + if (node_type < IBV_NODE_CA || node_type > IBV_NODE_USNIC) return "unknown"; return node_type_str[node_type]; diff --git a/src/init.c b/src/init.c index 8e93f3f..3583955 100644 --- a/src/init.c +++ b/src/init.c @@ -346,7 +346,7 @@ static struct ibv_device *try_driver(struct ibv_driver *driver, dev->node_type = IBV_NODE_UNKNOWN; } else { dev->node_type = strtol(value, NULL, 10); - if (dev->node_type < IBV_NODE_CA || dev->node_type > IBV_NODE_RNIC) + if (dev->node_type < IBV_NODE_CA || dev->node_type > IBV_NODE_USNIC) dev->node_type = IBV_NODE_UNKNOWN; } @@ -359,6 +359,9 @@ static struct ibv_device *try_driver(struct ibv_driver *driver, case IBV_NODE_RNIC: dev->transport_type = IBV_TRANSPORT_IWARP; break; + case IBV_NODE_USNIC: + dev->transport_type = IBV_TRANSPORT_USNIC; + break; default: dev->transport_type = IBV_TRANSPORT_UNKNOWN; break;