[dpdk-dev,v6,14/25] lib/librte_vhost: call get_virtio_net_callbacks to get internal ops in register_cuse_device
Commit Message
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@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(-)
@@ -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_ */
@@ -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);
@@ -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_ */