net: mvpp2: cls: Allow dropping packets with classification offload
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Tue, 30 Apr 2019 13:14:29 +0000 (15:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 May 2019 21:13:14 +0000 (17:13 -0400)
commitbec2d46d143d467f92d7d1b54d1e7c1e3a25a7b9
treedc28c02b3d457355d77f8a89a9a5c679e89022ac
parent90b509b39ac9b09be88eb641c7a3abd8de06b698
net: mvpp2: cls: Allow dropping packets with classification offload

This commit introduces support for the "Drop" action in classification
offload. This corresponds to the "-1" action with ethtool -N.

This is achieved using the color marking actions available in the C2
engine, which associate a color to a packet. These colors can be either
Green, Yellow or Red, Red meaning that the packet should be dropped.

Green and Yellow colors are interpreted by the Policer, which isn't
supported yet.

This method of dropping using the Classifier is different than the
already existing early-drop features, such as VLAN filtering and MAC
UC/MC filtering, which are performed during the Parsing step, and
therefore take precedence over classification actions.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2.h
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h