diff options
author | Ido Schimmel <idosch@mellanox.com> | 2018-10-11 03:48:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-11 13:08:23 -0400 |
commit | 50e6eb2a634e6c03bed4128fe1ab5044f8561b1d (patch) | |
tree | 900a41473f9913a4c20fdee4e6b5204ca78b471e | |
parent | 710dd1a0ec3f1afac393c4f85d164ffe0e6132e2 (diff) |
mlxsw: reg: Add Tunnel Port Configuration Register
This register enables / disables learning on different types of tunnel
ports (e.g., NVE, VPLS).
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/reg.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index 3b58f1013677..de97764a71b2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h | |||
@@ -8476,6 +8476,51 @@ static inline void mlxsw_reg_tngcr_pack(char *payload, | |||
8476 | mlxsw_reg_tngcr_nve_group_size_flood_set(payload, 1); | 8476 | mlxsw_reg_tngcr_nve_group_size_flood_set(payload, 1); |
8477 | } | 8477 | } |
8478 | 8478 | ||
8479 | /* TNPC - Tunnel Port Configuration Register | ||
8480 | * ----------------------------------------- | ||
8481 | * The TNPC register is used for tunnel port configuration. | ||
8482 | * Reserved when Spectrum. | ||
8483 | */ | ||
8484 | #define MLXSW_REG_TNPC_ID 0xA020 | ||
8485 | #define MLXSW_REG_TNPC_LEN 0x18 | ||
8486 | |||
8487 | MLXSW_REG_DEFINE(tnpc, MLXSW_REG_TNPC_ID, MLXSW_REG_TNPC_LEN); | ||
8488 | |||
8489 | enum mlxsw_reg_tnpc_tunnel_port { | ||
8490 | MLXSW_REG_TNPC_TUNNEL_PORT_NVE, | ||
8491 | MLXSW_REG_TNPC_TUNNEL_PORT_VPLS, | ||
8492 | MLXSW_REG_TNPC_TUNNEL_FLEX_TUNNEL0, | ||
8493 | MLXSW_REG_TNPC_TUNNEL_FLEX_TUNNEL1, | ||
8494 | }; | ||
8495 | |||
8496 | /* reg_tnpc_tunnel_port | ||
8497 | * Tunnel port. | ||
8498 | * Access: Index | ||
8499 | */ | ||
8500 | MLXSW_ITEM32(reg, tnpc, tunnel_port, 0x00, 0, 4); | ||
8501 | |||
8502 | /* reg_tnpc_learn_enable_v6 | ||
8503 | * During IPv6 underlay decapsulation, whether to learn from tunnel port. | ||
8504 | * Access: RW | ||
8505 | */ | ||
8506 | MLXSW_ITEM32(reg, tnpc, learn_enable_v6, 0x04, 1, 1); | ||
8507 | |||
8508 | /* reg_tnpc_learn_enable_v4 | ||
8509 | * During IPv4 underlay decapsulation, whether to learn from tunnel port. | ||
8510 | * Access: RW | ||
8511 | */ | ||
8512 | MLXSW_ITEM32(reg, tnpc, learn_enable_v4, 0x04, 0, 1); | ||
8513 | |||
8514 | static inline void mlxsw_reg_tnpc_pack(char *payload, | ||
8515 | enum mlxsw_reg_tnpc_tunnel_port tport, | ||
8516 | bool learn_enable) | ||
8517 | { | ||
8518 | MLXSW_REG_ZERO(tnpc, payload); | ||
8519 | mlxsw_reg_tnpc_tunnel_port_set(payload, tport); | ||
8520 | mlxsw_reg_tnpc_learn_enable_v4_set(payload, learn_enable); | ||
8521 | mlxsw_reg_tnpc_learn_enable_v6_set(payload, learn_enable); | ||
8522 | } | ||
8523 | |||
8479 | /* TIGCR - Tunneling IPinIP General Configuration Register | 8524 | /* TIGCR - Tunneling IPinIP General Configuration Register |
8480 | * ------------------------------------------------------- | 8525 | * ------------------------------------------------------- |
8481 | * The TIGCR register is used for setting up the IPinIP Tunnel configuration. | 8526 | * The TIGCR register is used for setting up the IPinIP Tunnel configuration. |
@@ -9026,6 +9071,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { | |||
9026 | MLXSW_REG(mcda), | 9071 | MLXSW_REG(mcda), |
9027 | MLXSW_REG(mgpc), | 9072 | MLXSW_REG(mgpc), |
9028 | MLXSW_REG(tngcr), | 9073 | MLXSW_REG(tngcr), |
9074 | MLXSW_REG(tnpc), | ||
9029 | MLXSW_REG(tigcr), | 9075 | MLXSW_REG(tigcr), |
9030 | MLXSW_REG(sbpr), | 9076 | MLXSW_REG(sbpr), |
9031 | MLXSW_REG(sbcm), | 9077 | MLXSW_REG(sbcm), |