A pure rust library for vDPA, vhost and vhost-user

The vhost crate aims to help implementing dataplane for virtio backend drivers

vHost

.

The vhost crate aims to help implementing dataplane for virtio backend drivers. It supports three different types of dataplane drivers:

  • vhost: the dataplane is implemented by linux kernel
  • vhost-user: the dataplane is implemented by dedicated vhost-user servers
  • vDPA(vhost DataPath Accelerator): the dataplane is implemented by hardwares

The main relationship among Traits and Structs exported by the vhost crate is as below:

Kernel-based vHost Backend Drivers

The vhost drivers in Linux provide in-kernel virtio device emulation. Normally the hypervisor userspace process emulates I/O accesses from the guest. Vhost puts virtio emulation code into the kernel, taking hypervisor userspace out of the picture. This allows device emulation code to directly call into kernel subsystems instead of performing system calls from userspace. The hypervisor relies on ioctl based interfaces to control those in-kernel vhost drivers, such as vhost-net, vhost-scsi and vhost-vsock etc.

vHost-user Backend Drivers

The vhost-user protocol aims to implement vhost backend drivers in userspace, which complements the ioctl interface used to control the vhost implementation in the Linux kernel. It implements the control plane needed to establish virtqueue sharing with a user space process on the same host. It uses communication over a Unix domain socket to share file descriptors in the ancillary data of the message.

The protocol defines two sides of the communication, master and slave. Master is the application that shares its virtqueues, slave is the consumer of the virtqueues. Master and slave can be either a client (i.e. connecting) or server (listening) in the socket communication.

Issues

Collection of the latest Issues

matejsp

matejsp

4

Unable to build on mac Monterey 12.2.1. Any chance to get around this?

sboeuf

sboeuf

9

I think there's a limitation for supporting vIOMMU use case because of the following lines:

When an IOTLB is involved, vhost in the kernel considers desc_table_addr, used_ring_addr and avail_ring_addr as IOVAs. That means it could be either a GPA or a GVA. In case it's a GPA, that's fine to check if the address is in range, but if that's a GVA, it doesn't make any sense.

Could we introduce a boolean or flag to let VhostKernBackend know about this use case, which would avoid the incorrect check?

@stefano-garzarella I've identified this issue while implementing vDPA for Cloud Hypervisor, so I was thinking maybe an alternative would be to implement is_valid() from VhostKernVdpa, which would override the default implementation. WDYT?

/cc @jiangliu

Versions

Find the latest versions by id

v0.4.0 - Mar 18, 2022

v0.4.0

Added

  • #109 vhost_kern: vdpa: Override the implementation of valid()

Fixed

  • #102 Fix warnings and update test coverage
  • #104 fix CODEOWNERS file
  • #107 vhost_kern/vdpa: fix get_iova_range()

v0.3.0 - Dec 20, 2021

v0.3.0

Added

  • #92 implement vhost_net backend
  • #97 add method to restore Vdpa objects

Changed

  • #90 add vdpa and vhost-vdpa simple description
  • #90 use vmm_sys_util::fam for vhost_vdpa_config
  • #95 relax vm-memory dependency
  • #98 generate documentation for doc.rs with all features enabled

Fixed

  • #98 fix a bug in SlaveReqHandler::set_config() which passes wrong configuration data to backend

Deprecated

  • #90 remove parse_iotlb_msg

v0.2.0 - Sep 23, 2021

[v0.2.0]

Added

  • [#74] Implement FromRawFd for Listener

  • [#33] Add vhost-vDPA support (in-kernel)

Changed

  • [#68] Enforce ByteValued for received structs

v0.1.0 - Aug 06, 2021

Initial release

Information - Updated Jun 11, 2022

Stars: 61
Forks: 35
Issues: 4

Repositories & Extras

Core Client Library built on the TON OS GraphQL API

JavaScript SDK Types and Methods (API Reference)

Core Client Library built on the TON OS GraphQL API

SongRec is an open-source Shazam client for Linux, written in Rust

Recognize audio from an arbitrary audio file

SongRec is an open-source Shazam client for Linux, written in Rust

Skytable client

This library is the official client for the free and open-source NoSQL database

Skytable client

OpenGliderNetwork client for Rust based on actix

MIT license (LICENSE-MIT or

OpenGliderNetwork client for Rust based on actix

PostgREST client-side library 🦀

This library provides an ORM interface to PostgREST

PostgREST client-side library 🦀

Bittorrent client written from scratch in Rust initially for the purpose of learning Rust

My definition of "from scratch" here is that I did not use any existing code/libraries for things in the bittorrent spec

Bittorrent client written from scratch in Rust initially for the purpose of learning Rust

Server-client music player written in Rust (WIP)

The goal of this project is to create a modern version of mocp in Rust

Server-client music player written in Rust (WIP)
Http

177

Client- and server-side abstractions for HTTP file uploads (POST requests with Content-Type: multipart/form-data)

Client- and server-side abstractions for HTTP file uploads (POST requests with Content-Type: multipart/form-data)

Client- and server-side abstractions for HTTP file uploads (POST requests with Content-Type: multipart/form-data)

Eclipse Paho MQTT Rust Client Library

Eclipse Paho MQTT Rust client library on memory-managed operating systems such as Linux/Posix, Mac, and Windows

Eclipse Paho MQTT Rust Client Library

Ethereum client written in Rust, based on turbo-geth client architecture

Ethereum client written in Rust, based on

Ethereum client written in Rust, based on turbo-geth client architecture

Rust Linux Worker

The Service executes arbitrary Linux commands on behalf of clients

Rust Linux Worker
Facebook Instagram Twitter GitHub Dribbble
Privacy