Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 1995 01:19:59 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        hsu@clinet.fi
Cc:        current@freebsd.org
Subject:   Re: kern/579: sio: RS_IBUFSIZE 256 too small
Message-ID:  <199507021519.BAA16708@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>Synopsis:       sio: RS_IBUFSIZE at 256 bytes serial lines loose data (PPP)

>	A 486-40 with 6 16550 ports and 4 ethernets (3 active)
>	A 386-16 with 1 16550 ports and 1 ethernet (just a PPP router)

>>Description:

>	Both these machines report "interrupt-level buffer overflow":s 
>	very frequently on a leased line running at 38400, badly dropping
>	IP performance. 

This is because you don't use crtscts and something or other delays
softclock() by more than (RB_IBUFSIZE - ceil(38400/10/100.0) = 217
character times, i.e., for more than 5.5 clock interrupts.  Hardware
interrupts and all other software interrupts have priority over
softclock(), so any solid block of hardware or net interrupts would do
this.  I would be surprised if ethernet interrupts on the 386/16 didn't
do it.

>	On 386-16 I also saw several spontaneous reboots when loading the 
>	PPP link.

Another problem.  I saw a spontaneous reboot today when I did something
silly involving pppd and tcpdump.  The system normally just panics when
tcpdump is killed after pppd is killed.

>>How-To-Repeat:

>	It seems that this bites only me, even though it does this on two 
>	quite different configurations.  In addition the 486 machine has

I think you said that 1.1.5 doesn't have the problem.  I can't explain
how it could work better.  -current should work a little better because
ordinary timeouts are no longer used.  Hardware interrupts still block
siopoll() but soft net interrupts don't.

>>Fix:
>	
>	I changed RS_IBUFSIZE from 256 to 4096, and the problem disappeared. 
>	It might be that a smaller amount would be sufficient (I don't mind
>	8k memory waste per line in this case).  But it is apparent that
>	256 bytes seems not sufficient for slow or loaded machines. 

>sio.c:
>< #define      RS_IBUFSIZE     256
>--
>> #define      RS_IBUFSIZE     4096

This breaks crtscts unless you make TTYHOG 16 times as large to match.
The watermark RB_I_HIGH_WATER = (TTYHOG - 2 * RB_IBUFSIZE) must be
significantly larger than 0.  TTYHOG must to be larger than 2 * RB_IBUFSIZE
even without crtscts.

Bruce



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