lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_write with zero-copy


From: address@hidden
Subject: Re: [lwip-users] tcp_write with zero-copy
Date: Sun, 17 Feb 2008 11:52:10 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Timmy Brolin wrote:
I had a quick look at the tcp_write function, and it seems there could be some problems involved. Things such as what if the available "space" in the send buffer is smaller than a pbuf. Should the pbuf be splitted and reallocated, or should the entire pbuf be added to the send queue anyway.
For now I will probably look into implementing something using tcp_sent.

I don't think it's that hard to implement. Just move the code that creates the data-pbuf from tcp_enqueue to an wrapping function and call the new tcp_enqueue (which then takes a pbuf pointer instead of a data pointer and length) directly. Of course there have to be some checks: if the send-buffer is full, discard the complete pbuf and the pbufs must fit into TCP segments. Other than that, I think it's pretty straightforward and can help to speed up (might save one memcpy) and save space at least for some users.

On the other hand, it has to be well documented that users don't may reuse the pbufs given to TCP in this way, because they are modified by the stack.

Anyway, this is post-1.3.0 so it might take a while...

Simon




reply via email to

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