提交 f4405a5b 编写于 作者: S Shannon Zhao 提交者: Joseph Qi

alinux: virtio_ring: Support using kernel booting paramter when compiled as module

Commit 6f1e39b2(eci: drivers/virtio: add vring_force_dma_api boot param)
only supports using vring_force_dma_api when virtio_ring built into
kernel not as a module. But by default, virtio_ring is compiled as a
module, this patch adds support for that case. So users can specify
virtio_ring.vring_force_dma_api=1/0 in kernel booting paramter to turn
on/off this feature.
Signed-off-by: NShannon Zhao <shannon.zhao@linux.alibaba.com>
Reviewed-by: NZou Cao <zou.cao@linux.alibaba.com>
上级 ee24b1c2
......@@ -24,6 +24,7 @@
#include <linux/module.h>
#include <linux/hrtimer.h>
#include <linux/dma-mapping.h>
#include <linux/moduleparam.h>
#include <xen/xen.h>
static bool vring_force_dma_api = false;
......@@ -117,6 +118,9 @@ struct vring_virtqueue {
#define to_vvq(_vq) container_of(_vq, struct vring_virtqueue, vq)
#ifdef MODULE
module_param(vring_force_dma_api, bool, 0640);
#else
static int __init vring_dma_api_setup(char *str)
{
vring_force_dma_api = true;
......@@ -125,6 +129,7 @@ static int __init vring_dma_api_setup(char *str)
return 0;
}
__setup("vring_force_dma_api", vring_dma_api_setup);
#endif
/*
* Modern virtio devices have feature bits to specify whether they need a
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册