From patchwork Tue Aug 14 15:05:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1320971 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 1FBE03FC81 for ; Tue, 14 Aug 2012 15:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756576Ab2HNPGU (ORCPT ); Tue, 14 Aug 2012 11:06:20 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:56018 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756539Ab2HNPGS (ORCPT ); Tue, 14 Aug 2012 11:06:18 -0400 Received: by mail-ey0-f174.google.com with SMTP id c11so194842eaa.19 for ; Tue, 14 Aug 2012 08:06:17 -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=aGU1Auf0NOj+e/a1EGtRmYc8rNgD0c8pCO5PbYJN5zM=; b=YiTE4U5+sErDAspM21GFfcBBvcABsCWpehlDm7921Oc1pFY4b3WnJ7oqMFJhht+LRj BvU9hZyjf2BMBSKHyPfVsAgIT3UPXFHuT4vgI+/iiYXxmN+bv4vOW9rWS3L8KpnorAah BfCqoujdUbgnjxHGjpM8lhLqXfgH1FQ1p8fmdKAhBWkWhXVIpF9jkdhZ/jzsNs5kyrZD jJNFun4+g/Ka9THihLGHNKSqSkV9wdgUHY0WmlaXdUaTZiYyMfY5PdE85PAM46/MtAaW L7Z3Tzjh4UgM8scpb3UPBmno+Ym/cRKmuFMlz8DQLfydLvZLNyg64mqia7qbNuHUJHNl 3CUQ== Received: by 10.14.182.134 with SMTP id o6mr19773902eem.26.1344956776886; Tue, 14 Aug 2012 08:06:16 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPS id l42sm7626139eep.1.2012.08.14.08.06.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Aug 2012 08:06:16 -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 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> X-Gm-Message-State: ALoCoQlvZA2mXP9I5CtBI4Fja6PhqtM/J4rWEhMuCWuwRdQW0FT1JGf7RHsXS6I/I8fsKOdkdJl7 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..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;