Commit 9daed64e authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

rte_virtio/user: removed virtio_user_dev.h



It's contents have been moved to
virtio_user/vhost.h and virtio_dev.h.
The virtio_user_dev struct can't be hidden
in virtio_user.c (similarly to the virtio_hw),
due to another abstraction layer in virtio_user
- vhost-user and vhost-kernel. Even though only
vhost-user is implemented now, let's not close
the possibility to implement vhost-kernel in
the future. The vhost-user/vhost-kernel code
should probably be placed in separate files,
with the virtio_user_dev struct in common
vhost.h header.

Change-Id: I36ee96eff30b398dd129953a874513e727619f98
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/385622


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 136eb115
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@
#include <linux/virtio_scsi.h>

#include <virtio_dev.h>
#include <virtio_user/virtio_user_dev.h>

#include "bdev_virtio.h"

+17 −0
Original line number Diff line number Diff line
@@ -438,6 +438,23 @@ void virtio_dev_dump_json_config(struct virtio_dev *vdev, struct spdk_json_write
 */
int virtio_enumerate_pci(void);

/**
 * Connect to a vhost-user device and create corresponding virtio_dev.
 *
 * \param name name of this virtio device
 * \param path path to the Unix domain socket of the vhost-user device
 * \param requested_queues maximum number of request queues that this
 * device will support
 * \param queue_size size of each of the queues
 * \param fixed_queue_num number of queues preceeding the first
 * request queue. For Virtio-SCSI this is equal to 2, as there are
 * additional event and control queues.
 * \return virtio device
 */
struct virtio_dev *virtio_user_dev_init(const char *name, const char *path,
					uint16_t requested_queues,
					uint32_t queue_size, uint16_t fixed_queue_num);

extern const struct virtio_pci_ops virtio_user_ops;

#endif /* _VIRTIO_DEV_H_ */
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#include <rte_alarm.h>

#include "virtio_dev.h"
#include "virtio_user/virtio_user_dev.h"
#include "virtio_user/vhost.h"

#include "spdk/string.h"

+18 −1
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@

#include "../virtio_dev.h"

#define VIRTIO_MAX_VIRTQUEUES 0x100

enum vhost_user_request {
	VHOST_USER_NONE = 0,
	VHOST_USER_GET_FEATURES = 1,
@@ -67,7 +69,22 @@ enum vhost_user_request {

extern const char *const vhost_msg_strings[VHOST_USER_MAX];

struct virtio_user_dev;
struct virtio_user_backend_ops;

struct virtio_user_dev {
	/* for vhost_user backend */
	int		vhostfd;

	/* for both vhost_user and vhost_kernel */
	int		callfds[VIRTIO_MAX_VIRTQUEUES];
	int		kickfds[VIRTIO_MAX_VIRTQUEUES];
	uint32_t	queue_size;

	uint8_t		status;
	char		path[PATH_MAX];
	struct vring	vrings[VIRTIO_MAX_VIRTQUEUES];
	struct virtio_user_backend_ops *ops;
};

struct virtio_user_backend_ops {
	int (*setup)(struct virtio_user_dev *dev);
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
#include "spdk/stdinc.h"

#include "vhost.h"
#include "virtio_user_dev.h"

#include "spdk/string.h"

Loading