55c9712d | 07-Feb-2017 |
Jeremy Kerr <jk@ozlabs.org> |
server: Use consistent function names
Put verbs at the end, ie: console_register_poller -> console_poller_register console_register_handler -> console_handler_register
Change-Id: I4fa78137ce54a3f
server: Use consistent function names
Put verbs at the end, ie: console_register_poller -> console_poller_register console_register_handler -> console_handler_register
Change-Id: I4fa78137ce54a3f15aad87c3371569b084e47094 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
c9775ce7 | 07-Feb-2017 |
Jeremy Kerr <jk@ozlabs.org> |
server: Use ringbuffer for socket backlog
Currently, the socket handler uses a linear buffer for the backlog data; this means we need to shift up to 128kB of data after each socket write().
This ch
server: Use ringbuffer for socket backlog
Currently, the socket handler uses a linear buffer for the backlog data; this means we need to shift up to 128kB of data after each socket write().
This change introduces a single-producer-multiple-consumer ringbuffer, to avoid the need for memmove()ing data around; we can simply update pointers instead of shifting data.
We add this as a new file (ringbuffer.c), to make it a little more modular. To mitigate the risk of subtle pointer arithmetic issues, we add a set of tests too.
Change-Id: Ib7c5151d3cf1f588436f5461000b6fed22d0681c Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
bc506fd2 | 06-Feb-2017 |
Jeremy Kerr <jk@ozlabs.org> |
tty-handler: use simpler open in non-blocking mode
Currently, we're opening the tty file descriptor in blocking mode, then switching to non-blocking mode with fcntl(F_SETFL, F_NDELAY);
[and F_NDELA
tty-handler: use simpler open in non-blocking mode
Currently, we're opening the tty file descriptor in blocking mode, then switching to non-blocking mode with fcntl(F_SETFL, F_NDELAY);
[and F_NDELAY == O_NDELAY == O_NONBLOCK ]
This change just opens with O_NONBLOCK instead.
Change-Id: I414ebec632008d65dec87d956d5a0ac1a46ec837 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
81408bd0 | 18-Apr-2017 |
Xo Wang <xow@google.com> |
tty-handler: Use raw byte handling for terminal
When opening the tty for local UART mirroring, disable various special processing of terminal input and output like flow control, line edit (canonical
tty-handler: Use raw byte handling for terminal
When opening the tty for local UART mirroring, disable various special processing of terminal input and output like flow control, line edit (canonical) mode, character translation, special characters, etc.
This forwards all terminal input to the VUART and allow the host OS to perform any necessary processing.
Change-Id: I8b2896e7465c8af643f0cbbcaf7ef2f9ee96e2f5 Signed-off-by: Xo Wang <xow@google.com>
show more ...
|
c5ef8ead | 17-Apr-2017 |
Xo Wang <xow@google.com> |
tty-handler: Add baud rate setting
Add local-tty-baud setting for configuration file. Optionally change tty baud rate using termios.
For errors, use prints to stderr where warn/error calls are not
tty-handler: Add baud rate setting
Add local-tty-baud setting for configuration file. Optionally change tty baud rate using termios.
For errors, use prints to stderr where warn/error calls are not appropriate (i.e. errno hasn't been set by the error-causing call).
Fixes openbmc/openbmc#992.
Change-Id: Ia9226d1666f2626b2c04f30297755d93aee4994e Signed-off-by: Xo Wang <xow@google.com>
show more ...
|
abd8e255 | 19-Jan-2017 |
Jeremy Kerr <jk@ozlabs.org> |
socket-handler: fix leak if we exit with multiple clients
sh->n_clients is decremented by client_close(), so don't iterate through the array.
Change-Id: Id44b596a483758fb8218d472a3ac411c04aacd74 Si
socket-handler: fix leak if we exit with multiple clients
sh->n_clients is decremented by client_close(), so don't iterate through the array.
Change-Id: Id44b596a483758fb8218d472a3ac411c04aacd74 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
5708dfb2 | 19-Jan-2017 |
Jeremy Kerr <jk@ozlabs.org> |
socket-handler: Use a global backlog buffer instead of per-client
Currently, we keep a backlog buffer for each connected client. This is a waste, as it's storing the same data, just at different off
socket-handler: Use a global backlog buffer instead of per-client
Currently, we keep a backlog buffer for each connected client. This is a waste, as it's storing the same data, just at different offsets.
This change uses a global buffer for the client backlog, with each client tracking its current position in this buffer. We just make this fixed-size, rather than trying to dynamically allocate.
Change-Id: I20bd0772c95d8237677108c7a62d9ec6ff8ed35d Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
848fc877 | 16-Jan-2017 |
Jeremy Kerr <jk@ozlabs.org> |
socket-handler: don't disconnect on slow client writes
If a socket client is slow to receive data from the console server, we start filling a buffer. Currently, if we have more data to send and the
socket-handler: don't disconnect on slow client writes
If a socket client is slow to receive data from the console server, we start filling a buffer. Currently, if we have more data to send and the buffer is full, we disconnect the client.
Instead, this change will start performing blocking writes to the client if the buffer becomes full. This means we'll rate-limit the console data (including reads from the tty device) instead of disconnecting. This gives us a little flow control of tty data.
Fixes openbmc/obmc-console#9 .
Change-Id: Icf8ff7246f9ba776ff6fd76a25156ddd89d271d9 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
243cab35 | 16-Jan-2017 |
Jeremy Kerr <jk@ozlabs.org> |
socket-handler: Use MSG_NOSIGNAL
We handle -EPIPE in the error path, no need for a signal on send.
Change-Id: I709262bcda141642d57188e0a2de15e9ddb061b0 Signed-off-by: Jeremy Kerr <jk@ozlabs.org> |
68a2ece7 | 16-Jan-2017 |
Jeremy Kerr <jk@ozlabs.org> |
socket-handler: don't set global O_NONBLOCK flag on client sockets
We will want to perform blocking writes in a future change, and setting O_NONBLOCK on the file descriptor makes this difficult. Ins
socket-handler: don't set global O_NONBLOCK flag on client sockets
We will want to perform blocking writes in a future change, and setting O_NONBLOCK on the file descriptor makes this difficult. Instead, don't specify O_NONBLOCK, and use send/recv (which allows us to specify MSG_DONTWAIT) instead of write/read.
Change-Id: I425b1e4fd37c51e27a9f334dfeff344bb7bc5f97 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
9c297af2 | 16-Jan-2017 |
Jeremy Kerr <jk@ozlabs.org> |
socket-handler: only send if the queue is empty
If we're able to do a non-blocking send (but haven't yet received the POLLOUT event), then we may end up sending data out-of-order.
This change only
socket-handler: only send if the queue is empty
If we're able to do a non-blocking send (but haven't yet received the POLLOUT event), then we may end up sending data out-of-order.
This change only attempts a write if we have nothing in the queue.
Change-Id: Ie207ee10cdee27731dab30474bbdbafb51c31760 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
45ad7676 | 18-Oct-2016 |
Yi Li <adamliyi@msn.com> |
Make obmc-console-server accept symbol link tty name
Invoke 'obmc-console-server ttyVUART0' works now. Resolves openbmc/obmc-console#5
Change-Id: I23a63252a2afb70532583674545498cc7d37bcc7 Signed-of
Make obmc-console-server accept symbol link tty name
Invoke 'obmc-console-server ttyVUART0' works now. Resolves openbmc/obmc-console#5
Change-Id: I23a63252a2afb70532583674545498cc7d37bcc7 Signed-off-by: Yi Li <adamliyi@msn.com>
show more ...
|
cfc9a89a | 23-Oct-2016 |
Chris Smart <chris@distroguy.com> |
doc: README updates
Make it more clear on how to build and run the programs.
Change-Id: I5d35b797ac98ca6071f251ea0ca37fe057478697 Signed-off-by: Chris Smart <chris@distroguy.com> Signed-off-by: Joe
doc: README updates
Make it more clear on how to build and run the programs.
Change-Id: I5d35b797ac98ca6071f251ea0ca37fe057478697 Signed-off-by: Chris Smart <chris@distroguy.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
show more ...
|
44580de4 | 27-Sep-2016 |
Matthew Barth <msbarth@us.ibm.com> |
bootstrap.sh: Standardize across repositories
Change-Id: I6cf5c0a75ae60805b90f75641a7ca19549d0abe2 Signed-off-by: Matthew Barth <msbarth@us.ibm.com> |
c91be8e7 | 15-Sep-2016 |
Matthew Barth <msbarth@us.ibm.com> |
Convert build process to autotools
Updated to follow the base openbmc autotool standard.
Resolves openbmc/obmc-console#4
Change-Id: If6af4faacfcaf853d7642bd3a6f22b6f6190a776 Signed-off-by: Matthew
Convert build process to autotools
Updated to follow the base openbmc autotool standard.
Resolves openbmc/obmc-console#4
Change-Id: If6af4faacfcaf853d7642bd3a6f22b6f6190a776 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
show more ...
|
87e344cd | 31-Aug-2016 |
Joel Stanley <joel@jms.id.au> |
console-server: include poll.h
musl freaks out when including sys/poll.h, so include poll.h directly.
arm-linux-musleabi/sysroot/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #i
console-server: include poll.h
musl freaks out when including sys/poll.h, so include poll.h directly.
arm-linux-musleabi/sysroot/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp] #warning redirecting incorrect #include <sys/poll.h> to <poll.h> ^~~~~~~
Change-Id: Iad13ba2af242ab0708b327e68668a8739f555a1f Signed-off-by: Joel Stanley <joel@jms.id.au>
show more ...
|
6221ce94 | 20-Jul-2016 |
Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> |
Supply Serial port as an optional argument to obmc-console-server
obmc-console-server is a serial console server that currently uses ttyS5 on the BMC and this is configured in obmc-console.conf.
Th
Supply Serial port as an optional argument to obmc-console-server
obmc-console-server is a serial console server that currently uses ttyS5 on the BMC and this is configured in obmc-console.conf.
This patch introduced a new parameter so that tty port can be specified while starting the server. When this parameter is passed, it overrides the TTY that has been given in the configuration file.
This feature is being added to support systemd template unit files.
We would write a 'obmc-console@.service' file and then start 'obmc-console@ttyS5' and the part after the @ becomes a parameter to the unit that can be passed along. This is only "useful" if we have somewhere to pass it to.
One aspect of the template unit, which is appropriate to this issue, is that the template parameter can be used as a dependency, so we can ensure the service obmc-console@%s will not start unless /dev/%s is present.
Below are the advantages of this approach:
1. We can use systemd template unit files as intended without hard-coding the dev-entry.
2. It gets us very close to being able to handle multiple host consoles for a blade-chassis style system.
3. It allows us to easily map a [virtual] physical UART in QEMU to the obmc-console application for test purposes.
Change-Id: I6599a2572e2db996fba9a19a3d65ff502d550114 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
show more ...
|
bc1e8933 | 27-Apr-2016 |
Jeremy Kerr <jk@ozlabs.org> |
tty: Add handler for local tty mirroring
This change adds a simple handler for mirroring data to local tty device, like a hardware UART.
This is specified through a new config parameter 'local-tty'
tty: Add handler for local tty mirroring
This change adds a simple handler for mirroring data to local tty device, like a hardware UART.
This is specified through a new config parameter 'local-tty'.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
021b91f0 | 27-Apr-2016 |
Jeremy Kerr <jk@ozlabs.org> |
server: Allow handlers to fail init
If a handler fails its init, we don't want to invoke its callbacks.
This change adds a flag to struct handlers, to indicate whether a handler is active (ie, init
server: Allow handlers to fail init
If a handler fails its init, we don't want to invoke its callbacks.
This change adds a flag to struct handlers, to indicate whether a handler is active (ie, init() has returned success). Only active handlers are used.
We also change the handler list output to indicate which are active.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
2eacda52 | 06-Apr-2016 |
Jeremy Kerr <jk@ozlabs.org> |
Merge branch 'travis' of https://github.com/shenki/obmc-console |
54e9569d | 24-Mar-2016 |
Jeremy Kerr <jk@ozlabs.org> |
server: put VUART terminal into raw mode
We want raw data from the vuart device, with any processing occuring only on the client's tty.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org> |
458578f8 | 24-Mar-2016 |
Jeremy Kerr <jk@ozlabs.org> |
server: enable file is no longer exposed by recent VUART drivers
... as the enable status is set automatically now. Remove the code to set the sysfs attribute.
Signed-off-by: Jeremy Kerr <jk@ozlabs
server: enable file is no longer exposed by recent VUART drivers
... as the enable status is set automatically now. Remove the code to set the sysfs attribute.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
f5858b5b | 18-Mar-2016 |
Joel Stanley <joel@jms.id.au> |
console-server: fix initialiser
When using clang (3.8, and 3.4), the initaliser for struct option:
console-server.c:471:6: error: missing field 'has_arg' initializer [-Werror,-Wmissing-field-init
console-server: fix initialiser
When using clang (3.8, and 3.4), the initaliser for struct option:
console-server.c:471:6: error: missing field 'has_arg' initializer [-Werror,-Wmissing-field-initializers] { 0 },
Shut the compiler up by using four zeros, which is what the libc manual suggests:
"Terminate the array with an element containing all zeros."
Signed-off-by: Joel Stanley <joel@jms.id.au>
show more ...
|
4d948acd | 17-Mar-2016 |
Joel Stanley <joel@jms.id.au> |
Add travis CI configuration
Just builds with clang 3.8 and gcc 5.3 for x86.
Signed-off-by: Joel Stanley <joel@jms.id.au> |
4d80a5b9 | 18-Mar-2016 |
Jeremy Kerr <jk@ozlabs.org> |
Use non-blocking writes for clients
We may have console clients that are remote, and so the write() to those clients may block.
Since we're single-threaded, that block will delay output to all othe
Use non-blocking writes for clients
We may have console clients that are remote, and so the write() to those clients may block.
Since we're single-threaded, that block will delay output to all other clients (and read from the UART).
This change uses nonblocking IO for the client sockets, and a small buffer to handle writes that would have blocked.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|