DPDK patches and discussions
 help / color / mirror / Atom feed
From: Santosh Shukla <sshukla@mvista.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eal: map io resources for non x86 architectures
Date: Thu, 17 Dec 2015 16:52:00 +0530	[thread overview]
Message-ID: <CAAyOgsYp8mn5d+bbFxo34AWSxb21kMfv0h_wg7r=mH1NPxHEYQ@mail.gmail.com> (raw)
In-Reply-To: <2979402.yeVYlcCDUH@xps13>

On Thu, Dec 17, 2015 at 4:03 PM, Thomas Monjalon
<thomas.monjalon@6wind.com> wrote:
> 2015-12-17 15:51, Santosh Shukla:
>> On Thu, Dec 17, 2015 at 3:44 PM, Thomas Monjalon
>> <thomas.monjalon@6wind.com> wrote:
>> > Hi,
>> >
>> > 2015-12-17 15:37, Santosh Shukla:
>> >> On Thu, Dec 17, 2015 at 3:32 PM, Santosh Shukla <sshukla@mvista.com> wrote:
>> >> > On Thu, Dec 17, 2015 at 3:31 PM, Santosh Shukla <sshukla@mvista.com> wrote:
>> >> >> On Thu, Dec 17, 2015 at 3:08 PM, Yuanhan Liu
>> >> >> <yuanhan.liu@linux.intel.com> 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
>> >> >>>> <yuanhan.liu@linux.intel.com> 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/
>> >> >
>> >>
>> >> IMO, it is worth keeping one special device file who could work across
>> >> archs like arm/arm64/powerpc and others, who could map iopci bar to
>> >> dpdk user-space. also this approach has no kernel version dependency
>> >> too. BTW; I did mentioned in second approach in to add /dev/ioport
>> >> interface in drivers/char/mem.c which could read more than byte in one
>> >> single operation, but that has kernel dependency. However that
>> >> approach too is arch agnostic.
>> >
>> > Your first approach use an out-of-tree kernel module (igb_uio), so we cannot
>> > really say there is no kernel dependency.
>>
>> Agree but I mentioned kernel __version__ dependency.
>
> Yes you did.
> One of the main issue with out-of-tree kernel modules is the version
> dependency. Probably that igb_uio from DPDK 2.3 will not compile with
> the kernel 5.0.
>

don't know kernel 5.0 feature list so I guess your may be right. is
uio obsoleted for 5.0 kernel?

>> > We should try to remove the need for any out-of-tree kernel module.
>> > That's why the Linux upstream approach is a better solution.
>>
>> IIUC, your suggesting archs like arm/arm64 to support io_mappe_io in
>> pci_mmap_page_range()?
>
> I don't know what is the best solution in the kernel.
> First we need to be sure that there is absolutely no solution without
> kernel changes.

I guess we have done enough evaluation / investigation that suggest -
so to map iopci region to userspace in arch agnostic-way -

# either we need to modify kernel
               - Make sure all the non-x86 arch to support mapping for
iopci region (i.e. pci_mmap_page_range). I don;t think its a correct
approach though.
            or
               - include /dev/ioport char-mem device file who could do
more than byte operation, Note that this implementation does not exist
in kernel.  I could send an RFC to lkml.

OR keep device file in user space (current approach)
Right now Virtio-for-arm patches are blocked on this, let me know if
someone has better approach/thought in mind.

Thanks.

> Then we can try a pci_mmap solution or, as you suggest, an interface in
> drivers/char/mem.c
>

  reply	other threads:[~2015-12-17 11:22 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 13:00 [dpdk-dev] [ [PATCH v2] 00/13] Add virtio support in arm/arm64 Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 01/13] virtio: Introduce config RTE_VIRTIO_INC_VECTOR Santosh Shukla
