From patchwork Wed Jan 22 03:18:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3521491 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 0686DC02DC for ; Wed, 22 Jan 2014 03:18:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F18FD2012E for ; Wed, 22 Jan 2014 03:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12F0820125 for ; Wed, 22 Jan 2014 03:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbaAVDSp (ORCPT ); Tue, 21 Jan 2014 22:18:45 -0500 Received: from mtv-iport-2.cisco.com ([173.36.130.13]:42094 "EHLO mtv-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265AbaAVDSo (ORCPT ); Tue, 21 Jan 2014 22:18:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3436; q=dns/txt; s=iport; t=1390360725; x=1391570325; h=from:to:cc:subject:date:message-id; bh=NxTGis8HtfpuPavktJXUHVB6wAmfca5YdR7kelp62zA=; b=NoHTmrUH02qilgV8cYHhzxQelbtowEIiENTKfnLgHbtLipyDmoIrRLfc //LXFdyA4kPXO8Oni2zUps5R/Y04EdMnDgw4JMoHHM67ZejaaEZKWsVVU qGHk3dRZweJFCSefJpTMpT8rBwBYJB1n+TqGKIiOs0xJ4EGOauG2ixeLW 4=; X-IronPort-AV: E=Sophos;i="4.95,697,1384300800"; d="scan'208";a="103617704" Received: from mtv-core-3.cisco.com ([171.68.58.8]) by mtv-iport-2.cisco.com with ESMTP; 22 Jan 2014 03:18:44 +0000 Received: from sjc-savbu-bld03.cisco.com (sjc-savbu-bld03.cisco.com [171.71.188.58]) by mtv-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id s0M3IiqJ018403; Wed, 22 Jan 2014 03:18:44 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id 2E73F3F5A7; Tue, 21 Jan 2014 19:18:44 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH v1] libibverbs: Add support for usNIC nodes and transports Date: Tue, 21 Jan 2014 19:18:41 -0800 Message-Id: <1390360721-14894-1-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-15.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 5db5765e255de4072eb0e35facfeafce53af001b and 180771a3707a4c0577cbf4f830c754dbabfdfccb on git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git add IB_NODE_USNIC[_UDP] and IB_TRANSPORT_USNIC[_UDP] support to the kernel. This patch adds the corresponding support in libibverbs. Signed-off-by: Upinder Malhi --- examples/devinfo.c | 8 +++++--- include/infiniband/verbs.h | 8 ++++++-- src/enum_strs.c | 6 ++++-- src/init.c | 8 +++++++- 4 files changed, 22 insertions(+), 8 deletions(-) -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/examples/devinfo.c b/examples/devinfo.c index ff078e4..afa8c85 100644 --- a/examples/devinfo.c +++ b/examples/devinfo.c @@ -70,9 +70,11 @@ static const char *guid_str(uint64_t node_guid, char *str) static const char *transport_str(enum ibv_transport_type transport) { switch (transport) { - case IBV_TRANSPORT_IB: return "InfiniBand"; - case IBV_TRANSPORT_IWARP: return "iWARP"; - default: return "invalid transport"; + case IBV_TRANSPORT_IB: return "InfiniBand"; + case IBV_TRANSPORT_IWARP: return "iWARP"; + case IBV_TRANSPORT_USNIC: return "usNIC"; + case IBV_TRANSPORT_USNIC_UDP: return "usNIC UDP"; + default: return "invalid transport"; } } diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index 4b1ab57..ff9a1aa 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -68,13 +68,17 @@ enum ibv_node_type { IBV_NODE_CA = 1, IBV_NODE_SWITCH, IBV_NODE_ROUTER, - IBV_NODE_RNIC + IBV_NODE_RNIC, + IBV_NODE_USNIC, + IBV_NODE_USNIC_UDP, }; enum ibv_transport_type { IBV_TRANSPORT_UNKNOWN = -1, IBV_TRANSPORT_IB = 0, - IBV_TRANSPORT_IWARP + IBV_TRANSPORT_IWARP, + IBV_TRANSPORT_USNIC, + IBV_TRANSPORT_USNIC_UDP, }; enum ibv_device_cap_flags { diff --git a/src/enum_strs.c b/src/enum_strs.c index 54d71a6..93ffe32 100644 --- a/src/enum_strs.c +++ b/src/enum_strs.c @@ -38,10 +38,12 @@ 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", + [IBV_NODE_USNIC_UDP] = "usNIC UDP", }; - if (node_type < IBV_NODE_CA || node_type > IBV_NODE_RNIC) + if (node_type < IBV_NODE_CA || node_type > IBV_NODE_USNIC_UDP) return "unknown"; return node_type_str[node_type]; diff --git a/src/init.c b/src/init.c index 8e93f3f..1724d81 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_UDP) dev->node_type = IBV_NODE_UNKNOWN; } @@ -359,6 +359,12 @@ 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; + case IBV_NODE_USNIC_UDP: + dev->transport_type = IBV_TRANSPORT_USNIC_UDP; + break; default: dev->transport_type = IBV_TRANSPORT_UNKNOWN; break;