[dpdk-dev] [PATCH v2 4/7] net/virtio_user: abstract virtio user backend ops
Yuanhan Liu
yuanhan.liu at linux.intel.com
Mon Dec 26 07:41:14 CET 2016
On Fri, Dec 23, 2016 at 07:14:23AM +0000, Jianfeng Tan wrote:
> +typedef int (*vhost_setup_t)(struct virtio_user_dev *dev);
> +typedef int (*vhost_send_request_t)(struct virtio_user_dev *dev,
> + enum vhost_user_request req,
> + void *arg);
> +typedef int (*vhost_enable_qp_t)(struct virtio_user_dev *dev,
> + uint16_t pair_idx,
> + int enable);
I will not bother to define new types if they are just gonna be used once.
No strong perference here, just a suggestion.
...
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h
> index 28fc788..503a496 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.h
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h
> @@ -37,9 +37,15 @@
> #include <limits.h>
> #include "../virtio_pci.h"
> #include "../virtio_ring.h"
> +#include "vhost.h"
>
> struct virtio_user_dev {
> + /* for vhost_user backend */
> int vhostfd;
> +
> + /* for vhost_kernel backend */
> +
> + /* for both vhost_user and vhost_kernel */
By far (till this patch), vhost_kernel is not introduced at all, that I
will not mention it here. That said, I will leave this change to the patch
that actually enables vhost-kernel.
--yliu
More information about the dev
mailing list