From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47014A04DD; Wed, 21 Oct 2020 10:47:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9FF91ACE7; Wed, 21 Oct 2020 10:47:28 +0200 (CEST) Received: from out0-141.mail.aliyun.com (out0-141.mail.aliyun.com [140.205.0.141]) by dpdk.org (Postfix) with ESMTP id 8E0BCA8EC for ; Wed, 21 Oct 2020 10:47:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1603270043; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type; bh=oJ7DjqynWkZwPh7nGtgx79MItGfRMAKTZQIB+jouG5A=; b=d1HS9jDS/f9Ms4V5HnGq5JWc1JpcB37lsnEpt4PAtiURhpoWptTh1ASM7k8ZhomWJovs85tn90wDBqNANE8fPJq0wQ2hMczanBUvJaJ0fW0/ciwPFUFtE6XPev1yi44Xxdzwfl1C1W/cj3X4Xl5PHx64Xz7o3lPyni31v8COgM0= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R701e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018047203; MF=huawei.xhw@alibaba-inc.com; NM=1; PH=DS; RN=8; SR=0; TI=SMTPD_---.ImLgjoK_1603270042; Received: from 30.43.67.137(mailfrom:huawei.xhw@alibaba-inc.com fp:SMTPD_---.ImLgjoK_1603270042) by smtp.aliyun-inc.com(127.0.0.1); Wed, 21 Oct 2020 16:47:22 +0800 To: ferruh.yigit@intel.com Cc: dev@dpdk.org, anatoly.burakov@intel.com, maxime.coquelin@redhat.com, david.marchand@redhat.com, grive@u256.net, zhihong.wang@intel.com, chenbo.xia@intel.com References: <68ecd941-9c56-4de7-fae2-2ad15bdfd81a@alibaba-inc.com> <1602578499-13975-1-git-send-email-huawei.xhw@alibaba-inc.com> <1602578499-13975-2-git-send-email-huawei.xhw@alibaba-inc.com> From: "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" Message-ID: Date: Wed, 21 Oct 2020 16:46:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <1602578499-13975-2-git-send-email-huawei.xhw@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v4] pci: support both PIO and MMIO BAR for legacy virtio on x86 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh: Comments to this patch? Customers are urging us to run DPDK with virtio mmio support. @david Though this patch is to support MMIO bar, it is the right thing to do. Previous code with virtio (IO/MMIO) port map/RW under different driver is too complicated. This patch also fixes the performance issue with VFIO port write(virtio only). Besides, next thing we could do is to move some of those PCI codes to virtio PMD as they are for virtio PMD only. /huawei On 2020/10/13 16:41, 谢华伟(此时此刻) wrote: > From: "huawei.xhw" > > Legacy virtio-pci only supports PIO BAR resource. As we need to create lots of > virtio devices and PIO resource on x86 is very limited, we expose MMIO BAR. > > Kernel supports both PIO and MMIO BAR for legacy virtio-pci device. We handles > different type of BAR in the similar way. > > In previous implementation, with igb_uio we get PIO address from igb_uio > sysfs entry; with uio_pci_generic, we get PIO address from > /proc/ioports. > For PIO/MMIO RW, there is different path for different drivers and arch. > For VFIO, PIO/MMIO RW is through syscall, which has big performance > issue. > On X86, it assumes only PIO is supported. > > All of the above is too much twisted. > This patch unifies the way to get both PIO and MMIO address for different driver > and arch, all from standard resource attr under pci sysfs. > > We distinguish PIO and MMIO by their address like how kernel does. It is ugly but works. > > Signed-off-by: huawei.xhw > --- > drivers/bus/pci/linux/pci.c | 89 +-------------------- > drivers/bus/pci/linux/pci_uio.c | 167 +++++++++++++++++++++++++++------------- > 2 files changed, 119 insertions(+), 137 deletions(-) > > diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c > index bf27594..885e54e 100644 > --- a/drivers/bus/pci/linux/pci.c > +++ b/drivers/bus/pci/linux/pci.c > @@ -687,71 +687,6 @@ int rte_pci_write_config(const struct rte_pci_device *device, > } > } > >