From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 1/2] virtio/vdev: add embeded device emulation Date: Fri, 22 Apr 2016 12:17:14 +0200 Message-ID: <5090635.8Uvaj0oolv@xps13> References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com> <20160421220121.GA7603@yliu-dev.sh.intel.com> <5719F905.1060704@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Yuanhan Liu , dev@dpdk.org, Huawei Xie , rich.lane@bigswitch.com, mst@redhat.com, nakajima.yoshihiro@lab.ntt.co.jp, p.fedin@samsung.com, michael.qiu@intel.com, ann.zhuangyanying@huawei.com, mukawa@igel.co.jp, nhorman@tuxdriver.com To: "Tan, Jianfeng" Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 751072C16 for ; Fri, 22 Apr 2016 12:17:37 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id u206so19337946wme.1 for ; Fri, 22 Apr 2016 03:17:37 -0700 (PDT) In-Reply-To: <5719F905.1060704@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" 2016-04-22 18:12, Tan, Jianfeng: > On 4/22/2016 6:01 AM, Yuanhan Liu wrote: > > Further more, I'd suggest to divide the code into following files: > > > > - virtio-user/virtio.c > > > > All virtio device emulation goes here. > > > > - virtio-user/vhost-user.c > > > > The vhost-user frontend implementation > > > > - virtio-user/vhost-kernel.c > > > > vhost kernel hanldings, including setting the tap device. > > > > - And, __maybe__ another standalone file for handling the talk > > between the driver and the device. (See more for the comments > > about virtio_pci_ops below). > > > > > > That would make it much clearer, IMO. > > Got your point here, but to be honest, I'm a little concerned to split a > 1k-lined file into 5+ files. Previously I'd like to make them converged > together. But your suggestion is great for clean code. If any other > could give some comments? I wanted to do the same comment: separating code for guest driver, guest device and host driver will make things easier to understand.