mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
lguest: update commentry
Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
parent
bf20029677
commit
1dc3e3bcbf
2 changed files with 16 additions and 0 deletions
|
|
@ -895,6 +895,9 @@ static void handle_console_output(int fd, struct virtqueue *vq, bool timeout)
|
|||
}
|
||||
}
|
||||
|
||||
/* This is called when we no longer want to hear about Guest changes to a
|
||||
* virtqueue. This is more efficient in high-traffic cases, but it means we
|
||||
* have to set a timer to check if any more changes have occurred. */
|
||||
static void block_vq(struct virtqueue *vq)
|
||||
{
|
||||
struct itimerval itm;
|
||||
|
|
@ -939,6 +942,11 @@ static void handle_net_output(int fd, struct virtqueue *vq, bool timeout)
|
|||
if (!timeout && num)
|
||||
block_vq(vq);
|
||||
|
||||
/* We never quite know how long should we wait before we check the
|
||||
* queue again for more packets. We start at 500 microseconds, and if
|
||||
* we get fewer packets than last time, we assume we made the timeout
|
||||
* too small and increase it by 10 microseconds. Otherwise, we drop it
|
||||
* by one microsecond every time. It seems to work well enough. */
|
||||
if (timeout) {
|
||||
if (num < last_timeout_num)
|
||||
timeout_usec += 10;
|
||||
|
|
|
|||
Loading…
Reference in a new issue