Eliminate excessive CPU consumption when redirecting UART over SSH
Redirecting the external UART via SSH caused the console-server,
console-client, and dropbear to consume ~30% of the available CPU each
when a large amount of data was being written to the UART output.
Buffering all of the small 16550 FIFO bytes into a larger packet and
then sending that to the SSH SW allows more efficient transmission
over the ethernet connection.
Tested this by "ssh root@<bmc.ip.addr> -p 2200" on a system running a
CentOS distribution. Using a BASH console run a large binary file
through "od -t x1 <fname>" to create a large amount of traffic. At
the BMC console run "top" to review the CPU usage. My experience is
after this change is applied:
console-server: ~25% CPU
dropbear: ~3% CPU
console-client: ~1% CPU
Change-Id: Ibabfd285e97a487e7ff040e1cb3159fbff360328
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/tty-handler.c b/tty-handler.c
index a6e622d..3546aca 100644
--- a/tty-handler.c
+++ b/tty-handler.c
@@ -269,7 +269,7 @@
if (make_terminal_raw(th, tty_name) != 0)
fprintf(stderr, "Couldn't make %s a raw terminal\n", tty_name);
- th->poller = console_poller_register(console, handler, tty_poll,
+ th->poller = console_poller_register(console, handler, tty_poll, NULL,
th->fd, POLLIN, NULL);
th->console = console;
th->rbc = console_ringbuffer_consumer_register(console,