Skip to content

Commit

Permalink
mlxsw: spectrum_router: Refactor virtual router handling
Browse files Browse the repository at this point in the history
A virtual router (VR) is an entity within the device to which routing
tables and interfaces can be bound to. It can be used to implement VRFs.

In the initial implementation we associated the VR with a specific
protocol (e.g., IPv4) and an LPM tree. However, this isn't really
accurate, as the same VR can be used for both IPv4 and IPv6 traffic, by
binding a different LPM tree to a {VR, Proto} pair.

This patch aims to restructure the VR code according to the above logic,
so that VRs are more accurately represented by the driver's data
structures. The main motivation behind this change is to prepare the
driver for VRF offload.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Mar 10, 2017
1 parent 382dbb4 commit 76610eb
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 151 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,8 @@ struct mlxsw_sp_fib;

struct mlxsw_sp_vr {
u16 id; /* virtual router ID */
bool used;
enum mlxsw_sp_l3proto proto;
u32 tb_id; /* kernel fib table id */
struct mlxsw_sp_lpm_tree *lpm_tree;
struct mlxsw_sp_fib *fib;
struct mlxsw_sp_fib *fib4;
};

enum mlxsw_sp_span_type {
Expand Down
Loading

0 comments on commit 76610eb

Please sign in to comment.