net: mscc: ocelot: Implement port policers via tc command
authorJoergen Andreasen <joergen.andreasen@microchip.com>
Tue, 28 May 2019 12:49:17 +0000 (14:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 May 2019 04:37:49 +0000 (21:37 -0700)
commit2c1d029a017f23e912f5d549ad8a2d84428a5017
tree41164e4aedb255af7886df465863bf4af3375f44
parent7da33a8f87a4ee47f9eb96d67e01696b85111429
net: mscc: ocelot: Implement port policers via tc command

Hardware offload of matchall classifier and police action are now
supported via the tc command.
Supported police parameters are: rate and burst.

Example:

Add:
tc qdisc add dev eth3 handle ffff: ingress
tc filter add dev eth3 parent ffff: prio 1 handle 2 \
matchall skip_sw \
action police rate 100Mbit burst 10000

Show:
tc -s -d qdisc show dev eth3
tc -s -d filter show dev eth3 ingress

Delete:
tc filter del dev eth3 parent ffff: prio 1
tc qdisc del dev eth3 handle ffff: ingress

Signed-off-by: Joergen Andreasen <joergen.andreasen@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/Makefile
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot.h
drivers/net/ethernet/mscc/ocelot_police.c [new file with mode: 0644]
drivers/net/ethernet/mscc/ocelot_police.h [new file with mode: 0644]
drivers/net/ethernet/mscc/ocelot_tc.c [new file with mode: 0644]
drivers/net/ethernet/mscc/ocelot_tc.h [new file with mode: 0644]