Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
1dc3e3bc
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1dc3e3bc
编写于
8月 26, 2008
作者:
R
Rusty Russell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lguest: update commentry
Signed-off-by:
N
Rusty Russell
<
rusty@rustcorp.com.au
>
上级
bf200296
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
0 deletion
+16
-0
Documentation/lguest/lguest.c
Documentation/lguest/lguest.c
+8
-0
drivers/lguest/lguest_device.c
drivers/lguest/lguest_device.c
+8
-0
未找到文件。
Documentation/lguest/lguest.c
浏览文件 @
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
浏览文件 @
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
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录