vhost_user_net: Use NetQueuePair from vm-virtio

The logic for handling the networking queues can now be shared between
the version running in vhost-user-net and vm-virtio.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-05-29 15:30:18 +01:00
committed by Sebastien Boeuf
parent fcc62efc41
commit cc51fdb8a7
2 changed files with 48 additions and 130 deletions

View File

@@ -310,6 +310,12 @@ pub struct VringWorker {
epoll_file: File,
}
impl AsRawFd for VringWorker {
fn as_raw_fd(&self) -> RawFd {
self.epoll_file.as_raw_fd()
}
}
impl VringWorker {
fn run<S: VhostUserBackend>(&self, handler: VringEpollHandler<S>) -> VringWorkerResult<()> {
const EPOLL_EVENTS_LEN: usize = 100;