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 18C43A0547; Sun, 21 Feb 2021 16:45:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E05A722A297; Sun, 21 Feb 2021 16:45:43 +0100 (CET) Received: from out0-141.mail.aliyun.com (out0-141.mail.aliyun.com [140.205.0.141]) by mails.dpdk.org (Postfix) with ESMTP id 3CFE922A293 for ; Sun, 21 Feb 2021 16:45:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1613922340; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type; bh=6PclC6uZEP4KWD2dHSN1xjuBDB4d3J9AhnsLYO9H7HY=; b=xT0nB3LGDQZbxUxL2e7TLciA/b3RIMCkAKip/+kQTrFOjBjcoO9LZ7stsK9bdXfTxRVSgYV/03SyYSMcDGEc8YZ6HvUYtenzGWQviiqOUcHgHsDV7BmRCHtlRV8+ejkQTPcJryyYqCDD3Oj+kCtARTjxxqqhMqBItt2nK+XqTlw= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R211e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018047198; MF=huawei.xhw@alibaba-inc.com; NM=1; PH=DS; RN=8; SR=0; TI=SMTPD_---.JbGBene_1613922338; Received: from 30.15.222.210(mailfrom:huawei.xhw@alibaba-inc.com fp:SMTPD_---.JbGBene_1613922338) by smtp.aliyun-inc.com(127.0.0.1); Sun, 21 Feb 2021 23:45:39 +0800 To: Ferruh Yigit , maxime.coquelin@redhat.com, David Marchand Cc: dev@dpdk.org, david.marchand@redhat.com, anatoly.burakov@intel.com, xuemingl@nvidia.com, grive@u256.net, chenbo.xia@intel.com References: <1611890309-99135-1-git-send-email-huawei.xhw@alibaba-inc.com> <1611890309-99135-3-git-send-email-huawei.xhw@alibaba-inc.com> From: "=?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?=" Message-ID: Date: Sun, 21 Feb 2021 23:45:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v6 2/2] bus/pci: support MMIO in PCI ioport accessors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 2021/2/19 16:52, Ferruh Yigit wrote: > On 2/9/2021 2:51 PM, Ferruh Yigit wrote: >> On 1/29/2021 3:18 AM, 谢华伟(此时此刻) wrote: >>> From: "huawei.xhw" >>> >>> With IO BAR, we get PIO(programmed IO) address. >>> With MMIO BAR, we get mapped virtual address. >>> We distinguish PIO(Programmed IO) and MMIO(memory mapped IO) by >>> their address like how kernel does. >>> ioread/write8/16/32 is provided to access PIO/MMIO. >>> By the way, for virtio on arch other than x86, BAR flag indicates >>> PIO but is mapped. >>> >>> Signed-off-by: huawei xie >>> Reviewed-by: Maxime Coquelin >> >> <...> >> >>> +static inline void iowrite8(uint8_t val, void *addr) >>> +{ >>> +    (uint64_t)(uintptr_t)addr >= PIO_MAX ? >>> +        *(volatile uint8_t *)addr = val : >>> +        outb(val, (unsigned long)addr); >> >> Is the 'outb_p' to 'outb' conversion intentional? And if so why? >> >> Same of the all 'outb_p', 'outw_p', 'outl_p'. >> > > Reminder of above question. > > Let's try to close this patch before release pressure hit again. > And as far as I understand already a new version is required for build > errors on non x86 architectures. I will check how to fix the arch issue. > >> <...> >> >>>               size = 1; >>> -#if defined(RTE_ARCH_X86) >>> -            outb_p(*s, reg); >>> -#else >>> -            *(volatile uint8_t *)reg = *s; >>> -#endif >>> +            iowrite8(*s, (void *)reg); >>>           } >>>       } >>>   } >>> >>