mlxsw: spectrum_router: Add support for route replace
authorIdo Schimmel <idosch@mellanox.com>
Thu, 3 Aug 2017 11:28:29 +0000 (13:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Aug 2017 22:36:01 +0000 (15:36 -0700)
commitb746e5341272d17df99db5a9bea1e7056b322090
treec74d9f3f28f74ce4772bf96611c5a90b94ce029a
parent487b841830c443296ddb341ab638dc3233902150
mlxsw: spectrum_router: Add support for route replace

In case we got a replace event, then the replaced route must exist. If
the route isn't capable of multipath, then replace first matching
non-multipath capable route.

If the route is capable of multipath and matching multipath capable
route is found, then replace it. Otherwise, replace first matching
non-multipath capable route.

The new route is inserted before the replaced one. In case the replaced
route is currently offloaded, then it's overwritten in the device's table
by the new route and later deleted, thus not impacting routed traffic.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c