mlxsw: spectrum_flower: Fix TOS matching
authorJiri Pirko <jiri@mellanox.com>
Tue, 11 Jun 2019 07:19:43 +0000 (10:19 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Jun 2019 18:08:14 +0000 (11:08 -0700)
The TOS value was not extracted correctly. Fix it.

Fixes: 87996f91f739 ("mlxsw: spectrum_flower: Add support for ip tos")
Reported-by: Alexander Petrovskiy <alexpe@mellanox.com>
Signed-off-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/spectrum_flower.c

index 15f804453cd614c8b6c7ff26a214b0a5c7f1ffdf..96b23c856f4de1db4f447743020898ca02e0240f 100644 (file)
@@ -247,8 +247,8 @@ static int mlxsw_sp_flower_parse_ip(struct mlxsw_sp *mlxsw_sp,
                                       match.mask->tos & 0x3);
 
        mlxsw_sp_acl_rulei_keymask_u32(rulei, MLXSW_AFK_ELEMENT_IP_DSCP,
-                                      match.key->tos >> 6,
-                                      match.mask->tos >> 6);
+                                      match.key->tos >> 2,
+                                      match.mask->tos >> 2);
 
        return 0;
 }