SMSC LAN9311 Switch User Manual


 
Two Port 10/100 Managed Ethernet Switch with 16-Bit Non-PCI CPU Interface
Datasheet
SMSC LAN9311/LAN9311i 79 Revision 1.4 (08-19-08)
DATASHEET
6.5.6 Adding, Removing, and Changing VLAN Tags
Based on the port configuration and the received packet formation, a VLAN tag can be added to,
removed from, or modified in a packet. There are four received packet type cases: non-tagged, priority-
tagged, normal-tagged, and CPU special-tagged. There are also four possible settings for an egress
port: dumb, access, hybrid, and CPU. In addition, each VLAN table entry can specify the removal of
the VLAN tag (the entry’s un-tag bit).
The tagging/un-tagging rules are specified as follows:
Dumb Port - This port type generally does not change the tag.
When a received packet is non-tagged, priority-tagged, or normal-tagged, the packet passes
untouched.
When a packet is received special-tagged from a CPU port, the special tag is removed.
Access Port - This port type generally does not support tagging.
When a received packet in non-tagged, the packet passes untouched.
When a received packet is priority-tagged or normal-tagged, the tag is removed.
When a received packet is special-tagged from a CPU port, the special tag is removed.
CPU Port - Packets transmitted from this port type generally contain a special tag. Special tags
are described in detail in Section 6.4.10, "Host CPU Port Special Tagging," on page 75.
Hybrid Port - Generally, this port type supports a mix of normal-tagged and non-tagged packets.
It is the most complex, but most flexible port type.
For clarity, the following details the incoming un-tag instruction. As described in Section 6.4.4, "VLAN
Support," on page 70, the un-tag instruction is one of three un-tag bits from the applicable entry in the
VLAN table, selected by the ingress port number. The entry in the VLAN table is either the VLAN from
the received packet or the ingress ports default VID.
When a received packet is non-tagged, a new VLAN tag is added if two conditions are met. First,
the Insert Tag bit for the egress port in the Buffer Manager Egress Port Type Register
(BM_EGRSS_PORT_TYPE) must be set. Second, the un-tag instruction associated with the
ingress ports default VID must be cleared. The VLAN tag that is added will have a VID and Priority
taken from the ingress ports default VID and priority.
When a received packet is priority-tagged, either the tag is removed or it is modified.
If the un-tag instruction associated with the ingress ports default VID is set, then the tag is removed.
Otherwise, the tag is modified. The VID of the new VLAN tag is changed to the ingress ports default
VID. If the Change Priority bit in the Buffer Manager Egress Port Type Register
(BM_EGRSS_PORT_TYPE) for the egress port is set, then the Priority field of the new VLAN tag
is also changed to the ingress ports default priority.
When a received packet is normal-tagged, either the tag is removed, modified, or passed.
If the un-tag instruction associated with the VID in the received packet is set, then the tag is
removed.
Else, if the Change Tag bit in the Buffer Manager Egress Port Type Register
(BM_EGRSS_PORT_TYPE) for the egress port is clear, the packet is untouched.
Else, if both the Change VLAN ID and the Change Priority bits in the Buffer Manager Egress Port
Type Register (BM_EGRSS_PORT_TYPE) for the egress port are clear, the packet passes
untouched.
Otherwise, the tag is modified. If the Change VLAN ID bit for the egress port is set, the VOD of
the new VLAN tag is changed to the egress ports default ID. If the Change Priority bit for the egress
port is set, the Priority field of the new VLAN is changed to the egress ports default priority.
When a packet is received special-tagged from a CPU port, the special tag is removed.