Date: Wed, 16 Nov 2005 14:06:05 -0800 (PST) From: Dirk-Willem van Gulik <dirkx@webweaving.org> To: freebsd-hackers@freebsd.org Subject: Dealing with silo overflow and interrupt-level buffer overflow in sio(4) Message-ID: <20051116140145.V22890@skutsje.san.webweaving.org> In-Reply-To: <Pine.OSX.4.61.0511161139150.3380@gprs133.anywi.koole.com> References: <Pine.OSX.4.61.0511161139150.3380@gprs133.anywi.koole.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I found that for virtually all GPRS and UMTS cards I tried that I get so many interopt and silo overflow errors as to virtually make the card unusable. Attached patch below allows one to increase the buffer a bit; relative to the speed of the connection. Thanks, Dw. *** sio.c.orig Wed Nov 16 21:49:23 2005 --- sio.c Wed Nov 16 21:57:46 2005 *************** *** 1906,1911 **** --- 1907,1915 ---- return (0); } + + static int cp4tick_rate = 4; + TUNABLE_INT("machdep.sio.cp4tick_rate", &cp4tick_rate); /* * This function must be called with the sio_lock mutex released and will * return with it obtained. *************** *** 1926,1932 **** * (about 3 ticks if input flow control is not used or not honoured, * but a bit less for CS5-CS7 modes). */ ! cp4ticks = 40 * speed / 10 / hz * 4; for (ibufsize = 128; ibufsize < cp4ticks;) ibufsize <<= 1; if (ibufsize == com->ibufsize) { --- 1930,1936 ---- * (about 3 ticks if input flow control is not used or not honoured, * but a bit less for CS5-CS7 modes). */ ! cp4ticks = (cp4tick_rate ? cp4tick_rate : 4) * speed / 10 / hz; for (ibufsize = 128; ibufsize < cp4ticks;) ibufsize <<= 1; if (ibufsize == com->ibufsize) {root@builld-jv# diff -c sio.4.orig sio.4 *** sio.4.orig Wed Nov 16 21:57:33 2005 --- sio.4 Wed Nov 16 22:02:04 2005 *************** *** 363,368 **** --- 363,381 ---- .Pp The device numbers are made from the set [0-9a-v] so that more than 10 ports can be supported. + .Sh TUNABLES + The driver supports the following tunable parameters, which may be + added to + .Pa /boot/loader.conf + or set via the + .Xr sysctl 8 + command: + .Bl -tag -width ".Cm machdep.sio.cp4tick_rate " -compact + .It Cm machdep.sio.cp4tick_rate + Rate by which to increase the buffer ti handle softtty interrupt + latency. Default value is 4; to deal with about 2-3 ticks without + loss of throughput or data. + .El .Sh DIAGNOSTICS .Bl -diag .It sio%d: silo overflow. *************** *** 370,382 **** .El .Bl -diag .It sio%d: interrupt-level buffer overflow. ! Problem in the bottom half of the driver. .El .Bl -diag .It sio%d: tty-level buffer overflow. Problem in the application. Input has arrived faster than the given module could process it ! and some has been lost. .El .\" .Bl -diag .\" .It sio%d: reduced fifo trigger level to %d. --- 383,395 ---- .El .Bl -diag .It sio%d: interrupt-level buffer overflow. ! Problem in the bottom half of the driver. Try increasing machdep.sio.cp4tick_rate. .El .Bl -diag .It sio%d: tty-level buffer overflow. Problem in the application. Input has arrived faster than the given module could process it ! and some has been lost. Try increasing machdep.sio.cp4tick_rate. .El .\" .Bl -diag .\" .It sio%d: reduced fifo trigger level to %d.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051116140145.V22890>