Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlxsw: reg: Add Switch Port Egress VLAN EtherType Register

SPEVET configures which EtherType to push at egress for packets incoming
through a local port for which 'SPVID.egr_et_set' is set.

The next patches will use SPEVET to configure EtherType 0x88A8 and
0x8100 for local ports member in 802.1ad and 802.1q bridges,
respectively. This allows using dual VxLAN bridges (802.1d and 802.1ad at
the same time).

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Amit Cohen and committed by
David S. Miller
d8f4da73 1b35293b

+36
+36
drivers/net/ethernet/mellanox/mlxsw/reg.h
··· 2088 2088 mlxsw_reg_spvc_et0_set(payload, et0); 2089 2089 } 2090 2090 2091 + /* SPEVET - Switch Port Egress VLAN EtherType 2092 + * ------------------------------------------ 2093 + * The switch port egress VLAN EtherType configures which EtherType to push at 2094 + * egress for packets incoming through a local port for which 'SPVID.egr_et_set' 2095 + * is set. 2096 + */ 2097 + #define MLXSW_REG_SPEVET_ID 0x202A 2098 + #define MLXSW_REG_SPEVET_LEN 0x08 2099 + 2100 + MLXSW_REG_DEFINE(spevet, MLXSW_REG_SPEVET_ID, MLXSW_REG_SPEVET_LEN); 2101 + 2102 + /* reg_spevet_local_port 2103 + * Egress Local port number. 2104 + * Not supported to CPU port. 2105 + * Access: Index 2106 + */ 2107 + MLXSW_ITEM32(reg, spevet, local_port, 0x00, 16, 8); 2108 + 2109 + /* reg_spevet_et_vlan 2110 + * Egress EtherType VLAN to push when SPVID.egr_et_set field set for the packet: 2111 + * 0: ether_type0 - (default) 2112 + * 1: ether_type1 2113 + * 2: ether_type2 2114 + * Access: RW 2115 + */ 2116 + MLXSW_ITEM32(reg, spevet, et_vlan, 0x04, 16, 2); 2117 + 2118 + static inline void mlxsw_reg_spevet_pack(char *payload, u8 local_port, 2119 + u8 et_vlan) 2120 + { 2121 + MLXSW_REG_ZERO(spevet, payload); 2122 + mlxsw_reg_spevet_local_port_set(payload, local_port); 2123 + mlxsw_reg_spevet_et_vlan_set(payload, et_vlan); 2124 + } 2125 + 2091 2126 /* CWTP - Congetion WRED ECN TClass Profile 2092 2127 * ---------------------------------------- 2093 2128 * Configures the profiles for queues of egress port and traffic class ··· 12061 12026 MLXSW_REG(sfmr), 12062 12027 MLXSW_REG(spvmlr), 12063 12028 MLXSW_REG(spvc), 12029 + MLXSW_REG(spevet), 12064 12030 MLXSW_REG(cwtp), 12065 12031 MLXSW_REG(cwtpm), 12066 12032 MLXSW_REG(pgcr),