From patchwork Wed Jan 2 12:28:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1923291 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 94B863FF0F for ; Wed, 2 Jan 2013 12:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752750Ab3ABMbN (ORCPT ); Wed, 2 Jan 2013 07:31:13 -0500 Received: from mail-ea0-f177.google.com ([209.85.215.177]:57364 "EHLO mail-ea0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785Ab3ABM3L (ORCPT ); Wed, 2 Jan 2013 07:29:11 -0500 Received: by mail-ea0-f177.google.com with SMTP id c10so5670950eaa.8 for ; Wed, 02 Jan 2013 04:29:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=bwzWexeRHdeI52ebDEwSnOaYwiBkAqC5lDaFiAMfZcQ=; b=ZFYK7I3Xb6CWTXyB+dagPe1MQINVnCQBv+Dgo74Ov6ZITQMIlIhRWuu6kx+pweMlNK 341zG3PthoruMld3gIqlBPJwzDYbiSz8fBI1WhCowRw1UCtVIOqmSQMUgp85EWZfHVaX fKpKT0vsLMxreR34xf59d/DS8P1eNAxlzuDhCzvzena1DVDrvShIBaK+vYiMf3Ez447I b5+b+JRiub/wB3U5o+uvXNU6DVHrIqzLV0dD30dN4YQM9ChVZyN4V9kHmJG1flXOql8S 7Zzvgn3KtxDzKlcQgy+o7FiouOEVBafK8T2XuEjmAaGrWBEQ+oFdr3elnw4lQ624f+Dx bNTw== X-Received: by 10.14.2.66 with SMTP id 42mr125758458eee.7.1357129750334; Wed, 02 Jan 2013 04:29:10 -0800 (PST) Received: from localhost (sun-0.pirko.cz. [84.16.102.25]) by mx.google.com with ESMTPS id b49sm97356157eem.16.2013.01.02.04.29.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 04:29:09 -0800 (PST) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, faisal.latif@intel.com, roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, fubar@us.ibm.com, andy@greyhouse.net, divy@chelsio.com, jitendra.kalsaria@qlogic.com, sony.chacko@qlogic.com, linux-driver@qlogic.com, kaber@trash.net, ursula.braun@de.ibm.com, blaschka@linux.vnet.ibm.com, linux390@de.ibm.com, shemminger@vyatta.com, bhutchings@solarflare.com, therbert@google.com, xiyou.wangcong@gmail.com, joe@perches.com, gregory.v.rose@intel.com, john.r.fastabend@intel.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, bridge@lists.linux-foundation.org, fbl@redhat.com Subject: [patch net-next V5 08/15] cxgb3: remove usage of dev->master Date: Wed, 2 Jan 2013 13:28:29 +0100 Message-Id: <1357129716-2450-9-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1357129716-2450-1-git-send-email-jiri@resnulli.us> References: <1357129716-2450-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQlhgzQ7Crvdh0Asj2SerPR/M9vbF97UxFBlGAOVWG17v9h5zj2V4gaWke0wC2AKHM8OkYXl Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Jiri Pirko --- drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c index 942dace..3f1f501 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c @@ -182,14 +182,17 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter, struct net_device *dev = adapter->port[i]; if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) { + rcu_read_lock(); if (vlan && vlan != VLAN_VID_MASK) { - rcu_read_lock(); dev = __vlan_find_dev_deep(dev, vlan); - rcu_read_unlock(); } else if (netif_is_bond_slave(dev)) { - while (dev->master) - dev = dev->master; + struct net_device *upper_dev; + + while ((upper_dev = + netdev_master_upper_dev_get_rcu(dev))) + dev = upper_dev; } + rcu_read_unlock(); return dev; } }