From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH v3 2/2] virtio/vdev: add a new vdev named eth_cvio Date: Fri, 22 Apr 2016 13:15:28 +0800 Message-ID: <5719B370.8070107@intel.com> References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com> <1461207396-42742-1-git-send-email-jianfeng.tan@intel.com> <1461207396-42742-3-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" , Huawei Xie , rich.lane@bigswitch.com, Yuanhan Liu , "Michael S. Tsirkin" , nakajima.yoshihiro@lab.ntt.co.jp, p.fedin@samsung.com, "Qiu, Michael" , ann.zhuangyanying@huawei.com, Tetsuya Mukawa , nhorman@tuxdrver.com To: David Marchand Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 36EDC137D for ; Fri, 22 Apr 2016 07:15:33 +0200 (CEST) In-Reply-To: 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, On 4/21/2016 4:51 PM, David Marchand wrote: > Hello, > > On Thu, Apr 21, 2016 at 4:56 AM, Jianfeng Tan wrote: >> Add a new virtual device named eth_cvio, it can be used just like >> eth_ring, eth_null, etc. >> >> Configured parameters include: >> - rx (optional, 1 by default), number of rx, not used for now. >> - tx (optional, 1 by default), number of tx, not used for now. >> - cq (optional, 0 by default), not supported for now. >> - mac (optional), random value will be given if not specified. >> - queue_size (optional, 256 by default), size of virtqueue. >> - path (madatory), path of vhost, depends on the file type, vhost >> user if the given path points to a unix socket; vhost-net if the >> given path points to a char device. >> - ifname (optional), specify the name of backend tap device; only >> valid when backend is vhost-net. >> >> The major difference with original virtio for vm is that, here we use >> virtual addr instead of physical addr for vhost to calculate relative >> address. >> >> When enable CONFIG_RTE_VIRTIO_VDEV (enabled by default), the compiled >> library can be used in both VM and container environment. > This implementation heavily relies on dev_type to keep as much code > shared between pci / vdev path as possible. Yes, I still have no method to make it more clear. > > virtio code relies on drv_flags (even updating it while this should be > per-device). > So first, virtio should rely on dev_flags. Mainly drv_flags's RTE_PCI_DRV_INTR_LSC, and RTE_PCI_DRV_DETACHABLE bit is used. I understand the issue, pointed out by you here, that if two virtio devices are used in a VM, one with feature VIRTIO_NET_F_STATUS, and the other without feature VIRTIO_NET_F_STATUS (under the case that two vhost backends are used). Then it leads to uncertainty of the behavior. Since the flags has been copied into dev_flags after features negotiated, I believe we should use dev_flags instead of drv_flags. A patch to fix this will be sent. > > The rest needs to be astracted in some virtio ops ? So with that fix goes, we may make it more clear now. Do you mean this? Thanks, Jianfeng > > > Thanks. >