From patchwork Mon Nov 16 15:53:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 60418 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAGFt2DU024732 for ; Mon, 16 Nov 2009 15:55:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750987AbZKPPzp (ORCPT ); Mon, 16 Nov 2009 10:55:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753216AbZKPPzp (ORCPT ); Mon, 16 Nov 2009 10:55:45 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:51576 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750987AbZKPPzo (ORCPT ); Mon, 16 Nov 2009 10:55:44 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.co.il) with SMTP; 16 Nov 2009 17:59:24 +0200 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 16 Nov 2009 17:52:34 +0200 Date: Mon, 16 Nov 2009 17:53:43 +0200 From: Eli Cohen To: Roland Dreier Cc: Linux RDMA list , netdev , ewg Subject: [PATCHv6 05/10] ib/cm: Enable CM support for RDMAoE Message-ID: <20091116155343.GF2463@mtls03> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 16 Nov 2009 15:52:34.0450 (UTC) FILETIME=[D0227720:01CA66D4] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17012.007 X-TM-AS-Result: No--5.862500-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index d082f59..c9f9122 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -3680,7 +3680,8 @@ static void cm_add_one(struct ib_device *ib_device) u8 i; enum rdma_transport_type tt; - if (!rdma_is_transport_supported(ib_device, RDMA_TRANSPORT_IB)) + if (!rdma_is_transport_supported(ib_device, RDMA_TRANSPORT_IB) && + !rdma_is_transport_supported(ib_device, RDMA_TRANSPORT_RDMAOE)) return; cm_dev = kzalloc(sizeof(*cm_dev) + sizeof(*port) * @@ -3702,7 +3703,7 @@ static void cm_add_one(struct ib_device *ib_device) set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask); for (i = 1; i <= ib_device->phys_port_cnt; i++) { tt = rdma_port_get_transport(ib_device, i); - if (tt != RDMA_TRANSPORT_IB) + if (tt != RDMA_TRANSPORT_IB && tt != RDMA_TRANSPORT_RDMAOE) continue; port = kzalloc(sizeof *port, GFP_KERNEL); diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index 43700b4..dce2cbb 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c @@ -1241,13 +1241,19 @@ static void ib_ucm_add_one(struct ib_device *device) { struct ib_ucm_device *ucm_dev; int i; + enum rdma_transport_type tt; if (!device->alloc_ucontext) return; - for (i = 1; i <= device->phys_port_cnt; ++i) - if (rdma_port_get_transport(device, i) != RDMA_TRANSPORT_IB) - return; + for (i = 1; i <= device->phys_port_cnt; ++i) { + tt = rdma_port_get_transport(device, i); + if (tt == RDMA_TRANSPORT_IB || tt == RDMA_TRANSPORT_RDMAOE) + break; + } + + if (i > device->phys_port_cnt) + return; ucm_dev = kzalloc(sizeof *ucm_dev, GFP_KERNEL); if (!ucm_dev)