net/virtio-user: add device emulation layer
authorJianfeng Tan <jianfeng.tan@intel.com>
Wed, 15 Jun 2016 09:03:23 +0000 (09:03 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 22 Jun 2016 07:47:12 +0000 (09:47 +0200)
commit37a7eb2ae8168e409ef7e53f3889e92096c692c0
tree43fa5b449bd64629af8a3f85fcd43e7fc7dcc15b
parent6a84c37e39750ddd25dde4d1c57f2b93f39dc3c3
net/virtio-user: add device emulation layer

Few device emulation layer functions are added for virtio driver to
call:
  - virtio_user_start_device()
  - virtio_user_stop_device()
  - virtio_user_dev_init()
  - virtio_user_dev_uninit()

These functions will get called by virtio driver, and they call vhost
adapter layer functions to implement the functionality.

All stats related to virtual user device as logged in virtio_user_dev
structure.

  ----------------------
  | ------------------ |
  | | virtio driver  | |
  | ------------------ |
  |         |          |
  | ------------------ | ------>  virtio-user PMD
  | | device emulate |-|----> (virtio_user_dev.c, virtio_user_dev.h)
  | |                | |
  | | vhost adapter  | |
  | ------------------ |
  ----------------------
            |
            |
            |
   ------------------
   | vhost backend  |
   ------------------

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/Makefile
drivers/net/virtio/virtio_user/virtio_user_dev.c [new file with mode: 0644]
drivers/net/virtio/virtio_user/virtio_user_dev.h [new file with mode: 0644]