From patchwork Fri Jan 4 08:48:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1931611 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 167EF3FF0F for ; Fri, 4 Jan 2013 08:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754436Ab3ADIwa (ORCPT ); Fri, 4 Jan 2013 03:52:30 -0500 Received: from mail-ea0-f179.google.com ([209.85.215.179]:39061 "EHLO mail-ea0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754322Ab3ADItn (ORCPT ); Fri, 4 Jan 2013 03:49:43 -0500 Received: by mail-ea0-f179.google.com with SMTP id i12so6498567eaa.38 for ; Fri, 04 Jan 2013 00:49:42 -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=i1zJpscskrVlQrU6hipzXK+Hy+JxhW5gAR0ZQoARZ3FBX9zfaXpSLJVee/fqGJA1qp Jm31gvuS8bm0RmCLv2HNxW+slatWatNczpXMoxDnhNLbj0q2fEHc7dzE1s6peBSlEo9A wbR+PE26CqEl7KOjXZ01jn6YQNa0oQp+L22Vl188PC1YlIH5shCpInLG8wjOm2Lu/EIH C1kuMJTRPBR5k4mPf6oTG5uCuDT19yeiGh5kQXNvvhBpNfU6LYLwddrYlGJW1Fpk7hJw FjbpOuMjgE73AWnbzewC8KKLvns5wxGu0HEsyGGiKdJOzRcRTanwR9oWdiTePmK4dRQ4 1myw== X-Received: by 10.14.202.3 with SMTP id c3mr141884543eeo.4.1357289382157; Fri, 04 Jan 2013 00:49:42 -0800 (PST) Received: from localhost (ip-89-103-8-129.net.upcbroadband.cz. [89.103.8.129]) by mx.google.com with ESMTPS id b2sm109321598eep.9.2013.01.04.00.49.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 00:49:41 -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 V6 08/15] cxgb3: remove usage of dev->master Date: Fri, 4 Jan 2013 09:48:56 +0100 Message-Id: <1357289343-817-9-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1357289343-817-1-git-send-email-jiri@resnulli.us> References: <1357289343-817-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQkwTBcW6bFCZMz24xrE+RC9zc7HBLu+RlPWn27FxMjIKosguX4jcmT/05XXeN+VEvyBRsxN 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; } }