[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] LWIP/WIN32 UDP performance (throughtput)
From: |
Mason |
Subject: |
Re: [lwip-users] LWIP/WIN32 UDP performance (throughtput) |
Date: |
Tue, 14 Feb 2012 10:37:59 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20120129 Firefox/10.0 SeaMonkey/2.7 |
Mason wrote:
> Simon Goldschmidt wrote:
>
>> Still, I think lwIP should be able to achieve the performance you want if:
>> A) your netif driver correctly supports zero copy
>
> A few months ago(*) we discussed zero-copy for DMA drivers,
> and you wrote:
>
>> For the RX side, using a *custom* PBUF_REF would be the best solution.
>> That's a pbuf that has a 'freed' callback and references external
>> memory. However, that doesn't work, yet (though I planned to add support
>> for it as I can see it's one possible solution to implement DMA MAC
>> drivers). The problem here is that pbuf_header() can't grow such pbufs
>> (as it doesn't know the original length). This would have to be fixed by
>> changing the struct pbuf (if only for PBUF_REF pbufs).
>
> Is this mode supported in the trunk?
> If yes, do you plan to port it to 1.4.1?
> If no, that means I have to memcpy every incoming frame, right?
>
>> As to the TX side: normally, TX pbufs are allocated as PBUF_RAM, the
>> memory for that is taken from the heap by calling mem_malloc(). Now the
>> simple solution would be to just replace mem.c by your own code
>> allocating and freeing from your TX pool: with the correct settings,
>> mem_malloc() isn't used for anything else buf PBUF_RAM pbufs. The only
>> problem might be that you don't know in advance how big the memory
>> blocks are (and thus how big your TX buffer entries should be), but by
>> using TCP_OVERSIZE, you can just use the maximum ethernet frame size (if
>> you don't mind wasting some RAM for smaller packets).
>
> But when I looked,
>
> I don't think it's possible to use mem_malloc as a packet
> buffer allocator, as there are other types of uses, e.g.
>
> dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp));
> autoip = (struct autoip *)mem_malloc(sizeof(struct autoip));
>
> What I'd like is to be able to "redirect" pbuf_alloc to use
> my buffer allocator, but the pbuf struct and the payload buffer
> would not be contiguous, which violates the implicit assumptions
> of PBUF_RAM pbufs, IIUC.
>
> Have things changed on that front?
> If no, that means I have to memcpy every outgoing frame, right?
>
> (*) Date: Thu, 06 Oct 2011 16:10:07 +0200
> http://lists.gnu.org/archive/html/lwip-users/2011-10/msg00008.html
I did find this information on the lwip wiki
http://lwip.wikia.com/wiki/Writing_a_device_driver#Notes_on_Zero-Copy_Network_interface_drivers
But I think it's a little bit dated?
--
Regards.
Re: [lwip-users] LWIP/WIN32 UDP performance (throughtput), Zayaz Volk, 2012/02/08