Lines Matching +full:switch +full:- +full:mode
2 NXP SJA1105 switch driver
10 - SJA1105E: First generation, no TTEthernet
11 - SJA1105T: First generation, TTEthernet
12 - SJA1105P: Second generation, no TTEthernet, no SGMII
13 - SJA1105Q: Second generation, TTEthernet, no SGMII
14 - SJA1105R: Second generation, no TTEthernet, SGMII
15 - SJA1105S: Second generation, TTEthernet, SGMII
17 These are SPI-managed automotive switches, with all ports being gigabit
21 set-and-forget use, with minimal dynamic interaction at runtime. They
56 Also the configuration is write-only (software cannot read it back from the
57 switch except for very few exceptions).
62 If that changed setting can be transmitted to the switch through the dynamic
63 reconfiguration interface, it is; otherwise the switch is reset and
70 protocols" for switch control as STP and PTP. For these, the switches have two
71 programmable filters for link-local destination MACs.
74 functionality. For frames trapped to the CPU, source port and switch ID
77 But by leveraging ``CONFIG_NET_DSA_TAG_8021Q`` (a software-defined DSA tagging
78 format based on VLANs), general-purpose traffic termination through the network
82 with the switch:
84 - Mode 1 (VLAN-unaware): a port is in this mode when it is used as a standalone
86 - Mode 2 (fully VLAN-aware): a port is in this mode when it is enslaved to a
88 the user through ``bridge vlan`` commands, but general-purpose (anything
90 switch net devices. The other packets can be still by user space processed
92 - Mode 3 (best-effort VLAN-aware): a port is in this mode when enslaved to a
94 switch named ``best_effort_vlan_filtering`` is set to ``true``. When
96 to 4094), so is the number of usable VIDs (maximum of 7 non-pvid VLANs per
100 To summarize, in each mode, the following types of traffic are supported over
101 the switch net devices:
103 +-------------+-----------+--------------+------------+
104 | | Mode 1 | Mode 2 | Mode 3 |
108 +-------------+-----------+--------------+------------+
112 +-------------+-----------+--------------+------------+
114 To configure the switch to operate in Mode 3, the following steps can be
118 # swp2 operates in Mode 1 now
120 # swp2 temporarily moves to Mode 2
122 [ 61.204770] sja1105 spi0.1: Reset switch and programmed static config. Reason: VLAN filtering
123 [ 61.239944] sja1105 spi0.1: Disabled switch tagging
124 # swp3 now operates in Mode 3
126 [ 64.682927] sja1105 spi0.1: Reset switch and programmed static config. Reason: VLAN filtering
127 [ 64.711925] sja1105 spi0.1: Enabled switch tagging
128 # Cannot use VLANs in range 1024-3071 while in Mode 3.
152 # Cannot use mode than 7 VLANs per port while in Mode 3.
155 \* "maximum of 7 non-pvid VLANs per port": Decoding VLAN-tagged packets on the
156 CPU in mode 3 is possible through VLAN retagging of packets that go from the
157 switch to the CPU. In cross-chip topologies, the port that goes to the CPU
162 for this switch. There is a maximum of 32 entries in the Retagging Table of
163 each switch device.
165 As an example, consider this cross-chip topology::
167 +-------------------------------------------------+
169 | +-------------------------+ |
171 | | switch (non-sja1105) | |
172 | +--------+-------------------------+--------+ |
173 | | embedded L2 switch | |
175 | | +--------------+ +--------------+ | |
178 +--+---+--------------+-----+--------------+---+--+
180 +-----------------------+ +-----------------------+
181 | SJA1105 switch 1 | | SJA1105 switch 2 |
182 +-----+-----+-----+-----+ +-----+-----+-----+-----+
184 +-----+-----+-----+-----+ +-----+-----+-----+-----+
186 To reach the CPU, SJA1105 switch 1 (spi/spi2.1) uses the same port as is uses
187 to reach SJA1105 switch 2 (spi/spi2.2), which would be port 4 (not drawn).
188 Similarly for SJA1105 switch 2.
237 SJA1105 switch 1 consumes 1 retagging entry for each VLAN on each user port
238 towards the CPU. It also consumes 1 retagging entry for each non-pvid VLAN that
240 switch.
242 In this case, SJA1105 switch 1 consumes a total of 11 retagging entries, as
245 - 8 retagging entries for VLANs 1 and 100 installed on its user ports
246 (``sw1p0`` - ``sw1p3``)
247 - 3 retagging entries for VLAN 100 installed on the user ports of SJA1105
248 switch 2 (``sw2p0`` - ``sw2p2``), because it also has ports that are
249 interested in it. The VLAN 1 is a pvid on SJA1105 switch 2 and does not need
252 SJA1105 switch 2 also consumes 11 retagging entries, but organized as follows:
254 - 7 retagging entries for the bridge VLANs on its user ports (``sw2p0`` -
256 - 4 retagging entries for VLAN 100 installed on the user ports of SJA1105
257 switch 1 (``sw1p0`` - ``sw1p3``).
269 The hardware tags all traffic internally with a port-based VLAN (pvid), or it
273 This behavior is available when switch ports are enslaved to a bridge with
277 by changing what TPID the switch searches 802.1Q tags for, the semantics of a
279 untagged), and therefore this mode is also supported.
281 Segregating the switch ports in multiple bridges is supported (e.g. 2 + 2), but
284 that VLAN awareness is global at the switch level is that once a bridge with
285 ``vlan_filtering`` enslaves at least one switch port, the other un-bridged
299 The switch ports (swp0-3) are under br0.
301 with swp0-3.
306 enslaves eth0 and eth1 (the DSA master of the switch ports). This is because in
307 this mode, the switch ports beneath br0 are not capable of regular traffic, and
313 Time-aware scheduling
314 ---------------------
316 The switch supports a variation of the enhancements for scheduled traffic
317 specified in IEEE 802.1Q-2018 (formerly 802.1Qbv). This means it can be used to
318 ensure deterministic latency for priority traffic that is sent in-band with its
319 gate-open event in the network schedule.
321 This capability can be managed through the tc-taprio offload ('flags 2'). The
327 on the VLAN PCP bits (if no VLAN is present, the port-based default is used).
329 ``vlan_filtering``, the EtherType recognized by the switch as being VLAN can
331 for tagging. Therefore, the switch ignores the VLAN PCP if used in standalone
332 or bridge mode with ``vlan_filtering=0``, as it will not recognize the 0x8100
339 sub-interface on the DSA master port, and send normal (0x8100) VLAN-tagged
340 towards the switch, with the VLAN PCP bits set appropriately.
342 Management traffic (having DMAC 01-80-C2-xx-xx-xx or 01-19-1B-xx-xx-xx) is the
343 notable exception: the switch always treats it with a fixed priority and
354 set -e -u -o pipefail
369 if ! systemctl is-active --quiet ptp4l; then
375 # Phase-align the base time to the start of the next second.
376 sec=$(echo "${now}" | gawk -F. '{ print $1; }')
383 base-time ${base_time} \
384 sched-entry S $(gatemask 7) 100000 \
385 sched-entry S $(gatemask "0 1 2 3 4 5 6") 400000 \
388 It is possible to apply the tc-taprio offload on multiple egress ports. There
395 --------------------------------------
397 The switch is able to offload flow-based redirection of packets to a set of
403 - VLAN-aware virtual links: these match on destination MAC address, VLAN ID and
405 - VLAN-unaware virtual links: these match on destination MAC address only.
411 actions are requested, the driver creates a "non-critical" virtual link. When
412 the action list also contains tc-gate (more details below), the virtual link
413 becomes "time-critical" (draws frame buffers from a reserved memory partition,
433 Time-based ingress policing
434 ---------------------------
436 The TTEthernet hardware abilities of the switch can be constrained to act
437 similarly to the Per-Stream Filtering and Policing (PSFP) clause specified in
438 IEEE 802.1Q-2018 (formerly 802.1Qci). This means it can be used to perform
439 tight timing-based admission control for up to 1024 flows (identified by a
443 This capability can be managed through the offload of the tc-gate action. As
445 explicit routing of time-critical traffic and does not leave that in the hands
446 of the FDB, flooding etc), the tc-gate action may never appear alone when
450 Example: create a tc-taprio schedule that is phase-aligned with a tc-gate
461 sec=$(echo $now | awk -F. '{print $1}') && \
466 action gate base-time ${base_time} \
467 sched-entry OPEN 60000 -1 -1 \
468 sched-entry CLOSE 40000 -1 -1 \
474 sec=$(echo $now | awk -F. '{print $1}') && \
481 base-time ${base_time} \
482 sched-entry S 01 50000 \
483 sched-entry S 00 50000 \
487 one used for the tc-taprio offload. Therefore, the restrictions regarding the
488 fact that no two gate actions (either tc-gate or tc-taprio gates) may fire at
491 To come in handy, it is possible to share time-triggered virtual links across
500 base-time 0 \
501 sched-entry OPEN 50000000 -1 -1 \
502 sched-entry CLOSE 50000000 -1 -1 \
507 lack of destination ports and MTU enforcement checks). Byte-level counters are
514 and aims to showcase some potential switch caveats.
516 RMII PHY role and out-of-band signaling
517 ---------------------------------------
524 On the other hand, the SJA1105 is only binary configurable - when in the RMII
528 In the RMII spec, the PHY can transmit extra out-of-band signals via RXD[1:0].
530 preamble of each frame. The MAC does not have this out-of-band signaling
533 clock signal, inevitably an RMII PHY-to-PHY connection is created. The SJA1105
536 simply encodes the extra symbols received from the SJA1105-as-PHY onto the
537 100Base-Tx wire.
542 The take-away is that in RMII mode, the SJA1105 must be let to drive the
545 RGMII fixed-link and internal delays
546 ------------------------------------
560 In the situation where the switch port is connected through an RGMII fixed-link
563 inactive) until there is manual intervention (ifdown/ifup on the switch port).
564 The take-away is that in RGMII mode, the switch's internal delays are only
566 so in a way that is coordinated with the switch port (practically, both ends of
567 the fixed-link are under control of the same Linux system).
568 As to why would a fixed-link interface ever change link speeds: there are
569 Ethernet controllers out there which come out of reset in 100 Mbps mode, and
574 ---------------------------
576 The SJA1105 does not have an MDIO bus and does not perform in-band AN either.
577 Therefore there is no link state notification coming from the switch device.
578 A board would need to hook up the PHYs connected to the switch to any other