vhost_net_device_ops is internal implementation in vhost lib.
register_cuse_device will be vhost driver register API. There is no need for it 
to know
the internal vhost ops. Instead, that ops is retrieved in register_cuse_device 
through get_virtio_net_callbacks.

Signed-off-by: Huawei Xie <huawei.xie at intel.com>
---
 lib/librte_vhost/rte_virtio_net.h | 1 -
 lib/librte_vhost/vhost-net-cdev.c | 4 ++--
 lib/librte_vhost/vhost-net-cdev.h | 1 +
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_vhost/rte_virtio_net.h 
b/lib/librte_vhost/rte_virtio_net.h
index b06436e..1f2b351 100644
--- a/lib/librte_vhost/rte_virtio_net.h
+++ b/lib/librte_vhost/rte_virtio_net.h
@@ -122,6 +122,5 @@ struct virtio_net_device_ops {
 int init_virtio_net(struct virtio_net_device_ops const * const);
 int deinit_virtio_net(void);

-struct vhost_net_device_ops const * get_virtio_net_callbacks(void);

 #endif /* _VIRTIO_NET_H_ */
diff --git a/lib/librte_vhost/vhost-net-cdev.c 
b/lib/librte_vhost/vhost-net-cdev.c
index 957f0c8..4eeb676 100644
--- a/lib/librte_vhost/vhost-net-cdev.c
+++ b/lib/librte_vhost/vhost-net-cdev.c
@@ -302,7 +302,7 @@ static const struct cuse_lowlevel_ops vhost_net_ops = {
  * also passed when the device is registered in main.c.
  */
 int
-register_cuse_device(const char *base_name, struct vhost_net_device_ops const 
* const pops)
+register_cuse_device(const char *base_name)
 {
        struct cuse_info cuse_info;
        char device_name[PATH_MAX] = "";
@@ -339,7 +339,7 @@ register_cuse_device(const char *base_name, struct 
vhost_net_device_ops const *
        cuse_info.dev_info_argv = device_argv;
        cuse_info.flags = CUSE_UNRESTRICTED_IOCTL;

-       ops = pops;
+       ops = get_virtio_net_callbacks();

        session = cuse_lowlevel_setup(3, fuse_argv,
                                &cuse_info, &vhost_net_ops, 0, NULL);
diff --git a/lib/librte_vhost/vhost-net-cdev.h 
b/lib/librte_vhost/vhost-net-cdev.h
index 575daa9..0db8f0a 100644
--- a/lib/librte_vhost/vhost-net-cdev.h
+++ b/lib/librte_vhost/vhost-net-cdev.h
@@ -80,4 +80,5 @@ struct vhost_net_device_ops {
 int register_cuse_device(const char *base_name, int index, struct 
vhost_net_device_ops const * const);
 int start_cuse_session_loop(void);

+struct vhost_net_device_ops const *get_virtio_net_callbacks(void);
 #endif /* _VHOST_NET_CDEV_H_ */
-- 
1.8.1.4

Reply via email to