From patchwork Fri Feb 1 22:06:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10793819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4600922 for ; Fri, 1 Feb 2019 22:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C48A832ED9 for ; Fri, 1 Feb 2019 22:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7CC43328D; Fri, 1 Feb 2019 22:10:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A034832ED9 for ; Fri, 1 Feb 2019 22:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbfBAWIF (ORCPT ); Fri, 1 Feb 2019 17:08:05 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34477 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbfBAWID (ORCPT ); Fri, 1 Feb 2019 17:08:03 -0500 Received: by mail-pg1-f195.google.com with SMTP id d9so57158pgl.1; Fri, 01 Feb 2019 14:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LbwCkocaVeKZW46o1m4njjA34ZciXtRR3TEQF+D/wBU=; b=RFbBGgNSMA6OPWPHXUTOpWh/ElFGHNdZwtHYgjM61k3NqlIo9dpC1aLxyPM4V8B5uy VKgkSPbqCZVF89TOX5KKfknEYZkSAusJsz3zry5+OGxQqOLnod2HicqtQJSdjMp62FxU uFRVjsCTiOQ5LfQPA6xFh/aP2edW0aF5wki3f7oeGe260yH+EBt4rtV7ujyfDNOzbMiW pqAFHKx5EYwfqLAqBvVq1wOSfLvxPoafCjWmGLE3n/G06h2Cq33InUW/QhNB/GVkBR7E gGLDbQSzk+/7tJ74M1qU3STSgHY/CmB+U2F3NKlbaApqiHWdIITWfMBlA8EPxXUKNFM2 9iGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LbwCkocaVeKZW46o1m4njjA34ZciXtRR3TEQF+D/wBU=; b=G08xC/FWwBqSKke0ZK6OC5KAP1IgFaNaKb2+bIH+Oq0p1+b4l7l7voPrlBRrjya8u6 wF0JPUCNf/Z3vGvdD3kX9VCwjhSTY9HuDdjkj2Dyf1kc4pmPrjPEWxcYD9mn/D/amx3Z vPWHU9+tPgrEHTzhRKHsyXcGWSqElUOhh1QLdoJ+hX63OIlppcrY+rehU7+NHpOHK0ME VHuTFXe6jRea9JSLRiiggTQKiWmGTLVPBi0/z0IdZhMXewCLd4h84ZPc2uWIcsiO1MN3 4CIYUNAYecSS39OtLonixdapzrcb9e3bRfMORxXgPwEiD8HmU+qPdYWmx2hLiQ4/FK0E mfBg== X-Gm-Message-State: AJcUukccAzjxMkLEEwD3WqLXbhgt8zrQUH1/Pf81YE1OBoELNWjwttrZ b0unEB/8Ba8NTfTrKPCQ+jz8iRL4 X-Google-Smtp-Source: ALg8bN47oyaYouRemq/rIUKbK6tZSG2xrL3h7i78UEiZiMWmlflWy2C1l14xqAFJRhKqEasJI7PSsg== X-Received: by 2002:a63:7e1a:: with SMTP id z26mr36401986pgc.216.1549058882394; Fri, 01 Feb 2019 14:08:02 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 78sm11142208pft.184.2019.02.01.14.08.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 14:08:01 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Michael Chan , "David S. Miller" , Derek Chickles , Satanand Burla , Felix Manlunas , Saeed Mahameed , Leon Romanovsky , Jiri Pirko , Ido Schimmel , Alexandre Belloni , Microchip Linux Driver Support , Jakub Kicinski , Ioana Radulescu , Ioana Ciornei , Greg Kroah-Hartman , Ivan Vecera , Andrew Lunn , Vivien Didelot , Dirk van der Merwe , "Francois H. Theron" , Simon Horman , Quentin Monnet , Daniel Borkmann , Eric Dumazet , John Hurley , Edwin Peer , linux-kernel@vger.kernel.org (open list), linux-rdma@vger.kernel.org (open list:MELLANOX MLX5 core VPI driver), oss-drivers@netronome.com (open list:NETRONOME ETHERNET DRIVERS), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) Subject: [RFC net-next 01/13] switchdev: Add SWITCHDEV_PORT_ATTR_SET, SWITCHDEV_PORT_ATTR_GET Date: Fri, 1 Feb 2019 14:06:45 -0800 Message-Id: <20190201220657.30170-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190201220657.30170-1-f.fainelli@gmail.com> References: <20190201220657.30170-1-f.fainelli@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation for allowing switchdev enabled drivers to veto specific attribute settings from within the context of the caller, introduce a new switchdev notifier type for port attributes. Suggested-by: Ido Schimmel Signed-off-by: Florian Fainelli --- include/net/switchdev.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 63843ae5dc81..e62fb2693e00 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -145,6 +145,9 @@ enum switchdev_notifier_type { SWITCHDEV_VXLAN_FDB_ADD_TO_DEVICE, SWITCHDEV_VXLAN_FDB_DEL_TO_DEVICE, SWITCHDEV_VXLAN_FDB_OFFLOADED, + + SWITCHDEV_PORT_ATTR_SET, /* Blocking. */ + SWITCHDEV_PORT_ATTR_GET, /* Blocking. */ }; struct switchdev_notifier_info { @@ -167,6 +170,13 @@ struct switchdev_notifier_port_obj_info { bool handled; }; +struct switchdev_notifier_port_attr_info { + struct switchdev_notifier_info info; /* must be first */ + struct switchdev_attr *attr; + struct switchdev_trans *trans; + bool handled; +}; + static inline struct net_device * switchdev_notifier_info_to_dev(const struct switchdev_notifier_info *info) {