From mboxrd@z Thu Jan 1 00:00:00 1970 From: Huawei Xie Subject: [PATCH v6 14/25] lib/librte_vhost: call get_virtio_net_callbacks to get internal ops in register_cuse_device Date: Thu, 9 Oct 2014 02:54:48 +0800 Message-ID: <1412794499-4332-15-git-send-email-huawei.xie@intel.com> References: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1412794499-4332-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 --- 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