DPDK patches and discussions
 help / color / mirror / Atom feed
From: elevran <elevran@gmail.com>
To: "Shaw, Jeffrey B" <jeffrey.b.shaw@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] Using DPDK in a multiprocess environment
Date: Tue, 8 Apr 2014 19:07:16 +0300	[thread overview]
Message-ID: <CAGNKSKexYQEU_ZV-oA9iLyr2yrobdc636vCZ8itr8eK1t4zOpA@mail.gmail.com> (raw)
In-Reply-To: <4032A54B6BB5F04B8C08B6CFF08C59285540FFDA@FMSMSX103.amr.corp.intel.com>

Jeff,

Thanks for the quick reply.

I'll see if calling eal_init earlier resolves the problem I'm seeing. I'm
not sure this will resolve the issue if shared objects are loaded before
main() starts...

I understand the rationale for having the same mbuf addresses across
processes. And indeed they're mapped just fine (--virt-addr also gives some
control over the mapping?).
I was wondering if the same logic applies to the mapping of device PCI
addresses. Are they shared or passed around between processes in the same
way?

Thanks again for the quick response,
Etai
בתאריך 8 באפר 2014 18:54, "Shaw, Jeffrey B" <jeffrey.b.shaw@intel.com> כתב:

> Have you tried calling "rte_eal_init()" closer to the beginning of the
> program in your secondary process (i.e. the first thing in main())?
>
> The same mmap address is required.  The reason is simple, if process A
> thinks the virtual address of an mbuf is 123, and process B thinks the
> virtual address of the same mbuf is 456, either process may segmentation
> fault, accessing mbuf memory that is not actually mapped into the processes
> address space.
>
> Jeff
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Etai Lev Ran
> Sent: Tuesday, April 08, 2014 8:13 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] Using DPDK in a multiprocess environment
>
> Hi,
>
>
>
> I'd like to split DPDK application functionality into a setup (primary)
> process and business logic (secondary) processes.
>
> The secondary processes access the hardware queues directly (exclusive
> queue per process) and not through software rings.
>
>
>
> I'm running into an initialization problem:
>
> -          The primary starts and sets up memory and ports and then goes to
> sleep waiting for termination signal
>
> -          Secondary processes fail when probing the PCI bus for devices
> (required, otherwise I get 0 ports visible in the secondary)
>
>
>
> The error is directly related to the secondary failing to get the *same*
> virtual address for mmap'ing the UIO device fd's.
>
> The reason is that the secondary processes has considerably more shared
> objects loaded and some of these are
>
> loaded and mapped into addresses which the primary used to map UIO fd's.
>
> The pci_map_resource()  (linuxapp/eal_pci.c) code explicitly requires that
> the secondary processes get the same mmap'ed
>
> address as given to the primary.
>
>
>
> 1)      Is this behavior (same mmap address) required?
>
> 2)      If so, is there a workaround to cause PCI areas of UIO devices to
> be
> mapped to the same location in arbitrary processes?
>
>
>
> The samples work just fine since all primary and secondary processes have
> similar set and load order for .so's
>
>
>
> Using  v1.6 on Ubuntu 12.04 64b, ixgbe devices, 1GB hugepages, ASLR
> disabled.
>
>
>
> Thanks,
>
> Etai
>
>
>
>

  reply	other threads:[~2014-04-08 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 15:12 Etai Lev Ran
2014-04-08 15:50 ` Shaw, Jeffrey B
2014-04-08 16:07   ` elevran [this message]
2014-04-08 17:00     ` Rogers, Gerald
2014-04-09  9:25       ` Richardson, Bruce
2014-04-10 10:26         ` Etai Lev Ran

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=CAGNKSKexYQEU_ZV-oA9iLyr2yrobdc636vCZ8itr8eK1t4zOpA@mail.gmail.com \
    --to=elevran@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jeffrey.b.shaw@intel.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).