From patchwork Mon Aug 13 15:27:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1313721 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 42ED13FC81 for ; Mon, 13 Aug 2012 15:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752852Ab2HMP1n (ORCPT ); Mon, 13 Aug 2012 11:27:43 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:55454 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752744Ab2HMP1j (ORCPT ); Mon, 13 Aug 2012 11:27:39 -0400 Received: by mail-ee0-f46.google.com with SMTP id l10so1192511eei.19 for ; Mon, 13 Aug 2012 08:27:38 -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=3/bS8wzTETAc8XGBiq4Xf4EFr5MJmgehUB82TSjb3e4=; b=QFlbnBAbHO2XNB0kADbuIUn4GMzXzPoQJ3zJ06533VMdg/xKFnrSSsjEhmxkGEavEh eHq4fGQDQTqwL3KTFgAPXxNcHuevmnSHFU7IWsZ5fqotBtnwOFNMC1pAb4dv4B6a3qcG P1G8d6YBTivn4Hsr6wcQX1Ftg1elDUfc+6pVllSw62OdhyXNdg1WCJmB2jKXnWltp+6Q uoRv9zXSR4wMBDmr9qHoCQXxHx5KzNVh5E2+foBa4Ep+uLOSoiJYTBQbYdecaycxuKjF PfbSRCrYD9jSozM41QuHqw7eOGM3Hz78vAEpl0LnlZL8wfoCDm46hri9VUNe8zylPSnI c2dw== Received: by 10.14.5.67 with SMTP id 43mr14497407eek.15.1344871658700; Mon, 13 Aug 2012 08:27:38 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPS id 45sm19851718eeb.8.2012.08.13.08.27.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Aug 2012 08:27:38 -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 07/16] netpoll: remove usage of dev->master Date: Mon, 13 Aug 2012 17:27:06 +0200 Message-Id: <1344871635-1052-8-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: ALoCoQkJgXK+IPyCynqZyhc6+ikb0ONbRff9E9cpixQJV6Aa4up+K2cc2c5gLP8TcIYhO/UdA2vs Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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..5c8e560 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_unique_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_unique_upper_dev_get(ndev)) { np_err(np, "%s is a slave device, aborting\n", np->dev_name); err = -EBUSY; goto put;