linux_dsm_epyc7002/drivers/net/dsa/sja1105
Vladimir Oltean a6af77637a net: dsa: sja1105: add broadcast and per-traffic class policers
This patch adds complete support for manipulating the L2 Policing Tables
from this switch. There are 45 table entries, one entry per each port
and traffic class, and one dedicated entry for broadcast traffic for
each ingress port.

Policing entries are shareable, and we use this functionality to support
shared block filters.

We are modeling broadcast policers as simple tc-flower matches on
dst_mac. As for the traffic class policers, the switch only deduces the
traffic class from the VLAN PCP field, so it makes sense to model this
as a tc-flower match on vlan_prio.

How to limit broadcast traffic coming from all front-panel ports to a
cumulated total of 10 Mbit/s:

tc qdisc add dev sw0p0 ingress_block 1 clsact
tc qdisc add dev sw0p1 ingress_block 1 clsact
tc qdisc add dev sw0p2 ingress_block 1 clsact
tc qdisc add dev sw0p3 ingress_block 1 clsact
tc filter add block 1 flower skip_sw dst_mac ff:ff:ff:ff:ff:ff \
	action police rate 10mbit burst 64k

How to limit traffic with VLAN PCP 0 (also includes untagged traffic) to
100 Mbit/s on port 0 only:

tc filter add dev sw0p0 ingress protocol 802.1Q flower skip_sw \
	vlan_prio 0 action police rate 100mbit burst 64k

The broadcast, VLAN PCP and port policers are compatible with one
another (can be installed at the same time on a port).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-30 11:44:01 -07:00
..
Kconfig net: dsa: sja1105: Implement state machine for TAS with PTP clock source 2019-11-14 14:50:35 -08:00
Makefile net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105_clocking.c net: dsa: sja1105: Add support for the SGMII port 2020-03-20 08:55:21 -07:00
sja1105_dynamic_config.c net: dsa: sja1105: make the AVB table dynamically reconfigurable 2020-03-23 22:15:07 -07:00
sja1105_dynamic_config.h net: dsa: sja1105: Use the correct style for SPDX License Identifier 2019-10-15 20:16:26 -07:00
sja1105_ethtool.c net: dsa: sja1105: show more ethtool statistics counters for P/Q/R/S 2020-03-29 22:04:20 -07:00
sja1105_flower.c net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105_main.c net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105_ptp.c net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_ptp.h net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_sgmii.h net: dsa: sja1105: Add support for the SGMII port 2020-03-20 08:55:21 -07:00
sja1105_spi.c net: dsa: sja1105: show more ethtool statistics counters for P/Q/R/S 2020-03-29 22:04:20 -07:00
sja1105_static_config.c net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_static_config.h net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_tas.c net: dsa: sja1105: make future_base_time a common helper 2020-03-23 22:15:07 -07:00
sja1105_tas.h net: dsa: sja1105: Implement state machine for TAS with PTP clock source 2019-11-14 14:50:35 -08:00
sja1105.h net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00