From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Machata Subject: [PATCH net-next v3 7/7] mlxsw: spectrum_switchdev: Schedule respin during trans prepare Date: Mon, 28 May 2018 17:11:09 +0200 Message-ID: <2a209eed5c4366374bf940442d4da7c643a6682b.1527519997.git.petrm@mellanox.com> References: Mime-Version: 1.0 Content-Type: text/plain Cc: jiri@mellanox.com, idosch@mellanox.com, davem@davemloft.net, razvan.stefanescu@nxp.com, gregkh@linuxfoundation.org, stephen@networkplumber.org, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, nikolay@cumulusnetworks.com To: netdev@vger.kernel.org, devel@driverdev.osuosl.org, bridge@lists.linux-foundation.org Return-path: Received: from mail-db5eur01on0082.outbound.protection.outlook.com ([104.47.2.82]:61568 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1033811AbeE1PLR (ORCPT ); Mon, 28 May 2018 11:11:17 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Since there's no special support for the bridge events, the driver returns -EOPNOTSUPP, and thus the commit never happens. Therefore schedule respin during the prepare stage: there's no real difference one way or another. This fixes the problem that mirror-to-gretap offload wouldn't adapt to changes in bridge vlan configuration right away and another notification would have to arrive for mlxsw to catch up. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index cbc8fab..8a15ac4 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -1697,7 +1697,7 @@ static int mlxsw_sp_port_obj_add(struct net_device *dev, vlan = SWITCHDEV_OBJ_PORT_VLAN(obj); err = mlxsw_sp_port_vlans_add(mlxsw_sp_port, vlan, trans); - if (switchdev_trans_ph_commit(trans)) { + if (switchdev_trans_ph_prepare(trans)) { /* The event is emitted before the changes are actually * applied to the bridge. Therefore schedule the respin * call for later, so that the respin logic sees the -- 2.4.11