From patchwork Wed Jan 2 12:28:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 1923171 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 37AE23FE37 for ; Wed, 2 Jan 2013 12:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717Ab3ABM27 (ORCPT ); Wed, 2 Jan 2013 07:28:59 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:58455 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752755Ab3ABM2y (ORCPT ); Wed, 2 Jan 2013 07:28:54 -0500 Received: by mail-ee0-f46.google.com with SMTP id e53so6764460eek.19 for ; Wed, 02 Jan 2013 04:28:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=iRnoiD4cQy0NoR4++ky5SExW5gXfq7MEl16rohp5/EE=; b=XyqHCGi4ZIzm2oMDZmmY8nd6zQaTMZeOdkuhIi3v/vGmQK6P978QdTjSg+/lD4DGG5 spHyk2tmCVbP5nVOPa7v0GJv91O5EmwRIadU2Nk1csM58IsiNFTGHSA+TlSO5TyMvHlX iMYNJbjYPrG2JncRZqdoU3lDRURcVrZIh0S+Kaf1EYNMLZXS+FbFGT1A6s7SEB/xn6CU yePoxcNyO5xsn2Md0r1cgCHRbzp7obCb5tzEw2OZ4HHKtrNiqEn68ok650dKqW8+8Wzp F3fzRKacNe/T53OkJhIadyfOFvjOkq6xj5zmHaT84MUg4Fx3ak17s3s/WuyKuJ5ilh7M HpBg== X-Received: by 10.14.2.196 with SMTP id 44mr125079202eef.25.1357129733284; Wed, 02 Jan 2013 04:28:53 -0800 (PST) Received: from localhost (sun-0.pirko.cz. [84.16.102.25]) by mx.google.com with ESMTPS id l3sm97296199eem.14.2013.01.02.04.28.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 04:28:52 -0800 (PST) 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 V5 03/15] vlan: add link to upper device Date: Wed, 2 Jan 2013 13:28:24 +0100 Message-Id: <1357129716-2450-4-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1357129716-2450-1-git-send-email-jiri@resnulli.us> References: <1357129716-2450-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQloI8DMerXHGjPR6KpGhggbrMZAUScffwbV1+jpUOz5LvU7OstseW+SfwD4mmn/pmZrqN7J 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 a292e80..babfde9 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; +out_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);