diff options
author | Petr Machata <petrm@mellanox.com> | 2017-09-02 23:49:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-03 20:23:26 -0700 |
commit | 4607f6d26950ffb3c4c8e5b2db42f364f19dd26c (patch) | |
tree | de96635ab376561d2b9065adcbc0f7d621415696 /drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h | |
parent | 8f28a3097645ae29a7c6835ed9323d6b6b8db169 (diff) |
mlxsw: spectrum_router: Support IPv4 underlay decap
Unlike encapsulation, which is represented by a next hop forwarding to
an IPIP tunnel, decapsulation is a type of local route. It is created
for local routes whose prefix corresponds to the local address of one of
offloaded IPIP tunnels. When the tunnel is removed (i.e. all the encap
next hops are removed), the decap offload is migrated back to a trap for
resolution in slow path.
This patch assumes that decap route is already present when encap route
is added. A follow-up patch will fix this issue.
Note that this patch only supports IPv4 underlay. Support for IPv6
underlay will be subject to follow-up work apart from this patchset.
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')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h index 7b40aa2b049a..cd986bde856a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h @@ -36,6 +36,7 @@ #define _MLXSW_IPIP_H_ #include "spectrum_router.h" +#include <net/ip_fib.h> enum mlxsw_sp_ipip_type { MLXSW_SP_IPIP_TYPE_MAX, @@ -46,6 +47,7 @@ struct mlxsw_sp_ipip_entry { struct net_device *ol_dev; /* Overlay. */ struct mlxsw_sp_rif_ipip_lb *ol_lb; unsigned int ref_count; /* Number of next hops using the tunnel. */ + struct mlxsw_sp_fib_entry *decap_fib_entry; struct list_head ipip_list_node; }; @@ -64,6 +66,11 @@ struct mlxsw_sp_ipip_ops { struct mlxsw_sp_rif_ipip_lb_config (*ol_loopback_config)(struct mlxsw_sp *mlxsw_sp, const struct net_device *ol_dev); + + int (*fib_entry_op)(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_ipip_entry *ipip_entry, + enum mlxsw_reg_ralue_op op, + u32 tunnel_index); }; extern const struct mlxsw_sp_ipip_ops *mlxsw_sp_ipip_ops_arr[]; |