From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v5 6/8] virtio-user: add new virtual pci driver for virtio Date: Wed, 1 Jun 2016 16:21:54 +0800 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 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 To: Jianfeng Tan 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) Content-Disposition: inline In-Reply-To: <1464605739-140761-7-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" 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