]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net/mlx5e: Fix mapping of ct_label zero
authorAriel Levkovich <lariel@nvidia.com>
Mon, 8 Mar 2021 23:29:01 +0000 (01:29 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:53:37 +0000 (09:53 +0200)
commit551f2d6789f603577268ac0cd070075bcece7840
treefe8b0f5f16c03f1f03c1c1ba1b643f4a17856e0b
parent501aeb0e6012e0d5ab1a159128b55d608de6dfc6
net/mlx5e: Fix mapping of ct_label zero

BugLink: https://bugs.launchpad.net/bugs/1926368
[ Upstream commit d24f847e54214049814b9515771622eaab3f42ab ]

ct_label 0 is a default label each flow has and therefore
there can be rules that match on ct_label=0 without a prior
rule that set the ct_label to this value.

The ct_label value is not used directly in the HW rules and
instead it is mapped to some id within a defined range and this
id is used to set and match the metadata register which carries
the ct_label.

If we have a rule that matches on ct_label=0, the hw rule will
perform matching on a value that is != 0 because of the mapping
from label to id. Since the metadata register default value is
0 and it was never set before to anything else by an action that
sets the ct_label, there will always be a mismatch between that
register and the value in the rule.

To support such rule, a forced mapping of ct_label 0 to id=0
is done so that it will match the metadata register default
value of 0.

Fixes: 54b154ecfb8c ("net/mlx5e: CT: Map 128 bits labels to 32 bit map ID")
Signed-off-by: Ariel Levkovich <lariel@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c