summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2016-05-07 05:26:03 +0800
committerYuanhan Liu <yuanhan.liu@linux.intel.com>2016-06-22 09:47:07 +0200
commit64ab701c3d1e848aa36b4c4ef61a9dd8c3633651 (patch)
tree393ccbd4e15c8b33d4a4a89351b8836022ac982a /examples
parent9ebcd4f9c74ed5d873932be0e29590b9a13e48c7 (diff)
downloaddpdk-64ab701c3d1e848aa36b4c4ef61a9dd8c3633651.zip
dpdk-64ab701c3d1e848aa36b4c4ef61a9dd8c3633651.tar.gz
dpdk-64ab701c3d1e848aa36b4c4ef61a9dd8c3633651.tar.xz
vhost: add vhost-user client mode
Add a new paramter (flags) to rte_vhost_driver_register(). DPDK vhost-user acts as client mode when RTE_VHOST_USER_CLIENT flag is set. The flags would also allow future extensions without breaking the API (again). The rest is straingfoward then: allocate a unix socket, and bind/listen for server, connect for client. This extension is for vhost-user only, therefore we simply quit and report error when any flags are given for vhost-cuse. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/tep_termination/main.c2
-rw-r--r--examples/vhost/main.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index ec57869..622f248 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -1254,7 +1254,7 @@ main(int argc, char *argv[])
rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_MRG_RXBUF);
/* Register CUSE device to handle IOCTLs. */
- ret = rte_vhost_driver_register((char *)&dev_basename);
+ ret = rte_vhost_driver_register((char *)&dev_basename, 0);
if (ret != 0)
rte_exit(EXIT_FAILURE, "CUSE device setup failure.\n");
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index b95d789..0595e63 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1488,7 +1488,7 @@ main(int argc, char *argv[])
rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_MRG_RXBUF);
/* Register vhost(cuse or user) driver to handle vhost messages. */
- ret = rte_vhost_driver_register((char *)&dev_basename);
+ ret = rte_vhost_driver_register(dev_basename, 0);
if (ret != 0)
rte_exit(EXIT_FAILURE, "vhost driver register failure.\n");