lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-devel] again... Zero Copy Ethernet interface


From: bill
Subject: RE: [lwip-devel] again... Zero Copy Ethernet interface
Date: Fri, 23 Jan 2009 12:51:39 -0500

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Jakob Stoklund Olesen
> Sent: Wednesday, January 07, 2009 3:48 AM
> To: lwip-devel
> Subject: Re: [lwip-devel] again... Zero Copy Ethernet interface
> 
> I have implemented zero-copy DMA transmission like this:
> 
> err_t
> low_level_output(struct pbuf *pb)
> {
>   if (can_direct_dma(pb)) {
>     if (queue_dma_transfer(pb)) {
>       pbuf_ref(pb);
>       return ERR_OK;
>     }
>     else {
>       return ERR_IF;
>     }
>   }
>   else {
>     pb = flat_copy_pbuf(pb);
>     if (queue_dma_transfer(pb)) {
>       return ERR_OK;
>     }
>     else {
>       pbuf_free(pb);
>       return ERR_IF;
>     }
>   }
> }
> 
> dma_done(dma_transfer *tr)
> {
>   pbuf_free(tr->pb);
> }
> 
> This seems to work. If anybody knows why it shouldn't, please let me
> know.

Is dma_done called from a DMA-complete ISR?  If so, is it safe to do?  If
not, how are you signaling to the main thread/code that the DMA is complete?

Thanks,
Bill






reply via email to

[Prev in Thread] Current Thread [Next in Thread]