[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs
From: |
Dirk Ziegelmeier |
Subject: |
[lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs |
Date: |
Fri, 23 Dec 2016 21:02:08 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0 |
Follow-up Comment #8, bug #49914 (project lwip):
Zero-copy depends on the application:
1)
- application uses raw API
- application creates a PBUF and generates/assembles its data into the PBUF
- application hands PBUF to lwIP
- lwIP prepends UDP/IP/ethernet header
- A scatter-gather capable DMA netif increases refcount on pbuf and enqueues
it in the ETH HW DMA chain
- ETH HW sends pbuf
- netif decreases refcount on PBUF, pbuf is released
2)
- application uses socket API
- application has data to send in a contiguous buffer anyway
- application calls lwip_send()
- lwIP creates a ref PBUF with pointer to application data
- lwIP prepends PBUF with UDP/IP/ethernet header
- netif synchronously copies data into ETH HW buffer for sending (not DMA
capable)
Problems:
- Systems with large amount of resources usually have an OS -> mostly socket
API is used. But these systems often have a DMA capable ETH HW -> copy needed
in driver for DMA
- Systems with low amount of resources usually have no OS -> raw API is used.
These systems often do NOT have DMA capable ETH HW -> copy needed in driver
for into ETH HW buffer
-> the only systems that can really do zero-copy TX are:
1) large systems with OS and socket API that have non-DMA HW (are there
systems like that?)
2) systems where RAW API is used (no matter if OS is running or not) and
DMA-capable HW. Whether to use RAW API or socket API depends on application
demands, portability requirements and programming effort
Comments to this summary? Is this correct or am I missing something?
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?49914>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Dirk Ziegelmeier, 2016/12/22
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Dirk Ziegelmeier, 2016/12/22
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Joel Cunningham, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Simon Goldschmidt, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Joel Cunningham, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Dirk Ziegelmeier, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, David van Moolenbroek, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Joel Cunningham, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, David van Moolenbroek, 2016/12/23
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs,
Dirk Ziegelmeier <=
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Joel Cunningham, 2016/12/27
- [lwip-devel] [bug #49914] lwip_sendmsg uses PBUF_REF pbufs, Simon Goldschmidt, 2016/12/27