From patchwork Thu Feb 18 17:23:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 80353 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1IHNWAu032700 for ; Thu, 18 Feb 2010 17:23:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758431Ab0BRRXu (ORCPT ); Thu, 18 Feb 2010 12:23:50 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:47579 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758103Ab0BRRXt (ORCPT ); Thu, 18 Feb 2010 12:23:49 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.co.il) with SMTP; 18 Feb 2010 19:23:47 +0200 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 18 Feb 2010 19:23:46 +0200 Date: Thu, 18 Feb 2010 19:23:54 +0200 From: Eli Cohen To: Roland Dreier Cc: Linux RDMA list , ewg Subject: [PATCHv8 03/11] IB/umad: Enable support only for IB ports Message-ID: <20100218172354.GD12286@mtls03> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 18 Feb 2010 17:23:46.0796 (UTC) FILETIME=[20BCB2C0:01CAB0BF] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17202.000 X-TM-AS-Result: No--2.689700-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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Feb 2010 17:23:51 +0000 (UTC) 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); }