From patchwork Mon Aug 13 15:27:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1313821 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 0C3D5DF223 for ; Mon, 13 Aug 2012 15:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752434Ab2HMPby (ORCPT ); Mon, 13 Aug 2012 11:31:54 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:55463 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752394Ab2HMP12 (ORCPT ); Mon, 13 Aug 2012 11:27:28 -0400 Received: by mail-ey0-f174.google.com with SMTP id c11so1186782eaa.19 for ; Mon, 13 Aug 2012 08:27:27 -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=1TsDzyFa2oV8Kqx2Zl8f4PizUJpkMghTK24w9zJlhfs=; b=V8Fe/VMZm45yb1QJeYXi0qWz75y9l3RzotIXgtCD4Atrj73tA3wdqLXWPkG1fKb+xy 0r6yD16MnSKASXawTlNQo9baatphrKl1C7PLuSEXm4jICK6Sx6u+vyJkj7EhNKTpwc6Q t0N9G50jxBf4GNBp69k8jfPspnJ1yhamNQFwaYuFjBmv2Ma2xp8qK5BZNYtxHmie/2A8 oy6vFct++9BXoRn7Y3ue6esw4/ALABr6Y4Nyp81Mc/cNmMXax6yDx3BGn9HTR3rx3l8G sx8TbTw4BceQ+FWmg6OLMfeZQTgnrcBDFTWlAbTK/OcmM5WL5E+yZM9MMXGHy6GtXUTZ iT5w== Received: by 10.14.199.67 with SMTP id w43mr10370160een.33.1344871647794; Mon, 13 Aug 2012 08:27:27 -0700 (PDT) Received: from localhost (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPS id l42sm17661370eep.1.2012.08.13.08.27.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Aug 2012 08:27:27 -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 03/16] vlan: add link to upper device Date: Mon, 13 Aug 2012 17:27:02 +0200 Message-Id: <1344871635-1052-4-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: ALoCoQnMrx7/CiHBUKt53+3O3XLTt09Dhzaft4lLtK64AWKx7jtMGahkwYWOuiZQaqSZ1+EJD9Bj 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/8021q/vlan.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 9096bcb..739665e 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) */ unregister_netdevice_queue(dev, head); + netdev_upper_dev_unlink(real_dev, dev); + if (grp->nr_vlan_devs == 0) vlan_gvrp_uninit_applicant(real_dev); @@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev) if (err < 0) goto out_uninit_applicant; + err = netdev_upper_dev_link(real_dev, dev); + if (err) + goto out_uninit_applicant; + err = register_netdevice(dev); if (err < 0) - goto out_uninit_applicant; + goto out_upper_dev_unlink; /* Account for reference in struct vlan_dev_priv */ dev_hold(real_dev); @@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev) return 0; +upper_dev_unlink: + netdev_upper_dev_unlink(real_dev, dev); out_uninit_applicant: if (grp->nr_vlan_devs == 0) vlan_gvrp_uninit_applicant(real_dev);