From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7F5155A9D for ; Thu, 17 Dec 2015 10:38:38 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 17 Dec 2015 01:38:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,440,1444719600"; d="scan'208";a="875554620" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by fmsmga002.fm.intel.com with ESMTP; 17 Dec 2015 01:38:24 -0800 Date: Thu, 17 Dec 2015 17:38:47 +0800 From: Yuanhan Liu To: Santosh Shukla Message-ID: <20151217093847.GB29571@yliu-dev.sh.intel.com> References: <1450269064-23608-1-git-send-email-david.marchand@6wind.com> <20151216124834.GR29571@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] eal: map io resources for non x86 architectures X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 09:38:39 -0000 On Wed, Dec 16, 2015 at 07:21:55PM +0530, Santosh Shukla wrote: > On Wed, Dec 16, 2015 at 6:18 PM, Yuanhan Liu > wrote: > > On Wed, Dec 16, 2015 at 01:31:04PM +0100, David Marchand wrote: > >> x86 requires a special set of instructions to access ioports, but other > >> architectures let you remap io resources. > >> So let eal remap io resources by accepting IORESOURCE_IO flag for > >> architectures other than x86. > > > > One question: this patch could be a replacement of the igbuio_iomap patch > > from Santosh? If so, I like it: It's more elegant. > > > > --yliu > > > > I did tried similar in past but not in parse_sysfs (such that > mem.resource_addr to accept IO_RESOURCE_IO types) and observed that > pci_map_resource not able to map address hence segfault at tespmd > initialization. > > i was getting these: > EAL: pci_map_resource(): cannot mmap(19, 0x7fa5c00000, 0x20, 0x0): > Invalid argument (0xffffffffffffffff) That's because ARM (at least the kernel) doesn't allow an IO map: arch/arm/kernel/bios32.c ------------------------ 618 int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 619 enum pci_mmap_state mmap_state, int write_combine) 620 { 621 if (mmap_state == pci_mmap_io) 622 return -EINVAL; And with a quick glimpse of powerpc, I see no such limitation. Hence, this peice of code may work only on Powerpc platform (and maybe a few others we don't care). So, apparently, this will not work for ARM. --yliu