Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp975708ima; Fri, 1 Feb 2019 14:08:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IaQyUFGPtaUA5FNuDDeXznBP4QvYnwT1WO9tABIPmOvRl59a5WVdhb0aZ9u6qkz7yzDQtaX X-Received: by 2002:a63:f658:: with SMTP id u24mr4017713pgj.267.1549058914051; Fri, 01 Feb 2019 14:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549058914; cv=none; d=google.com; s=arc-20160816; b=Lf8fGyyqHH3O6I92P8J3DqLwK1VBJwpKgCHEtRyLfwWQfy0epfSqG6h5jUJSQZlQWp bLZAUsfb9uxnZllhM0nHD66FOpmwvOwDk2QMm6jtgNbHJuizWEJLEB3KZS4ihsUHLApt XAq00cYt7+L1EThFT/F88byJwL7ayVrRbW4v1mv/KfOBKeWFCaLpnYbrmDDqgGjGf+ue g1htr2dQAOhRqLbNP7QpZ+A/o9gkq8qBywGVSh6Wx7UjOoWTtmdC5YqKoE4RGwm4GHbl Zdens5AiMFAYFC4z8Py4dqhsRfbpSNt+KcTdPlB7IJ8p1/yeRggZsAk+1hR8Ce4O86ZI ruGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LbwCkocaVeKZW46o1m4njjA34ZciXtRR3TEQF+D/wBU=; b=rpkJOlqrIkBQqTRSj137Xv3/QohpyL7OqQnU4lKsmsd+BFU9bObFmv8bCVpY1jDw24 YoKx16qXsZC3hp/usQqLBMXSRwYFU/vgL3qLKmD7PWBNDSLag3AlNGrgRuztpupjIfXk BarRAhqIt8/svTnxdPO2UlliLK7ayyTvrTNTHuaEoln9KQo+EdAUmKK+jhNBgEbl+snu OWgzExfUZ4ddkzdjPhNaL6mPSE9ENOIV2boUEzw0EMKyGKmz5/IqPwvFiJu9KdZ9c44A fSvNgrwWN+eN+5MALHt8nTQaG6FfRGxwecp22lGhTq5yVR+ob+Wv5dOSdI4Brni8tYgt lbUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RFbBGgNS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si8709969plr.67.2019.02.01.14.08.18; Fri, 01 Feb 2019 14:08:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RFbBGgNS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbfBAWIG (ORCPT + 99 others); Fri, 1 Feb 2019 17:08:06 -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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 2.17.1