From patchwork Tue Aug 14 15:05:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1320831 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 88D38E0000 for ; Tue, 14 Aug 2012 15:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756131Ab2HNPGi (ORCPT ); Tue, 14 Aug 2012 11:06:38 -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 S1756642Ab2HNPGd (ORCPT ); Tue, 14 Aug 2012 11:06:33 -0400 Received: by mail-ey0-f174.google.com with SMTP id c11so194842eaa.19 for ; Tue, 14 Aug 2012 08:06:32 -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=OsM0mIlEb9iSKMIJibzZ70HjKjuLsfwvbB98zCRqZAQ=; b=QMA5fE+ESXEdR/zYRbVVkTOu70W43DLCkTx4lQlMYb4+Ts0A7JXNi5gKcyd5jRhpUO enwCGxkzu0xgtnpU+z1nFrVODyoMwq9UKrMGD3QF1dzDxysEwEuxz2FOIECi0aNW4dfH hKPhGormnGb14PdWps29/G7AGapZ2KLzZqIWfV7ah4ZuD4SOZd5P8bQxiOg2faiE4ia6 Le9SmbWK/wYymBbEMfucLOYSxzUM89W+gUL1ByPeydtV1pPKylTQ/ZWUENI1ZlLJcQVy HqtSS0fzHMKsVv2t+YDyyubEjYvI38t6llTQTMXWkrFxyfqErbLIVFtpoUmdNc466Iag VGcA== Received: by 10.14.182.69 with SMTP id n45mr15687001eem.28.1344956792642; Tue, 14 Aug 2012 08:06:32 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPS id g46sm7540849eep.15.2012.08.14.08.06.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Aug 2012 08:06:31 -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 12/15] nes: remove usage of dev->master Date: Tue, 14 Aug 2012 17:05:45 +0200 Message-Id: <1344956748-2099-13-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: ALoCoQmbCD59V2kfT6dfya0Oe8fLwGYIY4HXy+vOcUs3fK1E5mH3nbf2WVqTB4T87bOSgDzA/5P/ 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/infiniband/hw/nes/nes.c | 8 +++++--- drivers/infiniband/hw/nes/nes_cm.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c index 7140199..6686251 100644 --- a/drivers/infiniband/hw/nes/nes.c +++ b/drivers/infiniband/hw/nes/nes.c @@ -140,6 +140,7 @@ static int nes_inetaddr_event(struct notifier_block *notifier, struct net_device *event_netdev = ifa->ifa_dev->dev; struct nes_device *nesdev; struct net_device *netdev; + struct net_device *upper_dev; struct nes_vnic *nesvnic; unsigned int is_bonded; @@ -150,8 +151,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier, nesdev, nesdev->netdev[0]->name); netdev = nesdev->netdev[0]; nesvnic = netdev_priv(netdev); + upper_dev = netdev_master_upper_dev_get(netdev); is_bonded = netif_is_bond_slave(netdev) && - (netdev->master == event_netdev); + (upper_dev == event_netdev); if ((netdev == event_netdev) || is_bonded) { if (nesvnic->rdma_enabled == 0) { nes_debug(NES_DBG_NETDEV, "Returning without processing event for %s since" @@ -184,9 +186,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier, /* fall through */ case NETDEV_CHANGEADDR: /* Add the address to the IP table */ - if (netdev->master) + if (upper_dev) nesvnic->local_ipaddr = - ((struct in_device *)netdev->master->ip_ptr)->ifa_list->ifa_address; + ((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address; else nesvnic->local_ipaddr = ifa->ifa_address; diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 020e95c..15e6340 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -1352,7 +1352,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi } if (netif_is_bond_slave(nesvnic->netdev)) - netdev = nesvnic->netdev->master; + netdev = netdev_unique_upper_dev_get(nesvnic->netdev); else netdev = nesvnic->netdev;