lkml.org 
[lkml]   [1999]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: TTY Flip buffers

On Tue, 30 Nov 1999 tytso@mit.edu wrote:
>
> How many characters to you read from the Z at a time? Presumably you
> want to try to read as many characters as possible, in order to optimize
> for processing time, even though this has a negative impact on latency
> --- otherwise, why have a 8k hardware receive buffer in the first place.

Yes, I read as much as I can. The number is defined by:

MIN(char_count, MIN(tty->ldisc.receive_room(tty), buf_size))

, where:

- char_count = number of characters in the on-board (HW) buffer;
- buf_size = size of the intermediary driver buffer;

> If you reading that a large number of characters at a time, and getting
> periodic interrupts, I'd advice that you skip the flip buffers
> altogether and simply call ldisc->receive_buf() directly. As a bonus,
> this avoids a memory copy as well. You can use ldisc->receive_room() to
> see how much space is available in the 4k tty buffer. (This is what
> the Comtrol Rocketport driver does).

The Rocketport driver I have (i.e., the one present in 2.2.13) does _not_
use this function. Probably you have already released a newer driver with
this check. Anyhow, just after I sent the msg to you I figured that out by
looking at n_tty.c.

> Anyhow, what's this flow control signal the tty driver sends to the serial
> driver when the buffer starts getting full?? Is this a flag that stays
> there until the condition change back to normal, or is it a one-time
> signal??
>
> The high-level tty code calls driver->throttle() and
> driver->unthrottle() as necessary. See include/linux/tty_driver.h and
> include/linux/tty_ldisc.h --- the interfaces are fairly well
> documented.

Yes, I saw that too, just after I sent the msg. Sorry for the unnecessary
questions, and thank you very much for all the detailed answers !!

Regards,
Ivan


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.026 / U:1.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site