From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2B7BD2C6B for ; Wed, 1 Jun 2016 10:19:05 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 01 Jun 2016 01:19:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,400,1459839600"; d="scan'208";a="988685775" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 01 Jun 2016 01:19:02 -0700 Date: Wed, 1 Jun 2016 16:21:54 +0800 From: Yuanhan Liu To: Jianfeng Tan Cc: dev@dpdk.org, Huawei Xie , rich.lane@bigswitch.com, mst@redhat.com, nakajima.yoshihiro@lab.ntt.co.jp, p.fedin@samsung.com, ann.zhuangyanying@huawei.com, mukawa@igel.co.jp, nhorman@tuxdriver.com Message-ID: <20160601082154.GF10038@yliu-dev.sh.intel.com> References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com> <1464605739-140761-1-git-send-email-jianfeng.tan@intel.com> <1464605739-140761-7-git-send-email-jianfeng.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464605739-140761-7-git-send-email-jianfeng.tan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v5 6/8] virtio-user: add new virtual pci driver for virtio 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, 01 Jun 2016 08:19:05 -0000 On Mon, May 30, 2016 at 10:55:37AM +0000, Jianfeng Tan wrote: > This patch implements another new instance of struct virtio_pci_ops to > drive the virtio-user virtual device. Instead of rd/wr ioport or PCI > configuration space, this virtual pci driver will rd/wr the virtual > device struct virtio_user_hw, and when necessary, invokes APIs provided > by device emulation later to start/stop the device. > > ---------------------- > | ------------------ | > | | virtio driver | |----> (virtio_user_pci.c) > | ------------------ | > | | | > | ------------------ | ------> virtio-user PMD > | | device emulate | | > | | | | > | | vhost adapter | | > | ------------------ | > ---------------------- > | > | > | > ------------------ > | vhost backend | > ------------------ > > Signed-off-by: Huawei Xie > Signed-off-by: Jianfeng Tan > Acked-by: Neil Horman > --- > drivers/net/virtio/Makefile | 1 + > drivers/net/virtio/virtio_pci.h | 1 + > drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 + > drivers/net/virtio/virtio_user/virtio_user_pci.c | 218 +++++++++++++++++++++++ Jianfeng, this file (virtio_user_pci.c) belongs to virtio driver, but not virtio-user device. I thought it a while, I found it's still better to introduce a helper function from virtio-user device for each ops, just like the below vdev_reset(). Sorry for noisy. And I'd suggest to rename it to virtio_user.c, so that we can move the virtio_user_pmd_devinit/devuninit in the next patch to there, too. They also belong the driver side, but not the device side. > +static void > +vdev_read_dev_config(struct virtio_hw *hw, uint64_t offset, > + void *dst, int length) Let's user "virtio_user" consistently here, instead of vdev? --yliu