DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xie, Huawei" <huawei.xie@intel.com>
To: "Butler, Siobhan A" <siobhan.a.butler@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] vhost library doc update
Date: Mon, 23 Mar 2015 07:52:31 +0000
Message-ID: <C37D651A908B024F974696C65296B57B0F3F03FC@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <0C5AFCA4B3408848ADF2A3073F7D8CC86D559653@IRSMSX109.ger.corp.intel.com>

On 3/22/2015 10:00 PM, Butler, Siobhan A wrote:

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie
Sent: Wednesday, March 11, 2015 4:22 PM
To: dev@dpdk.org<mailto:dev@dpdk.org>
Subject: [dpdk-dev] [PATCH] vhost library doc update

add vhost user documentation

Signed-off-by: Huawei Xie <huawei.xie@intel.com><mailto:huawei.xie@intel.com>
 doc/guides/prog_guide/vhost_lib.rst | 52
 1 file changed, 42 insertions(+), 10 deletions(-)

diff --git a/doc/guides/prog_guide/vhost_lib.rst
index 0b6eda7..ab35b74 100644
--- a/doc/guides/prog_guide/vhost_lib.rst
+++ b/doc/guides/prog_guide/vhost_lib.rst
@@ -31,25 +31,28 @@
 Vhost Library

-The vhost cuse (cuse: user space character device driver) library implements
a -vhost cuse driver. It also creates, manages and destroys vhost devices for -
corresponding virtio devices in the guest. Vhost supported vSwitch could
register -callbacks to this library, which will be called when a vhost device is
activated -or deactivated by guest virtual machine.
+The vhost library implements a user space vhost driver. It supports
+both vhost-cuse
+(cuse: user space character device) and vhost-user(user space socket
+It also creates, manages and destroys vhost devices for corresponding
+virtio devices in the guest. Vhost supported vSwitch could register
+callbacks to this library, which will be called when a vhost device is
+activated or deactivated by guest virtual machine.

 Vhost API Overview

 *   Vhost driver registration

-      rte_vhost_driver_register registers the vhost cuse driver into the
-      Character device file will be created in the /dev directory.
+      rte_vhost_driver_register registers the vhost driver into the system.
+      For vhost-cuse, character device file will be created under the /dev
       Character device name is specified as the parameter.
+      For vhost-user, a unix domain socket server will be created with the
parameter as
+      the local socket path.

 *   Vhost session start

       rte_vhost_driver_session_start starts the vhost session loop.
-      Vhost cuse session is an infinite blocking loop.
+      Vhost session is an infinite blocking loop.
       Put the session in a dedicate DPDK thread.

 *   Callback register
@@ -73,6 +76,8 @@ Vhost API Overview
 Vhost Implementation

+Vhost cuse implementation
 When vSwitch registers the vhost driver, it will register a cuse device driver
into the system and creates a character device file. This cuse driver will
receive vhost open/release/IOCTL message from QEMU simulator.
@@ -89,13 +94,40 @@ which means vhost could access the shared virtio ring
and the guest physical  address specified in the entry of the ring.

 The guest virtual machine tells the vhost whether the virtio device is ready -
for processing or is de-activated through VHOST_SET_BACKEND message.
+for processing or is de-activated through VHOST_NET_SET_BACKEND
 The registered callback from vSwitch will be called.

 When the release call is released, vhost will destroy the device.

+Vhost user implementation
+When vSwitch registers a vhost driver, it will create a unix domain
+socket server into the system. This server will listen for a connection
+and process the vhost message from QEMU simulator.
+When there is a new socket connection, it means a new virtio device has
+been created in the guest virtual machine, and the vhost driver will create a
vhost device for this virtio device.
+For messages with a file descriptor, the file descriptor could be
+directly used in the vhost process as it is already installed by unix domain
+For VHOST_SET_MEM_TABLE message, QEMU will send us information for
+memory region and its file descriptor in the ancillary data of the message.
The fd is used to map that region.
+There is no VHOST_NET_SET_BACKEND message as in vhost cuse to signal
+whether virtio device is ready or should be stopped.
+VHOST_SET_VRING_KICK is used as the signal to put the vhost device onto
data plane.
+VHOST_GET_VRING_BASE is used as the signal to remove vhost device
from data plane.
+When the socket connection is closed, vhost will destroy the device.
 Vhost supported vSwitch reference

-For how to support vhost in vSwitch, please refer to vhost example in the
+For more vhost details and how to support vhost in vSwitch, please
+refer to vhost example in the
 DPDK Sample Applications Guide.

Hi Huawei,

Having some issues with trailing white space in this patch can you please check it?


Hi Siobhan:

I check the patch, and don't know if this is your question. This is a

bit weird. Hope i can explain it clearly.

For example,  in line 17,  you can see a white space there in the patch

file. git tool add a white space, but actually there is no change to

that line, i.e, no deletion, no addition, no modification.

git check patch will not report error, and git apply will also works fine.

 Vhost Library =============

line 17: whitespace

  reply	other threads:[~2015-03-23  7:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 16:22 Huawei Xie
2015-03-22 14:00 ` Butler, Siobhan A
2015-03-23  7:52   ` Xie, Huawei [this message]
2015-03-26 20:20 ` Butler, Siobhan A
2015-03-31  1:01   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C37D651A908B024F974696C65296B57B0F3F03FC@SHSMSX101.ccr.corp.intel.com \
    --to=huawei.xie@intel.com \
    --cc=dev@dpdk.org \
    --cc=siobhan.a.butler@intel.com \
    --cc=thomas.monjalon@6wind.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git