From patchwork Fri Nov 6 03:09:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Petrilin X-Patchwork-Id: 57960 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 nA60CIPA027633 for ; Fri, 6 Nov 2009 00:12:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759197AbZKFAMJ (ORCPT ); Thu, 5 Nov 2009 19:12:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759196AbZKFAMJ (ORCPT ); Thu, 5 Nov 2009 19:12:09 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:43190 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759194AbZKFAMH (ORCPT ); Thu, 5 Nov 2009 19:12:07 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yevgenyp@mellanox.co.il) with SMTP; 6 Nov 2009 02:17:59 +0200 Received: from [10.4.12.75] ([10.4.12.75]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 6 Nov 2009 02:12:11 +0200 Message-ID: <4AF39377.3000305@mellanox.co.il> Date: Fri, 06 Nov 2009 05:09:43 +0200 From: Yevgeny Petrilin User-Agent: Thunderbird 2.0.0.23 (X11/20090812) MIME-Version: 1.0 To: rdreier@cisco.com CC: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, liranl@mellanox.co.il, tziporet@mellanox.co.il, yevgenyp@mellanox.co.il Subject: [PATCH 15/25 v2] mlx4_core: multi-function interface setup X-OriginalArrivalTime: 06 Nov 2009 00:12:11.0486 (UTC) FILETIME=[C94BE7E0:01CA5E75] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/net/mlx4/intf.c b/drivers/net/mlx4/intf.c index 0e7eb10..f5f4523 100644 --- a/drivers/net/mlx4/intf.c +++ b/drivers/net/mlx4/intf.c @@ -88,8 +88,11 @@ int mlx4_register_interface(struct mlx4_interface *intf) mutex_lock(&intf_mutex); list_add_tail(&intf->list, &intf_list); - list_for_each_entry(priv, &dev_list, dev_list) - mlx4_add_device(intf, priv); + list_for_each_entry(priv, &dev_list, dev_list) { + /* CX1: master cannot run interfaces */ + if (!mlx4_is_master(&priv->dev)) + mlx4_add_device(intf, priv); + } mutex_unlock(&intf_mutex); @@ -135,11 +138,14 @@ int mlx4_register_device(struct mlx4_dev *dev) mutex_lock(&intf_mutex); list_add_tail(&priv->dev_list, &dev_list); - list_for_each_entry(intf, &intf_list, list) - mlx4_add_device(intf, priv); - + /* CX1: master cannot run interfaces */ + if (!mlx4_is_master(dev)) { + list_for_each_entry(intf, &intf_list, list) + mlx4_add_device(intf, priv); + } mutex_unlock(&intf_mutex); - mlx4_start_catas_poll(dev); + if (!mlx4_is_slave(dev)) + mlx4_start_catas_poll(dev); return 0; } @@ -149,7 +155,8 @@ void mlx4_unregister_device(struct mlx4_dev *dev) struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_interface *intf; - mlx4_stop_catas_poll(dev); + if (!mlx4_is_slave(dev)) + mlx4_stop_catas_poll(dev); mutex_lock(&intf_mutex); list_for_each_entry(intf, &intf_list, list)