summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2017-09-03 00:49:22 +0300
committerDavid S. Miller <davem@davemloft.net>2017-09-04 06:23:25 +0300
commit35225e4740baa9707f4063bedb4367185b9d1ae7 (patch)
tree93cc9445e22a4ad8e9bbff282d2c25fc335b455b /drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h
parentf6050ee6f462e6dbd9dd6a49e5dc3cca7fc0b601 (diff)
downloadlinux-35225e4740baa9707f4063bedb4367185b9d1ae7.tar.xz
mlxsw: spectrum_router: Make nexthops typed
In the router, some next hops may reference an encapsulating netdevice, such as GRE or IPIP. To properly offload these next hops, mlxsw needs to keep track of whether a given next hop is a regular Ethernet entry, or an IP-in-IP tunneling entry. To facilitate this book-keeping, add a type field to struct mlxsw_sp_nexthop. There is, as of this patch, only one next hop type: MLXSW_SP_NEXTHOP_TYPE_ETH. Follow-up patches will introduce the IP-in-IP variant. There are several places where next hops are initialized in the IPv4 path. Instead of replicating the logic at every one of them, factor it out to a function mlxsw_sp_nexthop4_type_init(). The corresponding fini is actually protocol-neutral, so put it to mlxsw_sp_nexthop_type_fini(), but create a corresponding protocoled _fini function that dispatches to the protocol-neutral one. The IPv6 path is simpler, but for symmetry with IPv4, create the same suite of functions with corresponding logic. 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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h')
0 files changed, 0 insertions, 0 deletions