From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=PQg9HVQIYqiPsBwNT6JyGAohQPDs6z9iGbY5s51mdrw=; b=ZwS5j/uZEMcNgCdr8yv+ssv1acxc44jSUPbaB6Q91l1WV9isJ9z5InSfE3H+wLUA41 j5s3vsO4dpBviOR+nqGoDneWW5nrrZDXjv/psPVGfeM9V3pLLeAPzEb+gs7Pzga/+ZUj 8xKNsKElta/VzPA1L2wp45Gp+LdElW7aRYeK6S1jJbd2XWyJRzlA22aSroU4w1y+NfLp xa6keB/3cr1cTxnRCUSKxPEIuYbMiyez+c8ynjXdqbJyzoRXdCkf4DU+aJbiaEnm9owq iHUxyigI1HfVBLZeYd5kQrMjZRhbA44YoUme2C1J/74rpCAknfeEBTDrnr4DbAfQL+qg drCg== From: Florian Fainelli Date: Tue, 26 Feb 2019 17:14:23 -0800 Message-Id: <20190227011427.16487-5-f.fainelli@gmail.com> In-Reply-To: <20190227011427.16487-1-f.fainelli@gmail.com> References: <20190227011427.16487-1-f.fainelli@gmail.com> Subject: [Bridge] [PATCH net-next v2 4/8] mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_ATTR_SET List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: netdev@vger.kernel.org Cc: "open list:STAGING SUBSYSTEM" , andrew@lunn.ch, Florian Fainelli , "moderated list:ETHERNET BRIDGE" , open list , vivien.didelot@gmail.com, Ido Schimmel , jiri@mellanox.com, "David S. Miller" Following patches will change the way we communicate setting a port's attribute and use a notifier to perform those tasks. Prepare mlxsw to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and utilize the switchdev_handle_port_attr_set() to handle stacking of devices. Signed-off-by: Florian Fainelli --- .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index 766f5b5f1cf5..c1aedfea3a31 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -3123,6 +3123,13 @@ static int mlxsw_sp_switchdev_event(struct notifier_block *unused, struct net_device *br_dev; int err; + if (event == SWITCHDEV_PORT_ATTR_SET) { + err = switchdev_handle_port_attr_set(dev, ptr, + mlxsw_sp_port_dev_check, + mlxsw_sp_port_attr_set); + return notifier_from_errno(err); + } + /* Tunnel devices are not our uppers, so check their master instead */ br_dev = netdev_master_upper_dev_get_rcu(dev); if (!br_dev) @@ -3446,6 +3453,11 @@ static int mlxsw_sp_switchdev_blocking_event(struct notifier_block *unused, mlxsw_sp_port_dev_check, mlxsw_sp_port_obj_del); return notifier_from_errno(err); + case SWITCHDEV_PORT_ATTR_SET: + err = switchdev_handle_port_attr_set(dev, ptr, + mlxsw_sp_port_dev_check, + mlxsw_sp_port_attr_set); + return notifier_from_errno(err); } return NOTIFY_DONE; -- 2.17.1