net_util: Introduce virtio-net control queue handling code

This code is ported from the net_util.rs in virtio-devices. The point
being to move it to the net_util crate so that it can later be reused
from vhost-user-net backend.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-05-17 22:21:34 +02:00
parent 56b9149325
commit 40dc3e7c10
2 changed files with 142 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ extern crate lazy_static;
#[macro_use]
extern crate log;
mod ctrl_queue;
mod mac;
mod open_tap;
mod queue_pair;
@@ -22,6 +23,7 @@ use std::io::Error as IoError;
use std::os::unix::io::{FromRawFd, RawFd};
use std::{io, mem, net};
pub use ctrl_queue::{CtrlQueue, Error as CtrlQueueError};
pub use mac::{MacAddr, MAC_ADDR_LEN};
pub use open_tap::{open_tap, Error as OpenTapError};
pub use queue_pair::{NetCounters, NetQueuePair, NetQueuePairError, RxVirtio, TxVirtio};