From owner-freebsd-hackers Tue Nov 11 19:11:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA23346 for hackers-outgoing; Tue, 11 Nov 1997 19:11:41 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA23339 for ; Tue, 11 Nov 1997 19:11:38 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id OAA00642; Wed, 12 Nov 1997 14:05:03 +1100 Date: Wed, 12 Nov 1997 14:05:03 +1100 From: Bruce Evans Message-Id: <199711120305.OAA00642@godzilla.zeta.org.au> To: bde@zeta.org.au, mouth@ibm.net Subject: Re: Status of 650 UART support Cc: hackers@freebsd.org Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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