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)
commit0a7fd1ac2a6b316ceeb9a57a41ce0c45f6bff549
treec74d9f3f28f74ce4772bf96611c5a90b94ce029a
parent428b851f565f11c483cfa62021d674b6fb9d6ddc
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