From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A856A0C4E for ; Thu, 10 Jun 2021 10:46:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F17D4003C; Thu, 10 Jun 2021 10:46:56 +0200 (CEST) Received: from out0-156.mail.aliyun.com (out0-156.mail.aliyun.com [140.205.0.156]) by mails.dpdk.org (Postfix) with ESMTP id 7A8834003C for ; Thu, 10 Jun 2021 10:46:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1623314812; h=From:To:Subject:Date:Message-Id; bh=ipWq5NscfP5PhzycLTal9poUXitkO43/wkISRN8GUx4=; b=VF7TssX5JcXNu47qGhrE5TlUNJnAyATzQGfLF9D7G6ZzCo+vkIQKDHdNYoWoj/HXR0GCu5/fLElB5Eb7pWC6c0GYI0oFcm8wjrVCdW05QvLh0pkDpWhcfc+hvy1vHpX/vajz5AXJ/UtbKskzZ3zm66n6jImGU1UjWFL6/HqVhxU= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R721e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018047201; MF=huawei.xhw@alibaba-inc.com; NM=1; PH=DS; RN=7; SR=0; TI=SMTPD_---.KQMuNlJ_1623314805; Received: from h33o11252.sqa.nu8.tbsite.net(mailfrom:huawei.xhw@alibaba-inc.com fp:SMTPD_---.KQMuNlJ_1623314805) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jun 2021 16:46:50 +0800 From: "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" To: david.marchand@redhat.com Cc: , , , , , "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" Date: Thu, 10 Jun 2021 16:46:41 +0800 Message-Id: <1623314803-36710-1-git-send-email-huawei.xhw@alibaba-inc.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH 0/2] support both PIO and MMIO BAR for legacy virito device X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" virtio PMD assumes legacy device only supports PIO(port-mapped) BAR resource. This is wrong. As we need to create lots of devices, adn PIO resource on x86 is very limited, we expose MMIO(memory-mapped I/O) BAR. Kernel supports both PIO and MMIO BAR for legacy virtio-pci device, and for all other pci devices. This patchset handles different type of BAR in the similar way. In previous implementation, under igb_uio driver we get PIO address from igb_uio sysfs entry; with uio_pci_generic, we get PIO address from /proc/ioports for x86, and for other ARCHs, we get PIO address from standard PCI sysfs entry. For PIO/MMIO RW, there is different path for different drivers and arch. All of the above is too much twisted. This patchset unifies the way to get both PIO and MMIO address for different driver and ARCHs, all from standard resource attr under pci sysfs. This is most generic. We distinguish PIO and MMIO by their address range like how kernel does. It is ugly but works. huawei xie (2): bus/pci: use PCI standard sysfs entry to get PIO address bus/pci: support MMIO in PCI ioport accessors drivers/bus/pci/linux/pci.c | 81 --------------- drivers/bus/pci/linux/pci_uio.c | 214 ++++++++++++++++++++++++++++------------ 2 files changed, 150 insertions(+), 145 deletions(-) -- 1.8.3.1