From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH v2 3/5] virtio/vdev: add embeded device emulation Date: Tue, 16 Feb 2016 10:40:46 +0800 Message-ID: <56C28C2E.8060703@intel.com> References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com> <1454671228-33284-1-git-send-email-jianfeng.tan@intel.com> <1454671228-33284-4-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: nakajima.yoshihiro@lab.ntt.co.jp, ann.zhuangyanying@huawei.com To: dev@dpdk.org, mst@redhat.com Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A82E5ADA2 for ; Tue, 16 Feb 2016 03:41:03 +0100 (CET) In-Reply-To: <1454671228-33284-4-git-send-email-jianfeng.tan@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Michael, Don't know why, I have not received the email you comment on this commit. On 2/5/2016 7:20 PM, Jianfeng Tan wrote: > To implement virtio vdev, we need way to interract with vhost backend. > And more importantly, needs way to emulate a device into DPDK. So this > patch acts as embedded device emulation. > > Depends on the type of vhost file: vhost-user is used if the given > path points to a unix socket; vhost-net is used if the given path > points to a char device. > > Signed-off-by: Huawei Xie > Signed-off-by: Jianfeng Tan > --- > config/common_linuxapp | 5 + > drivers/net/virtio/Makefile | 4 + > drivers/net/virtio/vhost.h | 194 +++++++++ > drivers/net/virtio/vhost_embedded.c | 809 ++++++++++++++++++++++++++++++++++++ > drivers/net/virtio/virtio_ethdev.h | 6 +- > drivers/net/virtio/virtio_pci.h | 15 +- > 6 files changed, 1031 insertions(+), 2 deletions(-) > create mode 100644 drivers/net/virtio/vhost.h > create mode 100644 drivers/net/virtio/vhost_embedded.c > ... > Don't hard-code this, it's not nice. Actually, it comes from in lib/librte_vhost/rte_virtio_net.h. If we follow your suggestion below, it'll be addressed. > Why do you duplicate ioctls? > Use them from /usr/include/linux/vhost.h, etc. > > In fact, what's not coming from linux here > comes from lib/librte_vhost/vhost_user/vhost-net-user.h. > > I think you should reuse code, avoid code duplication. The reason I was considering is: a. If we include /usr/include/linux/vhost.h, then virtio cannot be used in FreeBSD. b. To use definitions in lib/librte_vhost/vhost_user/vhost-net-user.h, we need expose this header file outside. Thanks, Jianfeng