OSDN Git Service

mlxsw: spectrum_router: Set hardware flags for routes
authorIdo Schimmel <idosch@mellanox.com>
Tue, 14 Jan 2020 11:23:14 +0000 (13:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 02:53:35 +0000 (18:53 -0800)
commitee5a0448e72b0857260e04f68126b2bfa27c154e
treec77f619f6df974ea62063f1d06f2683375ef670c
parent8c5a5b9b9185e5f3f14c81b2d1cef7e6f837c280
mlxsw: spectrum_router: Set hardware flags for routes

Previous patches added support for two hardware flags for IPv4 and IPv6
routes: 'RTM_F_OFFLOAD' and 'RTM_F_TRAP'. Both indicate the presence of
the route in hardware. The first indicates that traffic is actually
offloaded from the kernel, whereas the second indicates that packets
hitting such routes are trapped to the kernel for processing (e.g., host
routes).

Use these two flags in mlxsw. The flags are modified in two places.
Firstly, whenever a route is updated in the device's table. This
includes the addition, deletion or update of a route. For example, when
a host route is promoted to perform NVE decapsulation, its action in the
device is updated, the 'RTM_F_OFFLOAD' flag set and the 'RTM_F_TRAP'
flag cleared.

Secondly, when a route is replaced and overwritten by another route, its
flags are cleared.

v2:
* Convert to new fib_alias_hw_flags_set() interface

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