]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: More accurately set offload flag
authorIdo Schimmel <idosch@mellanox.com>
Wed, 8 Feb 2017 10:16:36 +0000 (11:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2017 20:25:17 +0000 (15:25 -0500)
commit83e255a5e4b034f8e21ac1feb28ae3a8174c1d7b
treeaf28592b9b71119d394cbfe8c91593c67c8397ee
parentc35c73dc3e0ff65a744a8ab2bfe90d063caeb5c1
mlxsw: spectrum_router: More accurately set offload flag

We currently set the RTNH_F_OFFLOAD flag for all routes using remote
action, but this isn't always correct. If none of the nexthops
associated with a gatewayed route can be offloaded into the device, then
any packet hitting it would be trapped to the CPU and forwarded by the
kernel.

Solve this by pushing the setting of the offload flag to after the route
was programmed into the device, thereby allowing us to take all the
parameters into account.

This change will also help us further in the patchset, when we refresh
routes following the reception of NH_{ADD,DEL} events.

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