2015-12-17 12:02   ` Santosh Shukla
2015-12-17 12:03     ` Thomas Monjalon
2015-12-17 12:18       ` Santosh Shukla
2015-12-17 23:24     ` Stephen Hemminger
2015-12-18  1:31       ` Yuanhan Liu
2015-12-18  9:52       ` Xie, Huawei
2015-12-18 10:41         ` Thomas Monjalon
2015-12-18 17:33         ` Stephen Hemminger
2015-12-18 18:11           ` Thomas Monjalon
2015-12-18 12:46       ` Santosh Shukla
2015-12-22  6:26         ` Yuanhan Liu
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 02/13] config: i686: set RTE_VIRTIO_INC_VECTOR=n Santosh Shukla
2015-12-17 12:03   ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 03/13] rte_io: armv7/v8: Introduce api to emulate x86-style of PCI/ISA ioport access Santosh Shukla
2015-12-14 14:25   ` Jerin Jacob
2015-12-14 16:29     ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 04/13] virtio_pci: use rte_io.h for non-x86 arch Santosh Shukla
2015-12-14 14:28   ` Jerin Jacob
2015-12-14 15:29     ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 05/13] virtio: change io_base datatype from uint32_t to uint64_type Santosh Shukla
2015-12-16 13:48   ` Yuanhan Liu
2015-12-16 14:01     ` Santosh Shukla
2015-12-16 14:23       ` Yuanhan Liu
2015-12-16 14:39         ` Santosh Shukla
2015-12-16 14:58           ` Yuanhan Liu
2015-12-16 15:05             ` Santosh Shukla
2015-12-17  7:19               ` Yuanhan Liu
2015-12-17  8:17                 ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 06/13] config: armv7/v8: Enable RTE_LIBRTE_VIRTIO_PMD Santosh Shukla
2015-12-14 14:31   ` Jerin Jacob
2015-12-14 16:16     ` Santosh Shukla
2015-12-15  5:36   ` Jianbo Liu
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 07/13] linuxapp: eal: arm: Always return 0 for rte_eal_iopl_init() Santosh Shukla
2015-12-14 14:34   ` Jan Viktorin
2015-12-14 15:04     ` Santosh Shukla
2015-12-14 14:37   ` Jerin Jacob
2015-12-14 15:24     ` Santosh Shukla
2015-12-14 15:56       ` Jerin Jacob
2015-12-14 16:13         ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 08/13] rte_io: x86: Remove sys/io.h ifdef x86 clutter Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 09/13] igb_uio: ioport: map iopci region for armv7/v8 Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 10/13] include/exec-env: ioport: add rte_virt_ioport header file Santosh Shukla
2015-12-14 14:43   ` Jerin Jacob
2015-12-14 16:17     ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 11/13] virtio_ioport: armv7/v8: mmap virtio iopci bar region Santosh Shukla
2015-12-16 13:29   ` Yuanhan Liu
2015-12-16 14:20     ` Santosh Shukla
2015-12-16 14:37       ` Yuanhan Liu
2015-12-16 14:40         ` Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 12/13] virtio_ethdev: use virtio_ioport api at device init/close Santosh Shukla
2015-12-14 13:00 ` [dpdk-dev] [ [PATCH v2] 13/13] virtio_ethdev : fix format specifier error for 64bit addr case Santosh Shukla
2015-12-14 14:31 ` [dpdk-dev] [ [PATCH v2] 00/13] Add virtio support in arm/arm64 Jan Viktorin
2015-12-14 16:09   ` Santosh Shukla
2015-12-16  7:48 ` Santosh Shukla
2015-12-16  8:47   ` David Marchand
2015-12-16 11:43     ` Santosh Shukla
2015-12-16 12:31       ` [dpdk-dev] [PATCH] eal: map io resources for non x86 architectures David Marchand
2015-12-16 12:48         ` Yuanhan Liu
2015-12-16 13:34           ` David Marchand
2015-12-16 13:42             ` Yuanhan Liu
2015-12-16 13:51           ` Santosh Shukla
2015-12-17  9:38             ` Yuanhan Liu
2015-12-17 10:01               ` Santosh Shukla
2015-12-17 10:02                 ` Santosh Shukla
2015-12-17 10:07                   ` Santosh Shukla
2015-12-17 10:14                     ` Thomas Monjalon
2015-12-17 10:21                       ` Santosh Shukla
2015-12-17 10:33                         ` Thomas Monjalon
2015-12-17 11:22                           ` Santosh Shukla [this message]
2015-12-18  5:30                             ` Yuanhan Liu
2015-12-18  6:34                               ` Jerin Jacob
2015-12-18  7:55                                 ` Yuanhan Liu
2015-12-18  9:37                                 ` Thomas Monjalon
2015-12-18  7:54                               ` Santosh Shukla
2015-12-18  8:21                                 ` Yuanhan Liu
2015-12-18 12:55                                   ` Santosh Shukla
2015-12-29  5:56                                     ` Santosh Shukla
2015-12-29  9:56                                       ` Burakov, Anatoly
2015-12-29 10:47                                         ` Santosh Shukla
2015-12-29 11:06                                           ` Burakov, Anatoly
2015-12-29 12:23                                             ` Santosh Shukla
2015-12-29 14:04                                           ` Alex Williamson
2015-12-29 14:51                                             ` Santosh Shukla
2015-12-31 14:27                                               ` Santosh Shukla
2015-12-16 13:15         ` Bruce Richardson
2015-12-16 13:29           ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAyOgsYp8mn5d+bbFxo34AWSxb21kMfv0h_wg7r=mH1NPxHEYQ@mail.gmail.com' \
    --to=sshukla@mvista.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).