What is the relationship of DMA ring buffer and TX/RX ring for a network card?

4va1anch3 picture 4va1anch3 · Nov 23, 2017 · Viewed 7k times · Source

I know that for a network card, OS must allocate tx/rx rings for it so that when OS wants to receive/transmit packets, the network card will know where the packets are and which packets are to be transmit.

And when I read about DMA, I see something named DMA ring buffer. Are the DMA ring and tx/rx ring the same thing?Or what is the relationship?

Answer

Alok Prasad picture Alok Prasad · Dec 26, 2019
  1. Ring Buffer Contains Start and End Address of Buffer in RAM. TX Ring will contain addresses of Buffer in RAM that contains data to be transmitted. RX Ring will contains address of Buffer in RAM where NIC will place data.

    These rings are present in RAM.

  2. TX buffer and RX buffer are are in RAM pointed by TX/RX rings.

  3. Now Network Card Register has Location of Rings Buffer in RAM .

Now 1 and 2 can be DMA able buffer , they are called DMA TX/RX ring and DMA TX/RX buffer. Now since RX/TX ring must remain throughout they are made as consistent/coherent DMA type of meory. While Buffers are made streaming/Single DMA type of memory

enter image description here enter image description here enter image description here enter image description here