vm-virtio: Add vhost-user-net implementation

vhost-user framwork could provide good performance in data intensive
scenario due to the memory sharing mechanism. Implement vhost-user-net
device to get the benefit for Rust-based VMMs network.

Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
This commit is contained in:
Cathy Zhang
2019-08-28 17:50:48 +08:00
committed by Rob Bradford
parent 51306555e7
commit 633f51af9c
5 changed files with 558 additions and 1 deletions
+10 -1
View File
@@ -13,6 +13,7 @@ extern crate epoll;
#[macro_use]
extern crate log;
extern crate pci;
extern crate vhost_rs;
extern crate virtio_bindings;
extern crate vm_memory;
@@ -29,6 +30,7 @@ mod queue;
mod rng;
pub mod transport;
pub mod vhost_user;
pub use self::block::*;
pub use self::console::*;
@@ -117,9 +119,16 @@ const INTERRUPT_STATUS_CONFIG_CHANGED: u32 = 0x2;
pub enum ActivateError {
EpollCtl(std::io::Error),
BadActivate,
/// Queue number is not correct
BadQueueNum,
/// Failed to clone Kill event
CloneKillEventFd,
/// Failed to create Vhost-user interrupt eventfd
VhostIrqCreate,
/// Failed to setup vhost-user daemon.
VhostUserSetup(fs::Error),
/// Failed to setup vhost-user daemon.
VhostUserNetSetup(vhost_user::Error),
}
pub type ActivateResult = std::result::Result<(), ActivateError>;