From patchwork Wed Apr 3 13:06:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Squyres X-Patchwork-Id: 2387301 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id EE254DFE76 for ; Wed, 3 Apr 2013 13:22:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760871Ab3DCNWe (ORCPT ); Wed, 3 Apr 2013 09:22:34 -0400 Received: from mtv-iport-2.cisco.com ([173.36.130.13]:1753 "EHLO mtv-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759753Ab3DCNWd (ORCPT ); Wed, 3 Apr 2013 09:22:33 -0400 X-Greylist: delayed 565 seconds by postgrey-1.27 at vger.kernel.org; Wed, 03 Apr 2013 09:22:32 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2886; q=dns/txt; s=iport; t=1364995353; x=1366204953; h=from:to:cc:subject:date:message-id; bh=NeKFltHL+I8OAF3ybiFdtdHdlTmvlWg6kfBiSbPDS3s=; b=i6MYfS+T89lNIJXvdz/EgfBUidxnGhAQH6psjEVZvHqSmwkrF/dI6kqx qUw9awbsnX/9KiLHK8a5/EfaHEnUAaDpnmS7DzO0r7gRuY3S5HFWxVKtT KB5icjIVWoPYOP309ymB6p7t8ECJ/0InG8asbR0FtXzOwPlcJEbBAx1O0 0=; X-IronPort-AV: E=Sophos;i="4.87,401,1363132800"; d="scan'208";a="77733020" Received: from mtv-core-4.cisco.com ([171.68.58.9]) by mtv-iport-2.cisco.com with ESMTP; 03 Apr 2013 13:13:06 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by mtv-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id r33DD67g011619; Wed, 3 Apr 2013 13:13:06 GMT Received: by cisco.com (Postfix, from userid 182726) id 188FD3FAA582; Wed, 3 Apr 2013 06:13:06 -0700 (PDT) From: Jeff Squyres To: linux-rdma@vger.kernel.org Cc: umalhi@cisco.com, Jeff Squyres Subject: [PATCH 1/4] Add IBV_*_USNIC enums for the Cisco Ethernet Virtual NIC. Date: Wed, 3 Apr 2013 06:06:52 -0700 Message-Id: <1364994415-8330-1-git-send-email-jsquyres@cisco.com> X-Mailer: git-send-email 1.8.1.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Per off-list conversation with Roland, add some new enums for the Cisco Ethernet Virtual NIC (it's not an RNIC/iWARP device, so it doesn't fit in the same category as RDMA_NODE_RNIC / RDMA_TRANSPORT_IWARP). "USNIC" = "Userspace NIC". --- 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 7dc0463..98a6b4b 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 6acfc81..6a6944c 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..0d68c75 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] = "Ethernet 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 8d6786e..e4ef001 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;