Skip to content

Commit

Permalink
netdev-dpdk: Add new 'dpdkvhostuserclient' port type
Browse files Browse the repository at this point in the history
The 'dpdkvhostuser' port type no longer supports both server and client
mode. Instead, 'dpdkvhostuser' ports are always 'server' mode and
'dpdkvhostuserclient' ports are always 'client' mode.

Suggested-by: Daniele Di Proietto <[email protected]>
Signed-off-by: Ciara Loftus <[email protected]>
Signed-off-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
cloftus authored and ddiproietto committed Sep 19, 2016
1 parent 70ec021 commit 2d24d16
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 128 deletions.
102 changes: 58 additions & 44 deletions INSTALL.DPDK-ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,21 @@ For users wanting to do packet forwarding using kernel stack below are the steps
```
## <a name="vhost"></a> 6. Vhost Walkthrough
Two types of vHost User ports are available in OVS:
1. vhost-user (dpdkvhostuser ports)
2. vhost-user-client (dpdkvhostuserclient ports)
vHost User uses a client-server model. The server creates/manages/destroys the
vHost User sockets, and the client connects to the server. Depending on which
port type you use, dpdkvhostuser or dpdkvhostuserclient, a different
configuration of the client-server model is used.
For vhost-user ports, OVS DPDK acts as the server and QEMU the client.
For vhost-user-client ports, OVS DPDK acts as the client and QEMU the server.
### 6.1 vhost-user
- Prerequisites:
Expand Down Expand Up @@ -570,49 +585,6 @@ For users wanting to do packet forwarding using kernel stack below are the steps
where `-L`: Changes the numbers of channels of the specified network device
and `combined`: Changes the number of multi-purpose channels.
4. OVS vHost client-mode & vHost reconnect (OPTIONAL)
By default, OVS DPDK acts as the vHost socket server for dpdkvhostuser
ports and QEMU acts as the vHost client. This means OVS creates and
manages the vHost socket and QEMU is the client which connects to the
vHost server (OVS). In QEMU v2.7 the option is available for QEMU to act
as the vHost server meaning the roles can be reversed and OVS can become
the vHost client. To enable client mode for a given dpdkvhostuserport,
one must specify a valid 'vhost-server-path' like so:
```
ovs-vsctl set Interface dpdkvhostuser0 options:vhost-server-path=/path/to/socket
```
Setting this value automatically switches the port to client mode (from
OVS' perspective). 'vhost-server-path' reflects the full path of the
socket that has been or will be created by QEMU for the given vHost User
port. Once a path is specified, the port will remain in 'client' mode
for the remainder of it's lifetime ie. it cannot be reverted back to
server mode.
One must append ',server' to the 'chardev' arguments on the QEMU command
line, to instruct QEMU to use vHost server mode for a given interface,
like so:
````
-chardev socket,id=char0,path=/path/to/socket,server
````
If the corresponding dpdkvhostuser port has not yet been configured in
OVS with vhost-server-path=/path/to/socket, QEMU will print a log
similar to the following:
`QEMU waiting for connection on: disconnected:unix:/path/to/socket,server`
QEMU will wait until the port is created sucessfully in OVS to boot the
VM.
One benefit of using this mode is the ability for vHost ports to
'reconnect' in event of the switch crashing or being brought down. Once
it is brought back up, the vHost ports will reconnect automatically and
normal service will resume.
- VM Configuration with libvirt
* change the user/group, access control policty and restart libvirtd.
Expand Down Expand Up @@ -657,7 +629,49 @@ For users wanting to do packet forwarding using kernel stack below are the steps
Note: For information on libvirt and further tuning refer [libvirt].
### 6.2 DPDK backend inside VM
### 6.2 vhost-user-client
- Prerequisites:
QEMU version >= 2.7
- Adding vhost-user-client ports to Switch
```
ovs-vsctl add-port br0 vhost-client-1 -- set Interface vhost-client-1
type=dpdkvhostuserclient options:vhost-server-path=/path/to/socket
```
Unlike vhost-user ports, the name given to port does not govern the name of
the socket device. 'vhost-server-path' reflects the full path of the socket
that has been or will be created by QEMU for the given vHost User client
port.
- Adding vhost-user-client ports to VM
The same QEMU parameters as vhost-user ports described in section 6.1 can
be used, with one change necessary. One must append ',server' to the
'chardev' arguments on the QEMU command line, to instruct QEMU to use vHost
server mode for a given interface, like so:
````
-chardev socket,id=char0,path=/path/to/socket,server
````
If the corresponding dpdkvhostuserclient port has not yet been configured
in OVS with vhost-server-path=/path/to/socket, QEMU will print a log
similar to the following:
`QEMU waiting for connection on: disconnected:unix:/path/to/socket,server`
QEMU will wait until the port is created sucessfully in OVS to boot the VM.
One benefit of using this mode is the ability for vHost ports to
'reconnect' in event of the switch crashing or being brought down. Once it
is brought back up, the vHost ports will reconnect automatically and normal
service will resume.
### 6.3 DPDK backend inside VM
Please note that additional configuration is required if you want to run
ovs-vswitchd with DPDK backend inside a QEMU virtual machine. Ovs-vswitchd
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ v2.6.0 - xx xxx xxxx
* Jumbo frame support
* Remove dpdkvhostcuse port type.
* OVS client mode for vHost and vHost reconnect (Requires QEMU 2.7)
* 'dpdkvhostuserclient' port type.
- Increase number of registers to 16.
- ovs-benchmark: This utility has been removed due to lack of use and
bitrot.
Expand Down
Loading

0 comments on commit 2d24d16

Please sign in to comment.