From owner-freebsd-questions Tue Oct 14 22:26:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA17781 for questions-outgoing; Tue, 14 Oct 1997 22:26:30 -0700 (PDT) (envelope-from owner-freebsd-questions) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA17772 for ; Tue, 14 Oct 1997 22:26:21 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.7/8.8.5) id OAA07117; Wed, 15 Oct 1997 14:56:06 +0930 (CST) Message-ID: <19971015145606.47003@lemis.com> Date: Wed, 15 Oct 1997 14:56:06 +0930 From: Greg Lehey To: "Matthew D. Fuller" Cc: parrothd@midwest.net, freebsd-questions@FreeBSD.ORG Subject: Re: tty-level buffer overflows References: <19971012093454.31985@lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: ; from Matthew D. Fuller on Wed, Oct 15, 1997 at 12:19:14AM -0500 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Fight-Spam-Now: http://www.cauce.org Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Wed, Oct 15, 1997 at 12:19:14AM -0500, Matthew D. Fuller wrote: > On Sun, 12 Oct 1997, Greg Lehey wrote: > >> On Thu, Oct 02, 1997 at 09:26:09AM -0500, bla bla wrote: >>> Greg Lehey wrote: >>>> >>>> On Wed, Oct 01, 1997 at 10:51:09PM -0500, Jonathan E. Lyons wrote: >>>>> Is this anything to be concerned about? I've got an X2 modem, with the port >>>>> speed set at 57600..... >>>>> >>>>> >>>>> Sep 28 16:42:11 cplkagan /kernel: sio0: 660 more tty-level buffer overflows >>>>> (total 660) >>>>> Sep 29 13:52:41 cplkagan /kernel: pid 18534 (ping), uid 0: exited on signal 3 >>>>> Sep 30 21:05:02 cplkagan /kernel: sio0: 100 more tty-level buffer overflows >>>>> (total 760) >>>>> Sep 30 22:00:02 cplkagan /kernel: sio0: 198 more tty-level buffer overflows >>>>> (total 958) >>>>> Sep 30 22:05:01 cplkagan /kernel: sio0: 199 more tty-level buffer overflows >>>>> (total 1157) >>>>> Sep 30 22:05:02 cplkagan /kernel: sio0: 1076 more tty-level buffer >>>>> overflows (total 2233) >>>>> Oct 1 05:30:02 cplkagan /kernel: sio0: 940 more tty-level buffer overflows >>>>> (total 3173) >>>> >>>> Yes. With PPP, each of these means a lost packet, which is expensive. >>>> This shouldn't happen. Is the machine slow or heavily loaded? >>>> Otherwise you might be losing interrupts. >>>> >>>> Greg >>> >>> Depends on your version of slow,:), it's a 486/66 8megs of ram, running >>> ppp -alias, for a small house LAN. It does however has other processes >>> running, but whenever I do a top -s 1 about %90 of the machine is idle, >>> until someone starts to dl, or hits the Web server from the local LAN. >>> Could it be the serial ports itself? The board it self has one built-in >>> serial port, but I didn't think it could handle the speed(it's an old >>> Packard Hell MB) so I threw in a multi I/O card, trying to avoid serial >>> problems... >> >> The CPU has enough power, but with 8 MB you're going to be doing a lot >> of swapping, during which I think the async interrupts are locked out. >> I'd consider this fits my description of "heavily loaded", even if the >> CPU is 90% idle. This could be your problem. > > I had a problem with overflows. > I have a 28.8 modem, and if I set the port speed to 115200, I get > overflows over-flowing on my xconsole. But only on incoming packets, > which would seem to me to be the opposite of what you'd expect. It's certainly what I would expect. It's impossible to get overflows on outgoing packets unless the driver is programmed wrong. > If I set it to 28800, no problems. If I set it to 14400, no > problems. I know it's not my system that's slow; Cyrix 6x86 166, 72 > megs RAM, the serial ports are both 16550. What happens if you set the port speed to 57600? If that works, that should be enough for you. Otherwise you should check your cabling and modem setup. You should be using hardware handshake. Check this excerpt from "The Complete FreeBSD": +-----------+---------------------------------------------------------------------+ |Command | Meaning | +-----------+---------------------------------------------------------------------+ |ATT | Set tone (DTMF) dialling. | |ATVnumber | If number is 0, return result codes in numeric form. If it's 1, | | | return text. Don't rely on either form to be consistent from one | | | modem to the next. | |ATXnumber | Determine the form of the result codes. This depends a lot on the | | | manufacturer, but it's important for chat scripts. If you run into | | | trouble, with chat scripts, check your modem documentation. | |ATZ | Reset modem configuration to default values. | |AT&Knumber | Select flow control method. Normally, 3 enables RTS/CTS flow | | | control, which is what you want. | |AT&Rnumber | If number is 0, CTS is only asserted if the DTE asserts RTS, even | | | if the modem is able to receive data. If it's set to 1, it behaves | | | normally. Make sure this value is set to 1. | |AT&Tnumber | Perform modem-specific test number. This command is the origin of | | | the statement: ``UNIX is a trademark of AT&T in the USA and other | | | countries. AT&T is a modem test command''. | |AT&V | View the current configuration. See the example below. | |AT&Wnumber | Store the current configuration as profile number. Most external | | | modems can store two profiles, or configurations. If number is not | | | specified, write the profile specified in a previous AT&Y command. | | | See the example below. | |AT&Ynumber | Decide which profile (0 or 1) will be loaded when the modem is | | | reset, and which will be written by the command AT&W | +-----------+---------------------------------------------------------------------+ For an example of what you might look at, let's consider a manual dialup to an ISP: # ppp ISP User Process PPP. Written by Toshiharu OHNO. Using interface: tun0 Interactive mode Warning: No password entry for this host in ppp.secret Warning: Manipulation is allowed by anyone ppp ON freebie> term go into direct connect mode Enter to terminal mode. Type `~?' for help. at synchronize with the modem OK at&v look at the modem profile ACTIVE PROFILE: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K4 &Q5 &R1 &S0 &T5 &X0 &Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K4 &Q5 &R1 &S0 &T5 &X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0=T1234567890 1= 2= 3= OK The term profile refers to a set of the complete configuration information for the modem. External modems can usually store two different profiles. The AT&V command shows the current configuration (``active profile'') and the two stored profiles. The first line reflects the parameters set with AT commands (for example, L0 means that the command ATL0, turn off the speaker, has been issued). The next two or three lines reflect the values of the S registers. In addition, this modem can store up to four telephone numbers, a feature which is seldom of great interest. If you look at this profile, you'll notice that the active profile includes the parameter &K4. This means ``use XON/XOFF flow control''. This is not desirable: it's better to use RTS/CTS flow control. To fix it, at&k3 set RTS/CTS flow control OK at&w write the active profile OK at&v and check ACTIVE PROFILE: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 &Y0 S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020 S44:020 S46:138 S48:007 S95:000 STORED PROFILE 0: B0 E1 L0 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 STORED PROFILE 1: B0 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 S00:000 S02:043 S06:002 S07:060 S08:002 S09:006 S10:014 S11:090 S12:050 S18:000 S36:007 S37:000 S40:104 S41:195 S46:138 S95:000 TELEPHONE NUMBERS: 0=T1234567890 1= 2= 3= OK Greg