Re: TTY_FLIPBUF_SIZE too low causing dataloss on too fast serial lines?

Theodore Y. Ts'o (tytso@mit.edu)
Tue, 25 May 1999 19:45:16 -0400 (EDT)


Date: Tue, 25 May 1999 22:44:30 +0200
From: Pavel Machek <pavel@bug.ucw.cz>

I tried implementing 1Mbit irda driver as a tty (same as serials
are). I _think_ I've hit the limit of TTY_FLIPBUF_SIZE. Is it
possible? I assume flipbufs are flushed every 10ms or so (am I right?);
in such case situation is pretty bad: that means 50K/sec max and
modern serial ports can do up-to twice as much. From reading sources I
_think_ that TTY_FLIPBUF_SIZE can not be easily increased....

Nope, it can't be easily increased without making some relatively major
changes to the tty driver. I've been meaning to do this so that the you
can use a bigger flip buffer size, where it's necesasry, though.

One question though is how is your irda driver grabbing the characters?
Is it grabbing them all at interrupt time, or is it polling like many of
the high-speed intelligent serial boards? If it's polling, you *don't*
to use the flip buffers; instead, just throw it onto a local buffer and
just call the line discpline directly. (See the Rocketport driver for
an example of this). Remember, you don't *have* to use the flip buffer
abstraction; it's a service which the tty layer provides to reduce the
amount of time spent in the interrupt driver, but you can bypass it if
you wish.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/