From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 7ACCD11A2 for ; Thu, 17 Dec 2015 11:02:20 +0100 (CET) Received: by mail-pf0-f172.google.com with SMTP id 68so28337191pfc.1 for ; Thu, 17 Dec 2015 02:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PTO/cg6j2Nq7s9eHihajQ3dlsGnfr6XLgEYR2M/8f1E=; b=J250d02mPH1CayShd1PWsrotXYKKoukfnN42UBugsSeUhXk1RjPDCc2kOJOREEZzCZ b17upjU4HNu5KxhD4uR0A0tBj4rfw0ogvU8vPM8YxvO24IpTHIiCoGXouzscS7cnrdz4 vhS0LReARPMk5GNstvc/F6r/Y3rtAU2kSd4OIBsrGjE2UfGSLIuGgAZI5Z/rYNaYzpyx QP0r6eBzZUUJVM5xnr2AXGFtykGo8B9nT7r+L3KZkCFk2UFgKRWKLCmkg5K3p9W7kfTg 2C1poPKaNa6grYgINGDd/OrW8jZ1j0CtMyhvngqO3txDSrLyBY3ww0T/BB//qth/RHlI MWuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PTO/cg6j2Nq7s9eHihajQ3dlsGnfr6XLgEYR2M/8f1E=; b=hRNbur+Wuerqx1t3ok5+Rr5S7nJfUW6yKneoszctNb46o8S02V+NNjaZjNmF0EbPnW +FdgLH/K0jJzcGkwx2dyD7ZZmsVk82O6izdA4GTvO4rQQaB4J+uxx5jedo+FsuA/J44n YtvvVg8gSFkLVLG0kSZpvM/UuLjTzxyAMY9mH+SX5doRXHPyhqeY3FbBpFmlvFpprLCp dT870dbHBLKSbg9fG3XrSp4VJ0LJ+qAUN8Tmn5+Hjdaaw8xizitS7kv4/wSCb1HGBbq9 SzL69GUWOZAxGtkajpWHSyjsx+MWGo2oRDoiwk68KU62sp6k/aKDah0A3JEMtQc6rhuo BF/g== X-Gm-Message-State: ALoCoQmdAI2VT6qEyKq727CwYM4DJyDsNwh/Y3HE+of05m1ijhABZQkxnurSgR28DYIcX3dzCMYawaW8c5O7v0i1d2FQKwR0Z5Yb27XvwzTZaLDWnziHzLU= MIME-Version: 1.0 X-Received: by 10.98.14.134 with SMTP id 6mr12982245pfo.155.1450346539757; Thu, 17 Dec 2015 02:02:19 -0800 (PST) Received: by 10.66.13.233 with HTTP; Thu, 17 Dec 2015 02:02:19 -0800 (PST) In-Reply-To: References: <1450269064-23608-1-git-send-email-david.marchand@6wind.com> <20151216124834.GR29571@yliu-dev.sh.intel.com> <20151217093847.GB29571@yliu-dev.sh.intel.com> Date: Thu, 17 Dec 2015 15:32:19 +0530 Message-ID: From: Santosh Shukla To: Yuanhan Liu Content-Type: text/plain; charset=UTF-8 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 10:02:20 -0000 On Thu, Dec 17, 2015 at 3:31 PM, Santosh Shukla wrote: > On Thu, Dec 17, 2015 at 3:08 PM, Yuanhan Liu > wrote: >> 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. >> > > Right and I did shared detailed explanation on why it wont work on > this link [1], infact this patch shouldn;t work for mips too. > > As I mentioned earlier I did tried similar approach and so to get > everything working like iomem is currently in dpdk; we need to add > something like pci_remap_iospace --> ioremap_page_range() but this api > not really pci_mmap_page_range types. user need to write more code on > top so to use this api efficiently, also this api looks like meant to > use by arch file only in kernel space. > > missed link; [1] http://dpdk.org/dev/patchwork/patch/9365/ >> --yliu