From patchwork Mon Aug 13 15:27:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1313741 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 31E9FDF223 for ; Mon, 13 Aug 2012 15:31:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752990Ab2HMPaw (ORCPT ); Mon, 13 Aug 2012 11:30:52 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:59946 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817Ab2HMP1m (ORCPT ); Mon, 13 Aug 2012 11:27:42 -0400 Received: by mail-ey0-f174.google.com with SMTP id c11so1186783eaa.19 for ; Mon, 13 Aug 2012 08:27:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=sG1qqJSeKiaD9N0H1R1XC7ai0vsT6v+cXFleV0RVzrU=; b=Tz1xbSOzWf0NngYzRdq+qYLk3w0VSWW2q73YVr7PPe8mRXO1EjCykJyJnksZ1N92Vn UvwgrE0zgCt94CkByucTlNji5JlBwXPU3wFBPH76IZ3uS+vinAqCvZWj9x+IKcxN0XEz mHiYLpSg1Sz0/Lukv4GWW9VOfRqTRcGtE8KzUVr/bgJcOwDzEmOOdxF/5iEtNIkwJDoP JFaamckVl2KlE2PU4n+io1XYDCuYOS5NQGErdKj1VOSSHp54TQKQ7hqRyXgJUYt+qYSb S/LVvx3WGF2bPBqW8+D+jdDlnoR6yHl5r8UczlAzxYB4hA9wcH+vPFBN98bYCUPZdAFM 7JIQ== Received: by 10.14.213.137 with SMTP id a9mr10330408eep.38.1344871661178; Mon, 13 Aug 2012 08:27:41 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPS id k41sm19834743eep.13.2012.08.13.08.27.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Aug 2012 08:27:40 -0700 (PDT) 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 08/16] cxgb3: remove usage of dev->master Date: Mon, 13 Aug 2012 17:27:07 +0200 Message-Id: <1344871635-1052-9-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1344871635-1052-1-git-send-email-jiri@resnulli.us> References: <1344871635-1052-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQlNJRao4xY4ScHYK+QOEJVV3wewxhIGoXwha/1abLVgtHVxdLRJGjEjwrmeQJkgHkgJpKJf 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 2dbbcbb..28365db 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_unique_upper_dev_get_rcu(dev))) + dev = upper_dev; } + rcu_read_unlock(); return dev; } }