]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_switchdev: Avoid returning errors in commit phase
authorIdo Schimmel <idosch@mellanox.com>
Tue, 8 Jan 2019 16:48:07 +0000 (16:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jan 2019 21:53:54 +0000 (16:53 -0500)
commitec8bf3b650bf915a3f41e5dde46b9b775e2bb633
treec48bdad63e1673d2dc516f189dd40e5d08c4a8f6
parente4c6f257efdb2650de6a309b2b52a57f53b2058b
mlxsw: spectrum_switchdev: Avoid returning errors in commit phase

Drivers are not supposed to return errors in switchdev commit phase if
they returned OK in prepare phase. Otherwise, a WARNING is emitted.
However, when the offloading of a VXLAN tunnel is triggered by the
addition of a VLAN on a local port, it is not possible to guarantee that
the commit phase will succeed without doing a lot of work.

In these cases, the artificial division between prepare and commit phase
does not make sense, so simply do the work in the prepare phase.

Fixes: 39e366863916 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c