From patchwork Mon Apr 13 06:17:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 460658 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 707ED1402E8 for ; Mon, 13 Apr 2015 16:16:59 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=YAAgGQMF; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754100AbbDMGQy (ORCPT ); Mon, 13 Apr 2015 02:16:54 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36589 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbbDMGQr (ORCPT ); Mon, 13 Apr 2015 02:16:47 -0400 Received: by pabsx10 with SMTP id sx10so91884516pab.3 for ; Sun, 12 Apr 2015 23:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oHLg8A53r9YtwQeWhE7pFF3Ot6mBK/ukTmFJLYDtQps=; b=YAAgGQMFGn9dnTdaH6tO19yc1Xv61loYbA3/jFDOMP2Vu11kNZeotjXPJ6O1tuOjg8 mzHZR3TNNZcFEPtSt4Jg2XorQ7AlvQwYwiVH1lZ5sj+aQHliu92HNk1W+12nWG3Uj+Qk pH4RFIvdo2cPSLsdE2mfMy8e/mrHMj97h6L1GkelHws+BY+1N4hu0OUEOKGNqxbFCu7X O/G6XMDKEks0nNorUweCFjZErq4pgEUtrbyvo0CCSWpTFQmbLysfAyXOUtsk/WfbGl+J ikSVZtIXTUftO37yZ35oxnt3pSafD655JOChYBRDnxNSLFKlacmpYPRrtaTy/yckc9RO ORGQ== X-Received: by 10.68.65.41 with SMTP id u9mr23573545pbs.155.1428905807135; Sun, 12 Apr 2015 23:16:47 -0700 (PDT) Received: from rocker1.home (static-50-53-122-54.bvtn.or.frontiernet.net. [50.53.122.54]) by mx.google.com with ESMTPSA id qc9sm6090095pab.19.2015.04.12.23.16.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2015 23:16:46 -0700 (PDT) From: sfeldma@gmail.com To: netdev@vger.kernel.org Cc: jiri@resnulli.us, roopa@cumulusnetworks.com, linux@roeck-us.net, f.fainelli@gmail.com, sridhar.samudrala@intel.com, ronen.arad@intel.com, andrew@lunn.ch Subject: [PATCH net-next v4 14/24] switchdev: add new swdev_port_bridge_dellink Date: Sun, 12 Apr 2015 23:17:08 -0700 Message-Id: <1428905838-14920-15-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1428905838-14920-1-git-send-email-sfeldma@gmail.com> References: <1428905838-14920-1-git-send-email-sfeldma@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Scott Feldman Same change as setlink. Provide the wrapper op for SELF ndo_bridge_dellink and call into the swdev driver to delete afspec VLANs. Signed-off-by: Scott Feldman --- include/net/switchdev.h | 8 ++++++++ net/switchdev/switchdev.c | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 70874fc..5443c9b 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -123,6 +123,8 @@ int swdev_port_obj_add(struct net_device *dev, struct swdev_obj *obj); int swdev_port_obj_del(struct net_device *dev, struct swdev_obj *obj); int swdev_port_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags); +int swdev_port_bridge_dellink(struct net_device *dev, struct nlmsghdr *nlh, + u16 flags); int register_netdev_switch_notifier(struct notifier_block *nb); int unregister_netdev_switch_notifier(struct notifier_block *nb); int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev, @@ -169,6 +171,12 @@ static inline int swdev_port_bridge_setlink(struct net_device *dev, return -EOPNOTSUPP; } +static inline int swdev_port_bridge_dellink(struct net_device *dev, + struct nlmsghdr *nlh, u16 flags) +{ + return -EOPNOTSUPP; +} + static inline int register_netdev_switch_notifier(struct notifier_block *nb) { return 0; diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 6691537..febd67e 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -523,6 +523,30 @@ int swdev_port_bridge_setlink(struct net_device *dev, EXPORT_SYMBOL_GPL(swdev_port_bridge_setlink); /** + * swdev_port_bridge_dellink - Set bridge port attributes + * + * @dev: port device + * @nlh: netlink header + * @flags: netlink flags + * + * Called for SELF on rtnl_bridge_dellink to set bridge port + * attributes. + */ +int swdev_port_bridge_dellink(struct net_device *dev, + struct nlmsghdr *nlh, u16 flags) +{ + struct nlattr *afspec; + + afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), + IFLA_AF_SPEC); + if (afspec) + return swdev_port_br_afspec(dev, afspec, swdev_port_obj_del); + + return 0; +} +EXPORT_SYMBOL_GPL(swdev_port_bridge_dellink); + +/** * netdev_switch_port_bridge_dellink - Notify switch device port of bridge * port attribute delete *