]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum_acl: Add Spectrum-2 keys
authorNir Dotan <nird@mellanox.com>
Mon, 10 Dec 2018 07:11:39 +0000 (07:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Dec 2018 07:01:33 +0000 (23:01 -0800)
Add virtual router ID fields to Spectrum-2 key blocks set, as the field is
required for multicast routing.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.c

index bcd264135af7ef40e0b9f8b9fb366acaeba6532b..4a625cdf3e7cf694259f7f31683046ad53e5781d 100644 (file)
@@ -33,6 +33,8 @@ enum mlxsw_afk_element {
        MLXSW_AFK_ELEMENT_IP_TTL_,
        MLXSW_AFK_ELEMENT_IP_ECN,
        MLXSW_AFK_ELEMENT_IP_DSCP,
+       MLXSW_AFK_ELEMENT_VIRT_ROUTER_8_10,
+       MLXSW_AFK_ELEMENT_VIRT_ROUTER_0_7,
        MLXSW_AFK_ELEMENT_MAX,
 };
 
@@ -87,6 +89,8 @@ static const struct mlxsw_afk_element_info mlxsw_afk_element_infos[] = {
        MLXSW_AFK_ELEMENT_INFO_U32(IP_TTL_, 0x18, 0, 8),
        MLXSW_AFK_ELEMENT_INFO_U32(IP_ECN, 0x18, 9, 2),
        MLXSW_AFK_ELEMENT_INFO_U32(IP_DSCP, 0x18, 11, 6),
+       MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_8_10, 0x18, 17, 3),
+       MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_0_7, 0x18, 20, 8),
        MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_96_127, 0x20, 4),
        MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_64_95, 0x24, 4),
        MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_32_63, 0x28, 4),
index 2e1e8c4b3922029e073d2820f39fd41d4e21dd14..2a998dea4f39c30bf16d1303aac383c20a113982 100644 (file)
@@ -167,6 +167,11 @@ static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_2[] = {
        MLXSW_AFK_ELEMENT_INST_U32(IP_PROTO, 0x04, 16, 8),
 };
 
+static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4[] = {
+       MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_0_7, 0x04, 24, 8),
+       MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_8_10, 0x00, 0, 3),
+};
+
 static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv6_0[] = {
        MLXSW_AFK_ELEMENT_INST_BUF(DST_IP_32_63, 0x04, 4),
 };
@@ -210,6 +215,7 @@ static const struct mlxsw_afk_block mlxsw_sp2_afk_blocks[] = {
        MLXSW_AFK_BLOCK(0x38, mlxsw_sp_afk_element_info_ipv4_0),
        MLXSW_AFK_BLOCK(0x39, mlxsw_sp_afk_element_info_ipv4_1),
        MLXSW_AFK_BLOCK(0x3A, mlxsw_sp_afk_element_info_ipv4_2),
+       MLXSW_AFK_BLOCK(0x3C, mlxsw_sp_afk_element_info_ipv4_4),
        MLXSW_AFK_BLOCK(0x40, mlxsw_sp_afk_element_info_ipv6_0),
        MLXSW_AFK_BLOCK(0x41, mlxsw_sp_afk_element_info_ipv6_1),
        MLXSW_AFK_BLOCK(0x42, mlxsw_sp_afk_element_info_ipv6_2),