]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Make route creation and destruction symmetric
authorIdo Schimmel <idosch@mellanox.com>
Thu, 26 Dec 2019 16:41:15 +0000 (18:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Dec 2019 21:13:22 +0000 (13:13 -0800)
commit0705297e511a334e99edf7da0d9a79f4d6b1c028
treedf642fdcd3ea84f1130a14d682ba2645e79f8b59
parent0d2fb5aa93a634316aa5b061170e9732a84d1217
mlxsw: spectrum_router: Make route creation and destruction symmetric

Host routes that perform decapsulation of IP in IP tunnels have a
special adjacency entry linked to them. This entry stores information
such as the expected underlay source IP. When the route is deleted this
entry needs to be freed.

The allocation of the adjacency entry happens in
mlxsw_sp_fib4_entry_type_set(), but it is freed in
mlxsw_sp_fib4_node_entry_unlink().

Create a new function - mlxsw_sp_fib4_entry_type_unset() - and free the
adjacency entry there.

This will allow us to consolidate mlxsw_sp_fib{4,6}_node_entry_unlink()
in the next patch.

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