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 A82E5ADA2 for ; Tue, 16 Feb 2016 03:41:03 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 15 Feb 2016 18:40:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,453,1449561600"; d="scan'208";a="885656639" Received: from tanjianf-mobl.ccr.corp.intel.com (HELO [10.239.201.32]) ([10.239.201.32]) by orsmga001.jf.intel.com with ESMTP; 15 Feb 2016 18:40:46 -0800 To: dev@dpdk.org, mst@redhat.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> From: "Tan, Jianfeng" Message-ID: <56C28C2E.8060703@intel.com> Date: Tue, 16 Feb 2016 10:40:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454671228-33284-4-git-send-email-jianfeng.tan@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: nakajima.yoshihiro@lab.ntt.co.jp, ann.zhuangyanying@huawei.com Subject: Re: [dpdk-dev] [PATCH v2 3/5] virtio/vdev: add embeded device emulation 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: Tue, 16 Feb 2016 02:41:04 -0000 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