[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] ppp-new threading question
From: |
Sylvain Rochet |
Subject: |
Re: [lwip-users] ppp-new threading question |
Date: |
Fri, 29 Aug 2014 23:48:25 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi Ivan,
On Fri, Aug 29, 2014 at 02:38:11PM -0600, Ivan Delamer wrote:
> Ok, that's what I thought. I will have to re-implement sio_write().
>
> What I'm concerned also is, sio_write() is meant to block until all
> data is pushed out. This can be more than a second in a slow 9600bps
> connection (still used sometimes!!!). Will PPP try to do something
> during this time like try to re-send the packet or think it was
> lost? I'm not familiar with the internal ppp timer processes.
Packet is lost, in my opinion this is the TCP job (or application job in
case of UDP or anything else) to retry. Dropping the packet if
sio_write() is going to block (eg. buffer full) is the right thing to
do. PPP only retries controls (LCP/IPCP/...) packets, with default
timeouts long enough for any link speed. Input IP and IPv6 encapsulated
in PPP packets are just decapsulated/deHDLCified and forwarded straight
off to the lwIP stack, same for IP and IPv6 output packets.
I would have preferred an API which used pbuf instead of raw data, so
that you can keep a ref on the pbuf while it is being sent over the
serial link, therefore preventing the double buffering requirement, but
I already changed the API too much ;-) ... and SIO API is also used for
SLIP links.
> It also means more dynamic memory allocation since a reference to
> pbuf is not passed to sio_write().
Hey, you are reading my mind.
Sylvain
signature.asc
Description: Digital signature