From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [PATCH v2 3/3] virtio: Add a new layer to abstract pci access method Date: Mon, 1 Feb 2016 10:50:00 +0900 Message-ID: <56AEB9C8.9060703@igel.co.jp> References: <1453108389-21006-2-git-send-email-mukawa@igel.co.jp> <1453973612-8599-4-git-send-email-mukawa@igel.co.jp> <20160129091701.GY4257@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Yuanhan Liu Return-path: Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id 559835A68 for ; Mon, 1 Feb 2016 02:50:03 +0100 (CET) Received: by mail-pf0-f182.google.com with SMTP id 65so74220879pfd.2 for ; Sun, 31 Jan 2016 17:50:03 -0800 (PST) In-Reply-To: <20160129091701.GY4257@yliu-dev.sh.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 2016/01/29 18:17, Yuanhan Liu wrote: > On Thu, Jan 28, 2016 at 06:33:32PM +0900, Tetsuya Mukawa wrote: >> This patch addss function pointers to abstract pci access method. >> This abstraction layer will be used when virtio-net PMD supports >> container extension. >> >> The below functions abstract how to access to pci configuration space. >> >> struct virtio_pci_cfg_ops { >> int (*map)(...); >> void (*unmap)(...); >> void *(*get_mapped_addr)(...); >> int (*read)(...); >> }; >> >> The pci configuration space has information how to access to virtio >> device registers. Basically, there are 2 ways to acccess to the >> registers. One is using portio and the other is using mapped memory. >> The below functions abstract this access method. > One question: is there a way to map PCI memory with Qtest? I'm thinking > if we can keep the io_read/write() for Qtest as well, if so, code could > be simplified, a lot, IMO. > Yes, I agree with you. But AFAIK, we don't have a way to mmap it from DPDK application. We may be able to map PCI configuration space to a memory address space that guest CPU can handle. But even in this case, I guess we cannot access the memory without qtest messaging. Thanks, Tetsuya