Commit Graph

7 Commits

Author SHA1 Message Date
Xiaobo Chi
7836894a64 vhost: fix kernel module insertion
Problem:if I firstly insert my kmod_test.ko, then insert eventfd_link.ko,
error will happen with hint "Device or resource busy". This is because
the default minor device number, 0, has been occupied by my kmod_test.ko .

root@distro:~/test$ lsmod
Module                  Size  Used by
kmod_test                927  0
vboxsf                 35930  4
vboxguest             222130  1 vboxsf
microcode              10315  0
autofs4                25051  0
root@distro:~/test$ insmod ./eventfd_link.ko
insmod: ERROR: could not insert module ./eventfd_link.ko: Device or
resource busy

Explanation: For miscdevices, the major device_no is same, so the minor
device_no should be set to ditinguish different misc devices;  if not set
the minor, it may fail while insmod due to the default minor value, 0, has
been used by other miscdevice. MISC_DYNAMIC_MINOR means to let Linux
kernel dynamically assign one minor devide number while loading.

Signed-off-by: Xiaobo Chi <xiaobo.chi@nokia.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2015-11-24 21:34:11 +01:00
Pavel Boldin
c706f3b9c8 vhost: add new eventfd copy ioctl
Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2015-10-30 20:06:30 +01:00
Pavel Boldin
e658d99749 vhost: refactor eventfd copy handler
* Move ioctl `EVENTFD_COPY' code to a separate function
* Remove extra #includes
* Introduce function fget_from_files
* Fix ioctl return values

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2015-10-30 20:03:51 +01:00
Aaron Conole
a17cc4f172 vhost: build eventfd_link module against specified kernel
The vHost eventlink driver is a kernel module that requires a kernel
source/build directory to build the ko. Convert the fixed kernel build
directory specifier to one which may be user specified on the command-line.

Signed-off-by: Aaron Conole <aconole@redhat.com>
2015-09-24 22:01:53 +02:00
Pavel Boldin
38f4f01f8f vhost: fix file struct leakage
Due to increased `struct file's reference counter subsequent call
to `filp_close' does not free the `struct file'. Prepend `fput' call
to decrease the reference counter.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2015-03-26 22:33:41 +01:00
Huawei Xie
af4f2c5feb vhost: fix code style
Fix alignment issues, lengthy lines, misordered type and other coding style issues.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-11-06 23:12:02 +01:00
Huawei Xie
5c7a80aec3 vhost: move from examples to dedicated library
Those files will be refactored in subsequent patches to form user space
vhost library.
Makefile and main.h are removed.
main.c is renamed to vhost_rxtx.c and will provide vring enqueue/dequeue API.
virtio-net.h is renamed to rte_virtio_net.h which is the API header file.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: remove from examples Makefile and merge file renaming]
2014-10-13 19:10:09 +02:00