tc filter show dev swp2 ingress
tc filter del dev swp2 ingress pref 49152
There are 3 types of policers currently supported by the sja1105 driver:
• Port policers: These affect all traffic that is incoming on a port, except traffic that hits a more specific rule (see below). These
are configured as follows:
tc qdisc add dev swp2 clsact
tc filter add dev swp2 ingress matchall skip_sw \
action police rate 10mbit burst 64k
• Traffic class policers: These affect only traffic having a specific VLAN PCP. To limit traffic with VLAN PCP 0 (also includes
untagged traffic) to 100 Mbit/s on port swp2 only:
tc qdisc add dev swp2 clsact
tc filter add dev swp2 ingress protocol 802.1Q flower skip_sw \
vlan_prio 0 action police rate 100mbit burst 64k
• Broadcast policers: These affect only broadcast traffic (destination MAC ff:ff:ff:ff:ff:ff) received on an ingress port.
tc qdisc add dev swp2 clsact
tc filter add dev swp2 ingress flower skip_sw dst_mac ff:ff:ff:ff:ff:ff \
action police rate 10mbit burst 64k
In absence of a specific policer allocated to a traffic class or to broadcast traffic, these packets will consume from the bandwidth
budget of the port policer.
It is also possible to combine the bandwidth allocation of a traffic class, or of broadcast traffic on multiple ports, and assign them
to a single policer. This functionality is called "shared filter blocks" and can be configured as follows (the example below limits
broadcast traffic coming from all switch ports to a total of 10 Mbit/s):
tc qdisc add dev swp2 ingress_block 1 clsact
tc qdisc add dev swp3 ingress_block 1 clsact
tc qdisc add dev swp4 ingress_block 1 clsact
tc qdisc add dev swp5 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
For PTP, the sja1105 driver implements the kernel primitives required for interoperating with the linuxptp and other open source
application stacks. OpenIL on the LS1021A-TSN is configured to start linuxptp by default in 802.1AS bridge mode on ports swp2,
swp3, swp4 and swp5. The following system components are involved:
• ptp4l: Daemon that implements the IEEE 1588/802.1AS state machines. Configured via the /etc/linuxptp.cfg file and controled
via the linuxptp.service systemctl service.
• phc2sys: Daemon that synchronizes the system time (CLOCK_REALTIME) to the active PHC (/dev/ptp1) or viceversa,
depending on the board role in the network (PTP master or slave). Configured via the /etc/linuxptp-system-clock.cfg file and
controled via the phc2sys.service systemctl service.
To inspect the PTP synchronization status of the board, the following commands can be used:
systemctl start --now ptp4l
systemctl start --now phc2sys
journalctl -b -u ptp4l -f
journalctl -b -u phc2sys -f
Under steady state, the switch ports are expected to maintain a synchronization offset of +/- 100 ns offset to the PTP master.
NXP Semiconductors
TSN
Open Industrial User Guide, Rev. 1.8, 05/2020
User's Guide
133 / 199