Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756594Ab2HNPGV (ORCPT ); Tue, 14 Aug 2012 11:06:21 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:40617 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756573Ab2HNPGS (ORCPT ); Tue, 14 Aug 2012 11:06:18 -0400 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 07/15] netpoll: remove usage of dev->master Date: Tue, 14 Aug 2012 17:05:40 +0200 Message-Id: <1344956748-2099-8-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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1257 Lines: 44 Signed-off-by: Jiri Pirko --- net/core/netpoll.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/core/netpoll.c b/net/core/netpoll.c index b4c90e4..1f457a6 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -207,12 +207,16 @@ static void netpoll_poll_dev(struct net_device *dev) if (dev->flags & IFF_SLAVE) { if (dev->npinfo) { - struct net_device *bond_dev = dev->master; + struct net_device *bond_dev; struct sk_buff *skb; + + rcu_read_lock(); + bond_dev = netdev_master_upper_dev_get_rcu(dev); while ((skb = skb_dequeue(&dev->npinfo->arp_tx))) { skb->dev = bond_dev; skb_queue_tail(&bond_dev->npinfo->arp_tx, skb); } + rcu_read_unlock(); } } @@ -795,7 +799,7 @@ int netpoll_setup(struct netpoll *np) return -ENODEV; } - if (ndev->master) { + if (netdev_master_upper_dev_get(ndev)) { np_err(np, "%s is a slave device, aborting\n", np->dev_name); err = -EBUSY; goto put; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/