mlxsw: spectrum_ipip: Split accessor functions
authorPetr Machata <petrm@mellanox.com>
Fri, 3 Nov 2017 09:03:32 +0000 (10:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Nov 2017 00:15:17 +0000 (09:15 +0900)
commit9fb7bd77d11ab03b4a969279de9f54d8fd6fe988
tree5eaa7a1346b31f7f3ebc1cf1a910664a36ecf2e0
parent474f0ff618ae4305637e972746b42fabe2245b99
mlxsw: spectrum_ipip: Split accessor functions

To implement NETDEV_CHANGE notifications on IP-in-IP tunnels, the
handler needs to figure out what actually changed, to understand how
exactly to update the offloads. It will do so by storing struct
ip_tunnel_parm with previous configuration, and comparing that to the
new version.

To facilitate these comparisons, extract the code that operates on
struct ip_tunnel_parm from the existing accessor functions, and make
those a thin wrapper that extracts tunnel parameters and dispatches.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-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_ipip.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h