From patchwork Tue Aug 14 15:05:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1320961 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 6AC5B3FC81 for ; Tue, 14 Aug 2012 15:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756206Ab2HNPG0 (ORCPT ); Tue, 14 Aug 2012 11:06:26 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:55986 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756583Ab2HNPGV (ORCPT ); Tue, 14 Aug 2012 11:06:21 -0400 Received: by mail-ey0-f174.google.com with SMTP id c11so194980eaa.19 for ; Tue, 14 Aug 2012 08:06:20 -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=3HLAgC6dxwsQgtg7ndfinf+7PJEpYAeNNNVy1eiNd3Y=; b=DM8eDkQR5h9ooy0FH93ZsGTW2dOwJbopJgvs7fZ4CERGaoPLpZIjq+CM2q9psJVUZT 3Dcd2igpP5Ok+/PWROGMl3/vOdb4OTC4mW6jFLO3Nn42+iJHihSgN80rFBixOuwZFs9r UyMEiE3m4l5MwuE+2FxsN3Pl7bhELRCBSmdLZC/2J1nuoRlEHqtdsglskar/TdrzuhlX 2+BF1Cze9/1lzSFYioyt95bCC5O3MZCLMDLGB4ncZYKMiWoLobglKMLnK/MPe1OdBEcD w7wRSUTdbFziQ5GXKVrV0PGqCIpRPBzDp1YiJqqbg6DhFTbHC4f6dIBBwmdRl7H4DwMn iV7Q== Received: by 10.14.204.200 with SMTP id h48mr15791084eeo.7.1344956780353; Tue, 14 Aug 2012 08:06:20 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPS id m45sm7553123eep.16.2012.08.14.08.06.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Aug 2012 08:06:19 -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 v2 08/15] cxgb3: remove usage of dev->master Date: Tue, 14 Aug 2012 17:05:41 +0200 Message-Id: <1344956748-2099-9-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1344956748-2099-1-git-send-email-jiri@resnulli.us> References: <1344956748-2099-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQlvHA5avhHvIRf4GpmNwtncyWM+r3SUcPK9+ziPiGoxJoWLWkP/x8Aiuz1aMSuh/SH0FSra 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..720425d 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; } }