The LAYER3 SWITCH module (r_layer3_switch) provides an API for standard Ethernet communications applications that use the ESWM peripheral. It implements the Ethernet Switch Interface.
This module performs Ethernet frame transmission and reception using Ethernet Switch Module.
The following figure shows which IPs are used by the r_layer3_switch module.
The following build time configurations are defined in fsp_cfg/r_layer3_switch_cfg.h:
This module can be added to the Stacks tab via New Stack > Networking > Switch (r_layer3_switch).
Credit Based Shaper (CBS) is a standard defined in IEEE 802.1Qav that limits the throughput of Ethernet traffic. The figure below illustrates the operation of CBS when the bandwidth is set to 40Mbps. When the transmission throughput exceeds the bandwidth configured by CBS, frame transmission is restricted. The restricted frames are buffered in the queue and transmitted with delay.
In the r_layer3_switch module, CBS bandwidth can be configured for each Internal Priority Value (IPV) queue per transmission port. There are 8 IPV queues available for each port. On transmission ports where CBS is enabled, the throughput is limited to the configured bandwidth. CBS can be configured through stack properties or the ConfigurePort() API.
Time-Aware Shaper (TAS) is a standard defined in IEEE 802.1Qbv that limits Ethernet traffic by controlling the time window when frames are transmitted. TAS controls transmission by changing gate states. Frames are transmitted while the gate is opened and when the gate is closed, frames cannot be transmitted and are delayed until the next open state. By opening each gate at different timings, it is possible to prevent frames of specific priorities from monopolizing the bandwidth. The figure below illustrates the operation of TAS. In this image, the gate cycle time is set to 10ms, Gate 0 is opened for 2.5 ms and closed for 7.5 ms, Gate 1 is closed for 1.0 + 5.0 ms and open for 4.0 ms.
In the r_layer3_switch module, TAS gates can be configured for each IPV queue of the transmission ports. Each gate learns entries that represent windows. An entry contains the window time and state. TAS feature is configured using the ConfigureTAS() API, and enabled using the EnableTAS() API.
Frame preemption is a standard defined in IEEE 802.3br and 802.1Qbu. This standard allows preempting low-priority frames to send high-priority frames.
Frame preemption needs to verify the frame preemption capability of the link partner. The figure below shows the verification process. Verify frames have special preambles, so these frames are rejected on devices which do not support frame preemption.
In the r_layer3_switch module, the verification process is performed when the r_rmac_phy module links up and frame preemption is enabled in the configuration.
The figure below shows the behavior of frame preemption. The low-priority frame (preemptable frame) is separated into several fragments, and they can be transferred in the intervals between high-priority frames (express frames). As a result, the negative influence on the throughput of high-priority frames is prevented.
In the r_layer3_switch module, each IPV queue can be configured to send either preemptable frames or express frames. ESWM IP automatically assembles separated frames when receiving them.
Per Stream Filtering and Policing (PSFP) feature is a standard defined in IEEE 802.1Qci that supports MSDU and Meter filters.
MAC Service Data Unit (MSDU)filter filters packets when Ethernet frame size (payload) is more than a threshold.
Meter filter filters packets when information rate is more than a threshold.
The filtered packets are sent to green or yellow bucket by Meter filter configuration.
MSDU and Meter filters support normal mode and throttle mode.
In normal mode, the driver does not send packets filtered MSDU or Meter filter. Also, error status flag becomes 1 when the packet is more than a threshold.
In throttle mode, the driver keeps not to send all packets when error status flag is 1. User can clear error status flag using PsfpClearErrorStatus() API.
When big endian mode is selected, the endian setting of ESWM bus is also changed to big endian. As a result, descriptor fields require endian conversion for word (16-bit) and long word (32-bit) accesses.
Most descriptor members behave correctly regardless of endianness. However, a few members require special handling before writing to the descriptor or after reading from it.
Developers should be aware of the following limitations when using the r_layer3_switch:
This is a basic example of transmission use of the LAYER3 SWITCH.
This is a basic example of reception use of the LAYER3 SWITCH.
The below is an example of forwarding frames with Credit Based Shaper (CBS).
The below is an example of forwarding frames with Time Aware Shaper (TAS).
The below is an example of PSFP MSDU filter.
The below is an example of PSFP Meter filter.
The below is an example of Frame Preemption.
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_DESCRIPTOR_QUEUE_LENGTH (3)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_MAXIMUM_FRAME_SIZE (1514)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_SOURCE_MAC_ADDRESS 0x74, 0x90, 0x50, 0x00, 0x79, 0x01
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_DESTINATION_MAC_ADDRESS 0x44, 0x44, 0x44, 0x00, 0x00, 0x0A
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_DESTINATION_MAC_ADDRESS 0x44, 0x44, 0x44, 0x00, 0x00, 0x0B
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_FRAME_TYPE 0x05, 0xDC // 1500(=0x05DC) byte
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_FRAME_TYPE 0x00, 0x32 // 50(=0x0032) byte
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_PRIORITY (1)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_PRIORITY (0)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE (64)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE (1514)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE_UPPER \
((uint8_t) ((LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE & \
0xFF00) >> 8))
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE_LOWER \
((uint8_t) LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE & \
0x00FF)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE_UPPER \
((uint8_t) ((LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE & \
0xFF00) >> 8))
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE_LOWER \
((uint8_t) LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE & \
0x00FF)
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_PAYLOAD \
0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09
#define LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_PAYLOAD \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, \
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, \
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, \
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, \
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, \
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, \
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, \
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, \
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, \
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, \
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, \
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, \
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, \
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, \
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9,
uint8_t gp_ether_buffer_express_frame[LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_MAXIMUM_FRAME_SIZE];
uint8_t gp_ether_buffer_preemptable_frame[LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_MAXIMUM_FRAME_SIZE];
uint8_t gp_high_send_data[LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_MAXIMUM_FRAME_SIZE] =
{
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_DESTINATION_MAC_ADDRESS,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_SOURCE_MAC_ADDRESS,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_FRAME_TYPE,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_PAYLOAD
};
uint8_t gp_low_send_data[LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_MAXIMUM_FRAME_SIZE] =
{
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_DESTINATION_MAC_ADDRESS,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_SOURCE_MAC_ADDRESS,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_FRAME_TYPE,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_PAYLOAD
};
bool g_tx_complete_flag = false;
void layer3_switch_frame_preemption_transmit_example (void)
{
uint32_t queue_index = 0;
{
.p_descriptor_array = gp_tx_descriptor_array,
.p_ts_descriptor_array = NULL,
.array_length = LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_DESCRIPTOR_QUEUE_LENGTH,
};
assert(FSP_SUCCESS == err);
assert(FSP_SUCCESS == err);
assert(FSP_SUCCESS == err);
do
{
} while (FSP_SUCCESS != err);
assert(FSP_SUCCESS == err);
memcpy(gp_ether_buffer_preemptable_frame,
gp_low_send_data,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE);
transmission_descriptor.
basic.
ds_l = LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE_LOWER;
transmission_descriptor.
basic.
ds_h = LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_SEND_FRAME_SIZE_UPPER;
transmission_descriptor.info1_tx.fmt = 1;
transmission_descriptor.info1_tx.ipv = (uint8_t) (LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_LOW_PRIORITY & 0x07);
#if defined(__BIG)
transmission_descriptor.
basic.
ptr_l = LAYER3_SWITCH_EXAMPLE_BYTES_SWAP_32(
(uintptr_t) gp_ether_buffer_preemptable_frame);
#else
transmission_descriptor.
basic.
ptr_l = (uintptr_t) gp_ether_buffer_preemptable_frame;
#endif
assert(FSP_SUCCESS == err);
assert(FSP_SUCCESS == err);
while (!g_tx_complete_flag)
{
}
g_tx_complete_flag = false;
memcpy(gp_ether_buffer_express_frame, gp_high_send_data,
LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE);
transmission_descriptor.
basic.
ds_l = LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE_LOWER;
transmission_descriptor.
basic.
ds_h = LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_SEND_FRAME_SIZE_UPPER;
transmission_descriptor.info1_tx.ipv = (uint8_t) (LAYER3_SWITCH_EXAMPLE_FRAME_PREEMPTION_HIGH_PRIORITY & 0x07);
#if defined(__BIG)
LAYER3_SWITCH_EXAMPLE_BYTES_SWAP_32((uintptr_t) gp_ether_buffer_express_frame);
#else
transmission_descriptor.
basic.
ptr_l = (uintptr_t) gp_ether_buffer_express_frame;
#endif
assert(FSP_SUCCESS == err);
assert(FSP_SUCCESS == err);
while (!g_tx_complete_flag)
{
}
assert(FSP_SUCCESS == err);
}
{
{
break;
}
{
g_tx_complete_flag = true;
break;
}
{
break;
}
{
break;
}
default:
{
break;
}
}
}