OSDN Git Service

mlxsw: spectrum: Distinguish between IPv4/6 tunnels
authorPetr Machata <petrm@mellanox.com>
Tue, 13 Feb 2018 10:26:09 +0000 (11:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Feb 2018 17:24:28 +0000 (12:24 -0500)
commite437f3b62d0844c4073c9e13263413748fa69093
tree6f0d9db02b826a665e7567fd192e47b118aa88a1
parentfe735a3d2c41f9ed2b706ce328c2b5d2b988d60b
mlxsw: spectrum: Distinguish between IPv4/6 tunnels

struct ip_tunnel_parm, where GRE and several other tunnel types hold
information, is IPv4-specific. The current router / ipip code in mlxsw
however uses it as if it were generic.

Make it clear that it's not. Rename many functions from _params_ to
_params4_. mlxsw_sp_ipip_parms_saddr() and _daddr() take a proto
argument to dispatch on it. Move the dispatch logic to
mlxsw_sp_ipip_netdev_saddr() and _daddr(), and replace with
single-protocol functions.

In struct mlxsw_sp_ipip_entry, move the "parms" field to a (for the time
being, singleton) union. Update users throughout.

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