[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Automatic Rx DMA ring replenish
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] Automatic Rx DMA ring replenish |
Date: |
Sun, 30 Oct 2011 18:13:03 +0100 |
"address@hidden" <address@hidden> wrote:
> What if I make the Rx DMA buffer descriptor ring large enough to hold all
> POOL pbufs. At start-up all POOL pbufs are allocated and put in the Rx DMA
> ring.
> pbuf_free() is modified so that whenever a POOL pbuf is freed it is
> immediately put in the Rx DMA ring.
>
> This should improve performance, as well as simplify the ethernet driver a
> bit.
If it works for your hardware, good enough. The modification would probably be
calling your custom free function instead of memp_free from pbuf_free.
However, I don't think that will work with many DMA enabled MACs: the ones I've
worked with have the RX descriptors in internal memory, so the ring can't be
made larger. And because RX packets are sometimes buffered (i.e. TCP OOS data),
you will want to have many more PBUF_POOL pbufs than fit into your DMA ring
(depending on its size and the expected throughput, of course).
However, I guess providing a way to change memory allocation/deallocation to
use custom functions would be a good thing to support many different types of
zero copy MACs without having to change the lwIP code for every hardware, so I
guess it's well worth a try for your target!
Simon