Hello @sathishkumar_sunmugavel ,
Thank you for detailed description of your query.
I took a look at the RTD driver and found the following:
- The function GMAC_SetRxQueuesDmaChMap() in Gmac_Ip_Hw_Access.c configures the mapping between Rx queues and DMA channels using the MTL_RXQ_DMA_MAP0 and MTL_RXQ_DMA_MAP1 registers.
- Each queue can be assigned a default DMA channel (QxDDMACH) and a MAC address matched DMA channel (QxMDMACH), which is used when a packet matches a configured MAC address filter.
- The driver supports dynamic channel selection via the DCS bit in the MAC_ADDRESS1_HIGH register, allowing packets with specific destination MAC addresses to be routed to specific DMA channels.
- The interrupt handlers in Gmac_Ip_Irq.c and the initialization logic in Gmac_Ip.c confirm that the driver supports multiple DMA channels and queues, and that the mapping is handled explicitly during initialization.
Q1: How does the GMAC decide which Rx queue to use when a packet matches a MAC address filter?
When a packet matches a MAC address filter (e.g., MAC_ADDRESS1_HIGH/LOW), and the DCS (Dynamic Channel Select) bit is set, the GMAC uses the QxMDMACH field from the MTL_RXQ_DMA_MAPx register to determine which DMA channel (and thus which Rx queue) should handle the packet.
This mapping is configured in the RTD driver via the function:
void GMAC_SetRxQueuesDmaChMap(GMAC_Type * Base, uint8 QueuesNum)
This function sets up the mapping between Rx queues and DMA channels using registers like:
- MTL_RXQ_DMA_MAP0
- MTL_RXQ_DMA_MAP1
For example:
Base->MTL_RXQ_DMA_MAP0 |= GMAC_MTL_RXQ_DMA_MAP0_Q1MDMACH(1U);
This means: if a packet matches the MAC address filter and DCS is enabled, it will be routed to DMA channel 1, which is typically associated with Rx queue 1.
Q2: How to configure the mapping between Rx queues and DMA channels?
The mapping is explicitly configured in the RTD driver using the GMAC_SetRxQueuesDmaChMap() function. Each queue can be assigned:
- A default DMA channel (QxDDMACH) – used for general traffic.
- A MAC-matched DMA channel (QxMDMACH) – used when a packet matches a MAC address and DCS is set.
This allows flexible routing of traffic based on MAC address filtering.
This is a very specific question related to the internal logic of GMAC and its interaction with DMA. If you require further information, please contact your FAE directly or create a support ticket via the following link:
https://support.nxp.com/s/?language=en_US
Thank you for your understanding.
Best regards,
Pavel