From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D4C6C433E0 for ; Mon, 22 Feb 2021 17:26:02 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id B1C3164E31 for ; Mon, 22 Feb 2021 17:26:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1C3164E31 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 060B840041; Mon, 22 Feb 2021 18:26:01 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id EB4FF4003C for ; Mon, 22 Feb 2021 18:25:58 +0100 (CET) IronPort-SDR: WABvBoTnvnpvcAPXD7uk7q/rpo2vOJeGRmouK6bIRHWllX3Fn+MjsxRBRnGiiYTTk3mB2fhxMD k459hCiWRfSQ== X-IronPort-AV: E=McAfee;i="6000,8403,9903"; a="164361647" X-IronPort-AV: E=Sophos;i="5.81,197,1610438400"; d="scan'208";a="164361647" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2021 09:25:57 -0800 IronPort-SDR: TmnWdcPIy2dSRZ944dyvpBZZSOdb/zCR5i3FeIFCPwhapMtd02gDBbkUh4L9P8DuSEYg+ZgwDb PQwEmMTomyTw== X-IronPort-AV: E=Sophos;i="5.81,197,1610438400"; d="scan'208";a="498636506" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.216.168]) ([10.213.216.168]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2021 09:25:55 -0800 To: =?UTF-8?B?6LCi5Y2O5LyfKOatpOaXtuatpOWIu++8iQ==?= , maxime.coquelin@redhat.com, david.marchand@redhat.com Cc: dev@dpdk.org, 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> <1614014118-91150-1-git-send-email-huawei.xhw@alibaba-inc.com> <1614014118-91150-3-git-send-email-huawei.xhw@alibaba-inc.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Mon, 22 Feb 2021 17:25:52 +0000 MIME-Version: 1.0 In-Reply-To: <1614014118-91150-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 v7 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 2/22/2021 5:15 PM, 谢华伟(此时此刻) 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); //copying question from previous version: Is the 'outb_p' to 'outb' conversion intentional? And if so why? Same of the all 'outb_p', 'outw_p', 'outl_p'.