lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] RE: [lwip] Forcing PBUF_POOL


From: Wurmsdobler, Peter
Subject: [lwip-users] RE: [lwip] Forcing PBUF_POOL
Date: Wed, 08 Jan 2003 23:37:39 -0000

David, thanks for your thoughts.

> the descriptor ring. What hardware are you using?
Hardware is a home-brewn system board with an SH processor and a TI FireWire
chipset. In terms of software, a Mindready Firewire driver for the low level
is used. The hardware closest function writing u32 to registers does a loop
and outputs the flat buffer:

        for( quadIndex=1; quadIndex<length/4; quadIndex++ )
                {
                SetLynxReg32( LYNX_ATFCONT, *pData32++, Reg1);
                }

> Buffer chaining is useful in a protocol stack because you can preprend
> additional protocol layers easily. It actually becomes more efficient than
> moving the data. 
I 100% agree with you. I never intended to move data in order to prepend 
a header.

> Even if you use a single buffer to put the data into in UDP, 
> it still will need an IP header and then a link-layer (ethernet or PPP
> or SLIP) header. 
For this reason I wanted to allocate a PBUF_TRANSPORT buffer within the
application. The buffer has a configurable PBUF_LINK_HLEN of lets say 16
bytes in addition to the IP and transport bytes. The control application
starts to fill in that payload and then issues a udp_send(); Travelling
through the code, each layer will add its header by shifting the payload
pointer left. At the end, the buffer is let's say full to the left, and the
Mindready code will run through the loop writing u32 to a register.

Again, chaining is a very beautiful thing. Only in our application having a
simple  functions which uses a single pbuf throughout the stack would be
efficient. We would not like to break packets/segments/frames etc. 

Also the link layer will allow only a limited size of frames. If the TCP
segments and UDP datagrams are smaller than the frame-size minus
header-size, then its OK. But here I have a doubt: If TCP segments are
smaller than frame-size minus header-size, and the pbufsize is bigger, then
only a single pbuf would be written to a link driver? For UDP I did not find
any restrictions in the code. But IP packets must be limited also. 

peter
[This message was sent through the lwip discussion list.]




reply via email to

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