lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #7454] add support for pbuf as an argument to tcp_wr


From: Matt Dittrich
Subject: [lwip-devel] [patch #7454] add support for pbuf as an argument to tcp_write()
Date: Mon, 31 Jan 2011 06:32:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 (.NET CLR 3.5.30729)

URL:
  <http://savannah.nongnu.org/patch/?7454>

                 Summary: add support  for pbuf as an argument to tcp_write()
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: mdittrich
            Submitted on: Mon 31 Jan 2011 06:32:18 AM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

The attached tcp_write_pbuf1/2.patch extend tcp_write() to accept a pbuf
chain as the data source.  This allows the application to allocate memory and
have the stack manage freeing the pbufs, possibly saving the memcpy() that
TCP_WRITE_FLAG_COPY uses. I only tested with PBUF_RAM, with
LWIP_CHECKSUM_ON_COPY off.

The attached pbuf_memcpy1/2.patch add pbuf_memcpy() and apply on top of the
tcp_write() patches.  pbuf_memcpy() "fills" a pbuf chain from a user buffer
like pbuf_take(), but maintains state (position in the chain) between calls so
it can be called multiple times on the same chain. A call to
pbuf_memcpy_cleanup() is required to fixup the lengths before a call to
tcp_write().  pbuf_memcpy() could replace pbuf_take() without much execution
time penalty.

I found that the pbuf_mempy()'d data gets corrupted when sent if a pbuf in
the chain has an uneven length... might be my MAC driver.

MD



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 31 Jan 2011 06:32:19 AM GMT  Name: tcp_write_pbuf1.patch  Size: 3kB
  By: mdittrich

<http://savannah.nongnu.org/patch/download.php?file_id=22562>
-------------------------------------------------------
Date: Mon 31 Jan 2011 06:32:19 AM GMT  Name: pbuf_memcpy1.patch  Size: 4kB  
By: mdittrich

<http://savannah.nongnu.org/patch/download.php?file_id=22563>
-------------------------------------------------------
Date: Mon 31 Jan 2011 06:32:19 AM GMT  Name: tcp_write_pbuf2.patch  Size:
473B   By: mdittrich

<http://savannah.nongnu.org/patch/download.php?file_id=22564>
-------------------------------------------------------
Date: Mon 31 Jan 2011 06:32:19 AM GMT  Name: pbuf_memcpy2.patch  Size: 889B  
By: mdittrich

<http://savannah.nongnu.org/patch/download.php?file_id=22565>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?7454>

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




reply via email to

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