lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #7040] Work on tcp_enqueue


From: Jakob Stoklund Olesen
Subject: [lwip-devel] [task #7040] Work on tcp_enqueue
Date: Wed, 04 Feb 2009 11:47:45 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5

Follow-up Comment #15, task #7040 (project lwip):

Attached patch tcp-oversize applies on top of tcp-enqueue-split. Please
disregard the earlier tcp-enqueue-concat.

Implement the TCP_OVERSIZE setting
----------------------------------

When relevant, tcp_enqueue_data will allocate pbufs that are larger than
strictly necessary. Data from following writes is copied into the oversized
pbuf before new pbufs are allocated. The TCP_OVERSIZE setting controls the
maximum overallocation. It ranges from 0 to TCP_MSS.

Oversized allocation has the following advantages:

- Pbuf lengths are aligned to help picky DMA engines.
- Pbuf chain length and snd_queuelen can be controlled when using many small
writes.
- Pbuf vs data overhead can be controlled.
- Unfragmented TCP packets can be created for interfaces that can DMA but no
scatter-gather.

The disadvantage is a slightly higher RAM usage:

- struct tcp_pcb has an extra 16-bit field (unsent_oversize). This overhead
disappears due to alignment on 32-bit platforms.
- Unused overallocation in transmitted pbufs is wasted. This typically
happens in the last segment produced by a burst of writes.

To control the extra memory usage, tcp_enqueue_data will not allocate an
oversized pbuf if it thinks the segment will be transmitted immediately. The
heuristic is not perfect, but it works very well for slow stop-and-go
protocols like telnet.

Setting the TF_NODELAY flag on a pcb will disable oversizing unless
TCP_WRITE_FLAG_MORE is passed to tcp_write.



(file #17402)
    _______________________________________________________

Additional Item Attachment:

File name: tcp-oversize                   Size:15 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?7040>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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