net: mscc: ocelot: restrict tc-trap actions to VCAP IS2 lookup 0
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 4 May 2022 23:55:02 +0000 (02:55 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 May 2022 02:15:16 +0000 (19:15 -0700)
commit477d2b91623e682e9a8126ea92acb8f684969cc7
tree08b77dd2e3178df36d2ffdc4752b1f60512d764c
parent6741e11880003e35802d78cc58035057934f4dab
net: mscc: ocelot: restrict tc-trap actions to VCAP IS2 lookup 0

Once the CPU port was added to the destination port mask of a packet, it
can never be cleared, so even packets marked as dropped by the MASK_MODE
of a VCAP IS2 filter will still reach it. This is why we need the
OCELOT_POLICER_DISCARD to "kill dropped packets dead" and make software
stop seeing them.

We disallow policer rules from being put on any other chain than the one
for the first lookup, but we don't do this for "drop" rules, although we
should. This change is merely ascertaining that the rules dont't
(completely) work and letting the user know.

The blamed commit is the one that introduced the multi-chain architecture
in ocelot. Prior to that, we should have always offloaded the filters to
VCAP IS2 lookup 0, where they did work.

Fixes: 1397a2eb52e2 ("net: mscc: ocelot: create TCAM skeleton from tc filter chains")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot_flower.c