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 60E4BA0548; Tue, 9 Feb 2021 15:51:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7DA34014E; Tue, 9 Feb 2021 15:51:08 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id DC04940147 for ; Tue, 9 Feb 2021 15:51:07 +0100 (CET) IronPort-SDR: /yg8KqR25ycaHTSmK8/FjEe7Yg82fnIfejDXzaqWO+mEs2WvPDQ5GnsBwUHkU3gtB16tGHLnYw 4eldBtWQNMcg== X-IronPort-AV: E=McAfee;i="6000,8403,9889"; a="200965175" X-IronPort-AV: E=Sophos;i="5.81,165,1610438400"; d="scan'208";a="200965175" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 06:51:07 -0800 IronPort-SDR: k/XvAv3x2FZQA9Ubs7Lq1djc9VP0LjprSebW6cNS3nTL8GkPu4W49bQN9esJ3DSBOA2ZcNtucy lmySFMkMbaMA== X-IronPort-AV: E=Sophos;i="5.81,165,1610438400"; d="scan'208";a="379030523" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.230.90]) ([10.213.230.90]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 06:51:05 -0800 To: =?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?= , maxime.coquelin@redhat.com 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: Ferruh Yigit X-User: ferruhy Message-ID: Date: Tue, 9 Feb 2021 14:51:01 +0000 MIME-Version: 1.0 In-Reply-To: <1611890309-99135-3-git-send-email-huawei.xhw@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 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'. <...> > size = 1; > -#if defined(RTE_ARCH_X86) > - outb_p(*s, reg); > -#else > - *(volatile uint8_t *)reg = *s; > -#endif > + iowrite8(*s, (void *)reg); > } > } > } >