mlxsw: spectrum_flower: Add support for ip tos
authorOr Gerlitz <ogerlitz@mellanox.com>
Mon, 17 Jul 2017 12:07:31 +0000 (14:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jul 2017 16:18:23 +0000 (09:18 -0700)
Support offloading rules that match on ip tos.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c

index 84fe33cf1e9566f8bff60b0b82f6cf23c67cc1a3..400ad4081660f0a8e360624167253f02de0469bc 100644 (file)
@@ -235,6 +235,13 @@ static int mlxsw_sp_flower_parse_ip(struct mlxsw_sp *mlxsw_sp,
                                         f->mask);
        mlxsw_sp_acl_rulei_keymask_u32(rulei, MLXSW_AFK_ELEMENT_IP_TTL_,
                                       key->ttl, mask->ttl);
+
+       mlxsw_sp_acl_rulei_keymask_u32(rulei, MLXSW_AFK_ELEMENT_IP_ECN,
+                                      key->tos & 0x3, mask->tos & 0x3);
+
+       mlxsw_sp_acl_rulei_keymask_u32(rulei, MLXSW_AFK_ELEMENT_IP_DSCP,
+                                      key->tos >> 6, mask->tos >> 6);
+
        return 0;
 }