From patchwork Tue Jan 5 10:32:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 70963 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o05AUSrd031466 for ; Tue, 5 Jan 2010 10:31:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753618Ab0AEKa5 (ORCPT ); Tue, 5 Jan 2010 05:30:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753624Ab0AEKa5 (ORCPT ); Tue, 5 Jan 2010 05:30:57 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:44250 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753087Ab0AEKa5 (ORCPT ); Tue, 5 Jan 2010 05:30:57 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.co.il) with SMTP; 5 Jan 2010 12:30:54 +0200 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 5 Jan 2010 12:30:53 +0200 Date: Tue, 5 Jan 2010 12:32:46 +0200 From: Eli Cohen To: Roland Dreier Cc: Linux RDMA list Subject: [PATCHv7 3/9] IB/umad: Enable support only for IB ports Message-ID: <20100105103246.GE31480@mtls03> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 05 Jan 2010 10:30:53.0101 (UTC) FILETIME=[2849D5D0:01CA8DF2] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17112.006 X-TM-AS-Result: No--4.046500-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/user_mad.c b/drivers/infiniband/core/user_mad.c index 7de0296..e962c5a 100644 --- a/drivers/infiniband/core/user_mad.c +++ b/drivers/infiniband/core/user_mad.c @@ -1138,8 +1138,9 @@ static void ib_umad_add_one(struct ib_device *device) for (i = s; i <= e; ++i) { umad_dev->port[i - s].umad_dev = umad_dev; - if (ib_umad_init_port(device, i, &umad_dev->port[i - s])) - goto err; + if (rdma_port_link_layer(device, i) == IB_LINK_LAYER_INFINIBAND) + if (ib_umad_init_port(device, i, &umad_dev->port[i - s])) + goto err; } ib_set_client_data(device, &umad_client, umad_dev); @@ -1148,7 +1149,8 @@ static void ib_umad_add_one(struct ib_device *device) err: while (--i >= s) - ib_umad_kill_port(&umad_dev->port[i - s]); + if (rdma_port_link_layer(device, i) == IB_LINK_LAYER_INFINIBAND) + ib_umad_kill_port(&umad_dev->port[i - s]); kref_put(&umad_dev->ref, ib_umad_release_dev); } @@ -1162,7 +1164,8 @@ static void ib_umad_remove_one(struct ib_device *device) return; for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) - ib_umad_kill_port(&umad_dev->port[i]); + if (rdma_port_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND) + ib_umad_kill_port(&umad_dev->port[i]); kref_put(&umad_dev->ref, ib_umad_release_dev); }