net: mscc: ocelot: Hardware ofload for tc flower filter
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Fri, 31 May 2019 07:16:57 +0000 (09:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Jun 2019 20:49:49 +0000 (13:49 -0700)
commitfe3490e6107e10da90dee09cade35e6f4b558294
tree4898d363f7e5133cfc14639129f98ef774c18fbc
parentb596229448dd2a263cdc4906e60b1b2249777ee4
net: mscc: ocelot: Hardware ofload for tc flower filter

Hardware offload of port filtering are now supported via tc command using
flower filter. ACL rules are used to enable the hardware offload.
The following keys are supported:

vlan_id
vlan_prio
dst_mac/src_mac for non IP frames
dst_ip/src_ip
dst_port/src_port

The following actions are supported:
trap
drop

These filters are supported only on the ingress schedulare.

Add:
tc qdisc add dev eth3 ingress
tc filter ad dev eth3 parent ffff: ip_proto ip flower \
    ip_proto tcp dst_port 80 action drop

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/Makefile
drivers/net/ethernet/mscc/ocelot_ace.h
drivers/net/ethernet/mscc/ocelot_flower.c [new file with mode: 0644]
drivers/net/ethernet/mscc/ocelot_tc.c