Re: Serial proxy driver help...

Stephen Satchell (satch@concentric.net)
Tue, 07 Sep 1999 09:34:12 -0700


Mike,
I have implemented such a bridge in Linux for modem testing
purposes. I have also implemented a bridge between Ethernet (Clear TCP)
and serial ports.
You really, really want to do this in user space.
Putting it in the kernel sounds like a great idea, but the truth is
that you aren't going to do much better there than you would in user
space. At 115,200 bits/s, you get a character no faster than once every 87
microseconds. Some facts:

1) The 16550A UART is designed to minimize interrupts. This means that,
depending on how the driver is written, that you will see interrupts after
a latency. For example, with the FIFO threshold set at eight, you will get
the interrupt anywhere from between 348 microseconds and 609 microseconds
after the receipt of the first character in the FIFO.

In other words, you now have a 1/2 millisecond latency caused by the
hardware itself.

2) There are portions of the Linux kernel that run with interrupts
inhibited, so that when this code is run the interrupt response time is
going to be extended anyway. So even if you had a kernel solution, you
will see the box add latency.

3) The only time a kernel solution would make sense is if there is a
significant applications load running in the Linux box.

If your goal is to monitor lines, then I suggest you use a Y-cable to do
so, and not interpose the Linux box in the middle.

Stephen Satchell, Satchell Evaluations

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