diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-05-29 20:29:58 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-06-06 04:30:22 +0300 |
commit | 87a65e63bac789bca0607e0b4ab09d62517b95e7 (patch) | |
tree | 3254b912d6468012543e127a19ba2f1cd13b108f /meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm | |
parent | 5364646cb66fa75cdcbf148e039e0383cda94f2a (diff) | |
download | openbmc-87a65e63bac789bca0607e0b4ab09d62517b95e7.tar.xz |
Update to internal
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm')
4 files changed, 125 insertions, 29 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch new file mode 100644 index 000000000..1340e845b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch @@ -0,0 +1,119 @@ +From 336d0e9163a027b2b35ed240c2995f06684637b8 Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> +Date: Thu, 9 May 2019 16:26:53 -0700 +Subject: [PATCH] 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> +--- + ikvm_server.cpp | 19 +++++++++++++++++++ + ikvm_server.hpp | 10 ++++++++++ + 2 files changed, 29 insertions(+) + +diff --git a/ikvm_server.cpp b/ikvm_server.cpp +index 35310da292be..363eab7e000d 100644 +--- a/ikvm_server.cpp ++++ b/ikvm_server.cpp +@@ -119,6 +119,12 @@ void Server::sendFrame() + continue; + } + ++ if (!cd->needUpdate) ++ { ++ continue; ++ } ++ cd->needUpdate = false; ++ + if (cl->enableLastRectEncoding) + { + fu->nRects = 0xFFFF; +@@ -149,6 +155,18 @@ void Server::sendFrame() + rfbReleaseClientIterator(it); + } + ++void Server::clientFUR(rfbClientPtr cl, rfbFramebufferUpdateRequestMsg* furMsg) ++{ ++ ClientData* cd = (ClientData*)cl->clientData; ++ ++ if (!cd) ++ return; ++ ++ // Ignore the furMsg info. This service uses full frame update always. ++ ++ cd->needUpdate = true; ++} ++ + void Server::clientGone(rfbClientPtr cl) + { + Server* server = (Server*)cl->screen->screenData; +@@ -170,6 +188,7 @@ enum rfbNewClientAction Server::newClient(rfbClientPtr cl) + cl->clientData = + new ClientData(server->video.getFrameRate(), &server->input); + cl->clientGoneHook = clientGone; ++ cl->clientFURHook = clientFUR; + if (!server->numClients++) + { + server->pendingResize = false; +diff --git a/ikvm_server.hpp b/ikvm_server.hpp +index b8062017b8ca..e51e57a19722 100644 +--- a/ikvm_server.hpp ++++ b/ikvm_server.hpp +@@ -32,6 +32,7 @@ class Server + */ + ClientData(int s, Input* i) : skipFrame(s), input(i) + { ++ needUpdate = false; + } + ~ClientData() = default; + ClientData(const ClientData&) = default; +@@ -41,6 +42,7 @@ class Server + + int skipFrame; + Input* input; ++ bool needUpdate; + }; + + /* +@@ -85,6 +87,14 @@ class Server + + private: + /* ++ * @brief Handler for a client frame update message ++ * ++ * @param[in] cl - Handle to the client object ++ * @param[in] furMsg - Pointer of the FUR message ++ */ ++ static void clientFUR(rfbClientPtr cl, ++ rfbFramebufferUpdateRequestMsg* furMsg); ++ /* + * @brief Handler for a client disconnecting + * + * @param[in] cl - Handle to the client object +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/start-ipkvm.service b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/start-ipkvm.service deleted file mode 100644 index 61d6cf213..000000000 --- a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/start-ipkvm.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBMC ipKVM daemon -StopWhenUnneeded=false - -[Service] -Restart=always -ExecStartPre=/usr/bin/create_usbhid.sh -ExecStart=/usr/bin/env obmc-ikvm -v /dev/video0 -f 10 -k /dev/hidg0 -p /dev/hidg1 - -[Install] -WantedBy=multi-user.target diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend new file mode 100644 index 000000000..577a78601 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend @@ -0,0 +1,6 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" + +#SRC_URI = "git://github.com/openbmc/obmc-ikvm" +SRCREV = "133bfa2d5b1b3af0b8e819b4cd210a0e1ac0445c" + +SRC_URI += "file://0001-Add-flow-control-to-prevent-buffer-over-run.patch" diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_git.bb b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_git.bb deleted file mode 100644 index 37ab24b8a..000000000 --- a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_git.bb +++ /dev/null @@ -1,18 +0,0 @@ -SUMMARY = "OpenBMC VNC server and ipKVM daemon" -DESCRIPTION = "obmc-ikvm is a vncserver for JPEG-serving V4L2 devices to allow ipKVM" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://LICENSE;md5=75859989545e37968a99b631ef42722e" - -DEPENDS = " libvncserver sdbusplus sdbusplus-native phosphor-logging phosphor-dbus-interfaces autoconf-archive-native" - -SRC_URI = "git://github.com/openbmc/obmc-ikvm" -SRCREV = "fb6a8e1e727a8ece5eb0350d3962dd3056a6f608" - -PR = "r1" -PR_append = "+gitr${SRCPV}" - -SYSTEMD_SERVICE_${PN} += "start-ipkvm.service" - -S = "${WORKDIR}/git" - -inherit autotools pkgconfig obmc-phosphor-systemd |