First of all let me give you a brief on the insides of Ethernet MAC.
We have a MAC module which interacts with Physical layer and we have DMA which interacts with memory. So the Ethernet frame flow is like this

Transmit:
Memory-->DMA-->MAC-->Physical Layer
Receive:
Memory<--DMA<--MAC<--Physical Layer

Transmit and receive descriptors are basically used by DMA. In these descriptors, we  give address of  memory location from where DMA reads and writes back the Ethernet frame while transmitting and receiving respectively. Apart from memory location,  many other important parameters which  are required by DMA  to process a frame are programmed in descriptors.Once all the information is programmed, we give the control of descriptors to DMA. We can have one or many descriptors for one frame. When transmit or receive of frame is complete , DMA updates the status in descriptors and assign them back to user. Once we read status and frame data,  we again give control of descriptors back to DMA and the process continues.
It's our choice how many descriptors we want to program. The more descriptors we program...the more frames we can process in one go (high performance) but yes at the cost of more kernel resources. There is always a trade off in kernel.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 horace papa 的頭像
    horace papa

    Horace papa's life

    horace papa 發表在 痞客邦 留言(0) 人氣()