net/mlx5: fix VLAN PCP item calculation
authorOphir Munk <ophirmu@mellanox.com>
Wed, 26 Feb 2020 08:27:48 +0000 (08:27 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 09:21:41 +0000 (10:21 +0100)
commit3c3f27e905792670933fabe577f9653336780688
tree621953330da86fc928a9abca98f27defbe179470
parentbade47a7570b99cf77e71343cf43efed66ab8307
net/mlx5: fix VLAN PCP item calculation

The VLAN 16 bits tci field contains both values of PCP and VID. When
extracting any one of them - it is required not to affect the other one.
Previous to this commit in routine flow_dev_get_vlan_info_from_items()
we calculated the PCP as follows:
    (1) vlan->vlan_tci &= MLX5DV_FLOW_VLAN_PCP_MASK;
    (2) vlan->vlan_tci |= <3 bits value of PCP>
In line (1) we should have used the negated mask ('~' operator) such
that only the PCP bits will be nullified before ORing them with the
updated PCP value.

Fixes: 9aee7a8418d4 ("net/mlx5: support push flow action on VLAN header")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5_flow_dv.c