SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
The Ethernet module supports two Receive channels and two Rx Queues. In the Rx direction, the MTL Rx Controller selects the Rx DMA for which Rx DMA is transferring or reading the data from the Rx FIFO memory. This scheduling is based on the programming done in the respective MTL_RxQ[x]_Control register.
Each Rx DMA indicates when the Rx DMA is ready to transfer data and the size of the burst-length (number of beats) that the Rx DMA has to transfer. The scheduler checks whether sufficient data (of requested burst length) is available to be transferred to these DMAs and then selects the Rx DMA that gets serviced using the programmed priorities.
Priority Scheme for Tx DMA and Rx DMA: The DWC_ether_qos DMA arbiter supports two types of arbitration: fixed priority and weighted round-robin.
The DMA arbiter performs the arbitration between the Tx and Rx paths of DMA channels for accessing descriptors and data buffers. The DMA arbiter supports two types of arbitration: fixed priority and weighted round-robin. The DA bit of the DMA_Mode register specifies the arbitration scheme (fixed or weighted round-robin) between the Tx and Rx DMA of a channel.
If you have enabled the Tx DMA and Rx DMA of a channel, you can specify which DMA gets the bus when the channel gets the control of the bus. You can set the priority between the corresponding Tx DMA and Rx DMA by using the TXPR field of the DMA_Mode register. For round-robin arbitration, you can use the PR field of the DMA_Mode register to specify the weighted priority between the Tx DMA and Rx DMA.
Bit 14 | Bit 13 | Bit 12 | Bit 11 | Bit 10 | Priority Schemes |
---|---|---|---|---|---|
x | x | x | 0 | 1 | Rx always has priority over Tx |
0 | 0 | 0 | 0 | 0 | Tx and Rx have equal priority. Rx gets the access first on simultaneous requests |
0 | 0 | 1 | 0 | 0 | Rx has priority over Tx in ratio 2:1 |
0 | 1 | 0 | 0 | 0 | Rx has priority over Tx in ratio 3:1 |
0 | 1 | 1 | 0 | 0 | Rx has priority over Tx in ratio 4:1 |
1 | 0 | 0 | 0 | 0 | Rx has priority over Tx in ratio 5:1 |
1 | 0 | 1 | 0 | 0 | Rx has priority over Tx in ratio 6:1 |
1 | 1 | 0 | 0 | 0 | Rx has priority over Tx in ratio 7:1 |
1 | 1 | 1 | 0 | 0 | Rx has priority over Tx in ratio 8:1 |
x | x | x | 1 | 1 | Tx always has priority over Rx |
0 | 0 | 0 | 1 | 0 | Tx and Rx have equal priority. Tx gets the access first on simultaneous requests |
0 | 0 | 1 | 1 | 0 | Tx has priority over Rx in ratio 2:1 |
0 | 1 | 0 | 1 | 0 | Tx has priority over Rx in ratio 3:1 |
0 | 1 | 1 | 1 | 0 | Tx has priority over Rx in ratio 4:1 |
1 | 0 | 0 | 1 | 0 | Tx has priority over Rx in ratio 5:1 |
1 | 0 | 1 | 1 | 0 | Tx has priority over Rx in ratio 6:1 |
1 | 1 | 0 | 1 | 0 | Tx has priority over Rx in ratio 7:1 |
1 | 1 | 1 | 1 | 0 | Tx has priority over Rx in ratio 8:1 |
Static Mapping: In Static Mapping mode, all packets of an Rx Queue are connected to a specific DMA channel.
In this mode, all of the packets of an Rx Queue are connected to a specific DMA channel. For example, all the packets from Rx Queue 0 can be routed to a DMA channel by programming Q0MDMACH (bit[3:0]) and Q0DDMACH (bit[7] = 0) of the MTL_RxQ_DMA_Map0 Register.
Similarly, packets from other Rx Queues can be routed to any DMA channel by programming register fields corresponding to each Queue.
Dynamic (Per Packet) Mapping: In Dynamic (per packet) Mapping mode, the destination DMA channel is decide by the MAC core receiver for each packet.
In this mode, the destination DMA channel of a packet being read from a Rx Queue is not constant but decided independently for each packet. For example, if you set the Q1DDMACH bit of the MTL_RxQ_DMA_Map0 register, the static mapping is disabled for Rx Queue 1 and the value in Q1MDMACH is ignored. The destination DMA channel is decided by the MAC receiver for each packet, depending on the following in decreasing order of priority:
If none of the L3-L4 Registers give a comparison match, then DWC_ether_qos proceeds to the next step.
The frame is routed to the smallest Matching Filter's DMA Channel provided the channel is enabled. If that filter's DMA Channel number is not enabled, the frame gets routed to Channel 0. For example, if a frame's VLAN tag matches filters 7, 3, and 1. Then the MAC checks if Filter 1's DMA Channel Number is enabled through programming. If yes, the frame gets routed to the programmed value; otherwise, the frame gets routed to DMA. When the inverse filter is enabled; is routed to the least mismatched filter's DMA channel number provided the channel is enabled. If the DMA Channel enable bit is not set, then the frame is routed based on DA based addressing or to Channel 0.
If Hash Filter is also enabled, it is used to determine the Filter result only. Routing still depends on the Perfect Filters enabled. If none of the perfect filters are enabled or if all of them are bypassed, then the VLAN Filter based routing does not take place. The frame is routed using DA Based addressing or to Channel 0. If all the perfect filters give a fail result and the Hash Filter has passed, then the VLAN Filter result is a pass but routing is based on DA Based Addressing or to Channel 0. Similar behavior is seen when inverse Filtering is enabled as well.
If none of the previous operations is able to make a successful match/decision, then the packet is routed to DMA Channel 0 by default.