From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A37D97EBB for ; Wed, 8 Oct 2014 20:49:48 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 08 Oct 2014 11:57:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,679,1406617200"; d="scan'208";a="585553123" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 08 Oct 2014 11:57:05 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id s98Iv3wr023398; Thu, 9 Oct 2014 02:57:03 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s98Iv17h004469; Thu, 9 Oct 2014 02:57:03 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s98Iv1p5004465; Thu, 9 Oct 2014 02:57:01 +0800 From: Huawei Xie To: dev@dpdk.org Date: Thu, 9 Oct 2014 02:54:48 +0800 Message-Id: <1412794499-4332-15-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> References: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH v6 14/25] lib/librte_vhost: call get_virtio_net_callbacks to get internal ops in register_cuse_device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2014 18:49:49 -0000 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