net_util, virtio-devices, vhost_user_net: Relocate {Rx,Tx}Virtio

By moving the code for opening the two RX and TX queues into a shared
location we are starting to remove the requirement for the
vhost-user-net backend to depend on the virtio-devices crate which in of
itself depends on many other crates that are not necessary for the
backend to function.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-07-07 15:02:18 +01:00
parent 2efd307c4e
commit 48faf3abac
7 changed files with 208 additions and 190 deletions
+3 -4
View File
@@ -7,8 +7,8 @@
use super::net_util::{
build_net_config_space, build_net_config_space_with_mq, register_listener, unregister_listener,
CtrlVirtio, NetCtrlEpollHandler, RxVirtio, TxVirtio, VirtioNetConfig, KILL_EVENT,
NET_EVENTS_COUNT, PAUSE_EVENT, RX_QUEUE_EVENT, RX_TAP_EVENT, TX_QUEUE_EVENT,
CtrlVirtio, NetCtrlEpollHandler, VirtioNetConfig, KILL_EVENT, NET_EVENTS_COUNT, PAUSE_EVENT,
RX_QUEUE_EVENT, RX_TAP_EVENT, TX_QUEUE_EVENT,
};
use super::Error as DeviceError;
use super::{
@@ -18,8 +18,7 @@ use crate::VirtioInterrupt;
use anyhow::anyhow;
use libc::EAGAIN;
use libc::EFD_NONBLOCK;
use net_util::{open_tap, OpenTapError};
use net_util::{MacAddr, Tap};
use net_util::{open_tap, MacAddr, OpenTapError, RxVirtio, Tap, TxVirtio};
use std::cmp;
use std::collections::HashMap;
use std::fs::File;