Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
1dc3e3bc
Commit
1dc3e3bc
authored
Aug 26, 2008
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lguest: update commentry
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
bf200296
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
Documentation/lguest/lguest.c
Documentation/lguest/lguest.c
+8
-0
drivers/lguest/lguest_device.c
drivers/lguest/lguest_device.c
+8
-0
No files found.
Documentation/lguest/lguest.c
View file @
1dc3e3bc
...
...
@@ -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
;
...
...
drivers/lguest/lguest_device.c
View file @
1dc3e3bc
...
...
@@ -98,6 +98,10 @@ static u32 lg_get_features(struct virtio_device *vdev)
return
features
;
}
/* The virtio core takes the features the Host offers, and copies the
* ones supported by the driver into the vdev->features array. Once
* that's all sorted out, this routine is called so we can tell the
* Host which features we understand and accept. */
static
void
lg_finalize_features
(
struct
virtio_device
*
vdev
)
{
unsigned
int
i
,
bits
;
...
...
@@ -108,6 +112,10 @@ static void lg_finalize_features(struct virtio_device *vdev)
/* Give virtio_ring a chance to accept features. */
vring_transport_features
(
vdev
);
/* The vdev->feature array is a Linux bitmask: this isn't the
* same as a the simple array of bits used by lguest devices
* for features. So we do this slow, manual conversion which is
* completely general. */
memset
(
out_features
,
0
,
desc
->
feature_len
);
bits
=
min_t
(
unsigned
,
desc
->
feature_len
,
sizeof
(
vdev
->
features
))
*
8
;
for
(
i
=
0
;
i
<
bits
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment