tasklwIP - A Lightweight TCP/IP stack - Tasks: task #7013, Create option to have all packets...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #7013: Create option to have all packets delivered to netif->output in one piece

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Sat 16 Jun 2007 01:48:02 PM UTC
   
 
Category:  None Should Start On:  Sat 16 Jun 2007 12:00:00 AM UTC
Should be Finished on:  Sat 16 Jun 2007 12:00:00 AM UTC Priority:  1 - Later
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  100%
Open/Closed:  Closed Planned Release:  1.4.0
Effort:  0.00

Jump to the original submission

Sun 28 Mar 2010 10:50:55 AM UTC, comment #7: 

Fixed ip_frag: a new PBUF_RAM is created for each outgoing fragment if IP_FRAG_USES_STATIC_BUF==0 and LWIP_NETIF_TX_SINGLE_PBUF==1.

Simon Goldschmidt <goldsimon>
Group administrator
Sat 06 Mar 2010 11:57:09 AM UTC, comment #6: 

After task #7040 is done, LWIP_NETIF_TX_SINGLE_PBUF works for TCP, too.

ip_frag() still creates pbuf chains, which could be fixed by having a PBUF_ROM-style pbuf type for which pbuf_header() works.

Simon Goldschmidt <goldsimon>
Group administrator
Sun 10 May 2009 05:14:15 PM UTC, comment #5: 

Since noone objected, I've checked in some (additional only) code:
- added new option LWIP_NETIF_TX_SINGLE_PBUF (below changes are only enabled when setting this to 1)
- lwip_sendto creates PBUF_RAM and copies the data into it for UDP/RAW sockets
- Added 2 functions pbuf_take (copy data into pbuf) and pbuf_coalesce (create a single pbuf from a pbuf queue)
- Added function-like define netbuf_take (calls pbuf_take)

I did not enforce single-pbuf packets: if they still occur, the driver has to use pbuf_coalesce() to create a single pbuf. This is because memcpy is used there, which might be solved better by the driver.

What remains is the work in tcp_enqueue (task #7040: Work on tcp_enqueue) to use one pbuf per segment only.

Also, checksum-on-copy would be nice to have to meet the new copy-overhead when setting LWIP_NETIF_TX_SINGLE_PBUF=1.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 06 May 2009 05:15:14 PM UTC, comment #4: 

I'm starting to work on this, I plan to influence writing of data on socket level (udp/raw send), on ip_frag level and in tcp_enqueue as well as having a guard before netif->linkoutput that does the alloc-and-copy instead of doing it in the driver. This is because it cannot be guaranteed that data is in one pbuf (e.g. passing a pbuf to udp/raw_send that cannot hold headers, using tcp_write with the NOCOPY flag).

Overall, I want to make the stack achieve this goal if the user is cooperative, not by all means - in contrast to the current situation where tcp packets are often a chain of pbufs and UDP socket packets are always.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 04 Feb 2009 09:11:51 PM UTC, comment #3: 

Fragmentation also happens with UDP sockets: data is sent without copying: a PBUF_REF is used.

Of course, there is another problem with that (when using DMA MACs), but that's off topic here.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 04 Feb 2009 05:54:52 PM UTC, comment #2: 

The tcp-oversize patch attached to task #7040 tries very hard to make this happen when TCP_OVERSIZE is defined to TCP_MSS.

There are no guarantees, so the driver will still have to check if outgoing packets are fragmented. Fragmentation occurs when:

- User passes a pbuf to udp_send that is already fragmented or without sufficient header space.
- User calls tcp_write multiple times without calling tcp_output_nagle in between, and without passing TCP_WRITE_FLAG_MORE to tcp_write.
- User calls tcp_write without TCP_WRITE_FLAG_COPY.


Jakob Stoklund Olesen <stoklund>
Group Member
Wed 17 Oct 2007 08:25:54 PM UTC, comment #1: 

This would help performance for me, but in a slightly differnet way. I currently have to coalesce the pbuf chain to pass the packet to the driver send queue due to a legacy driver interface limitation.

Thomas Taranowski <taranowski>
Group Member
Sat 16 Jun 2007 01:48:02 PM UTC, original submission:  

Some MACs that have DMA queues don't support creating a packet from 2 or more different locations in RAM (e.g. pbuf chain).

To avoid having to copy the whole packet into a new one before enqueueing it to send, it can be better to create the whole packet in one big pbuf (and so to avoid send-by-reference somtimes).

Place that would need changes include the sending of data over UDP sockets and the copy flag in tcp_write. (Maybe more?)

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by stoklund (Posted a comment)
  • -email is unavailable- added by taranowski (Posted a comment)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-28 goldsimon StatusNone Done
        Percent Complete90% 100%
        Open/ClosedOpen Closed
    2010-03-06 goldsimon Percent Complete50% 90%
        Planned ReleaseNone 1.4.0
    2009-05-10 goldsimon Percent Complete0% 50%
        Assigned toNone goldsimon

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code