[dpdk-dev,RFC,18/24] vhost: add RTE_VHOST_USER_VIRTIO_TRANSPORT flag
Checks
Commit Message
Extend the <rte_vhost.h> API to support the virtio-vhost-user transport
as an alternative to the AF_UNIX transport. The caller provides a PCI
DomBDF address:
rte_vhost_driver_register("0000:00:04.0",
RTE_VHOST_USER_VIRTIO_TRANSPORT);
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
drivers/librte_vhost/rte_vhost.h | 1 +
drivers/librte_vhost/socket.c | 3 +++
2 files changed, 4 insertions(+)
@@ -28,6 +28,7 @@ extern "C" {
#define RTE_VHOST_USER_NO_RECONNECT (1ULL << 1)
#define RTE_VHOST_USER_DEQUEUE_ZERO_COPY (1ULL << 2)
#define RTE_VHOST_USER_IOMMU_SUPPORT (1ULL << 3)
+#define RTE_VHOST_USER_VIRTIO_TRANSPORT (1ULL << 4)
/**
* Information relating to memory regions including offsets to
@@ -132,6 +132,9 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
struct vhost_user_socket *vsocket;
const struct vhost_transport_ops *trans_ops = &af_unix_trans_ops;
+ if (flags & RTE_VHOST_USER_VIRTIO_TRANSPORT)
+ trans_ops = &virtio_vhost_user_trans_ops;
+
if (!path)
return -1;