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 D6C47A04BA; Fri, 2 Oct 2020 07:45:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0C5F1D5A9; Fri, 2 Oct 2020 07:44:58 +0200 (CEST) Received: from out0-148.mail.aliyun.com (out0-148.mail.aliyun.com [140.205.0.148]) by dpdk.org (Postfix) with ESMTP id D1E111D5A8 for ; Fri, 2 Oct 2020 07:44:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1601617492; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type; bh=pCuxUbRJSSMUWMXi8rvuqf/ker5BTi+jZV0btnV0Hgk=; b=SG+onXXg0w17XGdRdLU58ex2y4/R/wmFSbiaOeGQ4m4lSuQWeqGo+CgqbymaRm9Sm5JdipeXL6ko+g5x7NgoRv4Z9PYRxilpIp5CcwpS/aP7ZjwUCRLisExREM6hU62aHtlREYbx5sLaIJykzDrre2R8XdhqgqIO1POALqruv7E= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018047205; MF=huawei.xhw@alibaba-inc.com; NM=1; PH=DS; RN=9; SR=0; TI=SMTPD_---.IefdGOV_1601617490; Received: from 30.15.232.176(mailfrom:huawei.xhw@alibaba-inc.com fp:SMTPD_---.IefdGOV_1601617490) by smtp.aliyun-inc.com(127.0.0.1); Fri, 02 Oct 2020 13:44:51 +0800 To: "Burakov, Anatoly" , dev , "ferruh.yigit" Cc: "Maxime Coquelin" , "David Marchand" , "=?UTF-8?B?V2FuZywgWmhpaG9uZw==?=" , "=?UTF-8?B?WGlhLCBDaGVuYm8=?=" , "Gaetan Rivet" , "=?UTF-8?B?5p2o6IiqKOihjOWuqik=?=" References: <68ecd941-9c56-4de7-fae2-2ad15bdfd81a@alibaba-inc.com> <719c243a-2ff9-ba6e-e587-e638f8e16bfa@intel.com> From: "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" Message-ID: <8c543fec-01e9-c6fe-f5b9-35b0dbb64173@alibaba-inc.com> Date: Fri, 02 Oct 2020 13:44:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <719c243a-2ff9-ba6e-e587-e638f8e16bfa@intel.com> Content-Type: multipart/mixed; boundary="------------E25B2EA9957C656A6D83007C" Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v2] 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" This is a multi-part message in MIME format. --------------E25B2EA9957C656A6D83007C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 2020/10/1 18:22, Burakov, Anatoly wrote: > On 30-Sep-20 3:59 PM, 谢华伟(此时此刻) wrote: >>  From c13f981e287254cd0877cc7b98ee2dd7b80c3b69 Mon Sep 17 00:00:00 2001 >> From: "huawei.xhw" >> Date: Wed, 30 Sep 2020 22:37:03 +0800 >> Subject: [PATCH v2] pci:  support both PIO and MMIO BAR for legacy >> virtio on >>   x86 >> >> 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 >> --- > > You patches are somehow malformed (at least according to my inline > diff viewer). Are you using git-send-email to send patches? > Very sorry for the format issue. I still failed configuring send-email to work, and Thunderbird had issues with plain text settings. Zhihong, Chenbo: I attach this patch. Could you help send this patch for me? Thanks! --------------E25B2EA9957C656A6D83007C Content-Type: text/plain; charset=UTF-8; name="v2.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="v2.patch" RnJvbSBjMTNmOTgxZTI4NzI1NGNkMDg3N2NjN2I5OGVlMmRkN2I4MGMzYjY5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogImh1YXdlaS54aHciIDxodWF3ZWkueGh3QGFsaWJh YmEtaW5jLmNvbT4NCkRhdGU6IFdlZCwgMzAgU2VwIDIwMjAgMjI6Mzc6MDMgKzA4MDANClN1 YmplY3Q6IFtQQVRDSCB2Ml0gcGNpOiAgc3VwcG9ydCBib3RoIFBJTyBhbmQgTU1JTyBCQVIg Zm9yIGxlZ2FjeSB2aXJ0aW8gb24geDg2DQoNCkxlZ2FjeSB2aXJ0aW8tcGNpIG9ubHkgc3Vw cG9ydHMgUElPIEJBUiByZXNvdXJjZS4gQXMgd2UgbmVlZCB0byBjcmVhdGUgbG90cyBvZg0K dmlydGlvIGRldmljZXMgYW5kIFBJTyByZXNvdXJjZSBvbiB4ODYgaXMgdmVyeSBsaW1pdGVk LCB3ZSBleHBvc2UgTU1JTyBCQVIuDQoNCktlcm5lbCBzdXBwb3J0cyBib3RoIFBJTyAgYW5k IE1NSU8gQkFSIGZvciBsZWdhY3kgdmlydGlvLXBjaSBkZXZpY2UuIFdlIGhhbmRsZXMN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