
Figure 6. Connecting L2Switch with host CPU
4.2.12.3.3.2.1 CPU port mode
The CPU port works by providing the means for the host CPU to choose a switch destination port for a frame and address control
frames from known protocols, such as, STP. When this mode is enabled on one of the internal switch ports the user may use the
Linux network interface assigned to that port as:
• standalone network interface - see
CPU port without bridge
on page 102
• child interface for a bridge interface - see
CPU port with simple bridge configuration and L2 forwarding support
on page
99
The two important features of CPU mode are: frame injection and frame extraction.
Frame injection
By using a custom tag or injection header prepended before the Ethernet frame header, the driver can instruct the L2Switch to
forward the frame on a specific port and bypass the frame analyzer. The analyzer determines the destination port, QoS class,
and VLAN classification for the frame through normal frame processing including lookups in the MAC table and VLAN table.
The tagged frame transmission is done from the peer network endpoint device. The peer net device is designated by the
cpu-
ethernet device tree property. On reception the L2Switch will strip the header, apply the frame updates (for example, write
timestamp on PTP frames) and put the frame on the egress queue of the destination port.
Once configured for injection the switch port accepts only tagged frames.
Frame extraction
The L2Switch can intercept a variety of control frames or just normal frames (unicast or multicast) and redirect them to the CPU
port. When a frame exits the CPU port it is also prepended, similarly to injection, by a custom tag or extraction header. This header
needs to be stripped off and decoded by the switch driver to extract the ingress switch port number on which the frame was
received.
Once configured for extraction the switch port emits only tagged frames.
4.2.12.3.3.2.2 Non-CPU port mode
If one of the two SoC internal ports works in non-CPU port mode then the decision to forward the frame to the host CPU or accept
a frame from it depends exclusively on the frame analyzer and the MAC and VLAN tables. As mentioned earlier, the frames
transiting a non-CPU port are not carrying any custom tags. In this mode only, the peer net device port (that is, ENETC port) acts
Linux kernel
Layerscape LS1028A BSP User Guide, Rev. 0.3, 04/2019
98
NXP Semiconductors
Содержание Layerscape LS1028A BSP
Страница 135: ......