Extend the write buffer handling in gathdlc.c to minimize stalling and
process switching during large PPP transfers. The single write buffer
is replaced by a queue of buffers, allowing for much larger emission
windows without hugely impacting memory consumption. This reduces the
time required to send 50 MB between a couple of local PPP interfaces on
my laptop from ~53s to ~3s.
Replace modulo operations in ringbuffer.c by masking operations. This
is possible because the size of the ring buffers is always a power of
two, and yields a small performance improvement.
The improvement should be mostly visible on processors that implement
division in microcode (Atom) or lack a division instruction (ARM).
Delay signaling of ppp_down until we exit the GAtHDLC read handler.
Otherwise exchanging the read handler on GAtIO might lead to funny
double consumption problems.
Sometimes we receive the no carrier embedded in a stream following the
PPP packets. This might be due to write scheduling on the remote side
or read scheduling locally. Try not to consume the no carrier condition
and assume the previous hdlc frames will result in closing of the ppp
stack.
commit 61b30c025d changed the way the
command callbacks are being called (namely the contents of the GAtResult
object). Most command callbacks were updated, but the internal ones
were forgotten. This patch fixes this issue.
Using my Huawei EM770W modem, if set ACCM as 0x00000000, RXJ-
event breaks PPP link, after IP package transmit for a while.
Using default ACCM, the issue can be fixed.
I tested it at China Unicom networks.
The command line parser knows where the actual command line parameters
begin, so there's no need to make the callback skip the prefix and the
additional separator characters.
According to RFC1662 Section 7.1, ACCM Configuration Option is
used to inform the peer which control characters MUST remain
mapped when the peer sends them.