Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Nov 1997 14:05:03 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, mouth@ibm.net
Cc:        hackers@freebsd.org
Subject:   Re: Status of 650 UART support
Message-ID:  <199711120305.OAA00642@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I'm getting that "interrupt-level buffer overflow" message when I use
>the 650 UART support.  As long as I run the UARTs in 550 compatibility
>mode, they work fine.  My kernel is 3.0-971108-SNAP.
>
>I've looked at the source in sio.c and I see where the 650 auto
>CTS/RTS flow control is turned on, but I've made little other progress
>towards comprehending sio.c
>
>>static  char const * const      error_desc[] =3D {.
>>       "silo overflow",
>>       "interrupt-level buffer overflow",
>>       "tty-level buffer overflow",
>>};
>
>Can anyone explain the difference between these three types of
>overflows?

        "silo overflow",

This means that too many characters arrived before the sio interrupt
handler could run to transfer the characters from the hardware fifo
to the sio software fifo.  RTS flow control is almost useless for
preventing this error, since the interrupt handler must run to invoke
RTS flow control.

        "interrupt-level buffer overflow",

This means that too many characters arrived before the sio timeout
handler could run to transfer the characters from the software fifo
to the tty buffer (or to the line discipline routine, e.g., the kernel
ppp one).  RTS flow control is good for preventing this error, but you
hope that it is not invoked since it would decrease throughput.  It is
invoked when the the software fifo is 3/4 full (192/256 characters).
The gap between the high water mark and the end of the fifo (256 - 192)
needs to be larger than the hardware fifo size.  I think it is for
the 16550, so the 16550 bug must be elsewhere.

        "tty-level buffer overflow",

This means that too many characters arrived before the application
could run to transfer the characters from the tty buffer to the
application's buffer.

All buffer sizes are too small for 230400 bps.  The software fifo is
large enough for 22 msec worth of input at 115200 bps and the timeout
handler normally runs every 10 msec to drain it.  12 msec to spare
is normally plenty, but 2 msec for 230400 bps wouldn't be.

The tty buffer is large enough for 88 msec worth of input at 115200
bps.  This is too small, since the scheduling quantum is 100 msec and
it is possible for hundreds of processes to be scheduled ahead of you.
However, it works well in practice, at least if RTS flow control
is used, because processes usually only run for a few (hundred?)
usec before giving up control, and flow control prevents problems
from transient loads.  It usually isn't reasonable to make the tty
buffers hundreds of times larger to handle transient loads.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711120305.OAA00642>