VLAN Tag Insertion
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 131
VLAN Tag Insertion
The Ethernet controller is capable of inserting 802.1Q-compliant VLAN tags into transmitted frames and
extracting the VLAN tags from received frames. A frame containing the 802.1Q VLAN tag has the value TPID
(Tag Protocol Identifier) value in the Ether-type field followed by a 16-bit TCI (Tag Control Information) field,
which is made up of one CFI bit, 3 802.1P priority bits, and a 12-bit VLAN ID. The original 16-bit Ether-type/
Length field follows the TCI field.
shows the frame format with 802.1Q VLAN tag inserted.
The Ethernet controller allows the host software to enable or disable tag insertion on a per-packet basis. To send
a frame with a VLAN tag, the host software must initialize the first send buffer descriptor of a packet with the
VLAN tag value and set the VLAN_TAG bit of Send BD Flags field (see
).
TX Data Flow Diagram
illustrates how a frame, consisting of several fragments, is sent from the host to the NIC
and onto the network. For simplicity, the diagram depicts the operation of a single ring.
1.
The host software calls a system API to retrieve the three physical fragments of the frame. It initializes the
next three send buffer descriptors to point to each fragment. The send buffer descriptors reside in host
memory. Internally, the host software maintains the ring’s producer index. In this case, the producer index is
incremented by three because there are three fragments.
2.
The host software updates the send ring producer index by writing the producer index value to Send Ring
Producer Index Mailbox at offset 0x300 for host standard and offset 0x5900 for indirect mode. The mailbox
update triggers the Ethernet controller to process the send buffer descriptors.
3.
The send buffer descriptors are DMAed to the ring’s staging area in device memory as indicated in the RCB.
4.
The Ethernet controller DMAs the frame (as described in the descriptors) to its internal memory for
transmission.
5.
Internally, the Ethernet controller maintains the send ring’s consumer index, which is incremented as it
processes the descriptors.
6.
The new consumer index is written to the status block in NIC memory (see
).
7.
The status block is DMAed to host memory. This DMA is subject to host coalescing, and the NIC may
generate an interrupt at this point.