Add flow control to prevent buffer over run

This service uses direct frame update with bypassing image
compression and invalidating logic in libvncserver to achieve
better performance by using of H/W compressed JPEG frames as those
come from the video engine driver.

This behavior helps quick frame update using very small amount of
CPU resources but it causes a side effect which crashes bmcweb
by OOM killer due to a buffer over run issue. Usually, this issue
happens often in a slow speed connection because this service
keeps sending all frames without any handshaking with clients so
a session buffer in the bmcweb gets bigger and bigger since the
low speed connection can't send all stream data on time.

To fix this issue, this commit adds flow control logic to make
frame updating handshakes with client so that it'll send frames
only when it recieved client frame update messages. All other
frames when the client doesn't request will be dropped out to
prevent the buffer over run issue.

Tested:
bmcweb didn't keep increasing its KVM session buffer.
KVM worked well with showing good refresh speed.

resolves https://github.com/openbmc/bmcweb/issues/80

Change-Id: I6b09a711137d15a38fce59adada9bf3d00afde86
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
2 files changed
tree: 18464de6d930c25da86e3340afa458cd85519121
  1. bootstrap.sh
  2. configure.ac
  3. create_usbhid.sh
  4. ikvm_args.cpp
  5. ikvm_args.hpp
  6. ikvm_input.cpp
  7. ikvm_input.hpp
  8. ikvm_manager.cpp
  9. ikvm_manager.hpp
  10. ikvm_server.cpp
  11. ikvm_server.hpp
  12. ikvm_video.cpp
  13. ikvm_video.hpp
  14. LICENSE
  15. MAINTAINERS
  16. Makefile.am
  17. meson.build
  18. obmc-ikvm.cpp
  19. README.md
  20. scancodes.hpp
  21. start-ipkvm.service
README.md

OpenBMC IpKVM Server

The obmc-ikvm application is a VNC server that provides access to the host graphics output. The application interfaces with the video device on the BMC that captures the host graphics, and then serves that video data on the RFB (remote framebuffer, also known as VNC) protocol. The application also interfaces with the BMC USB gadget device to pass HID events from the BMC to the host, allowing the user to interact with the host system.

Usage

Once the host is running and an appropriate HID gadget device is instantiated on the BMC, the application can be started with the following command: obmc-ikvm -v <video device path> -i <HID gadget device path>

For example:

obmc-ikvm -v /dev/video0 -i /dev/hidg0