DPDK patches and discussions
 help / color / mirror / Atom feed
From: Juho Snellman <jsnell@iki.fi>
To: dev@dpdk.org
Subject: [dpdk-dev] Legacy virtio vs. multi-process mode
Date: Wed, 14 Sep 2016 04:43:49 +0200	[thread overview]
Message-ID: <CAMv0bscUjVopX2BKLNKaQbaRzPXXaH9e4MCQOaQumaCAChPeiA@mail.gmail.com> (raw)

I've been having trouble getting virtio (in legacy mode) working with the
multi-process model. The latest issue is as follows:

- The primary process calls vtpci_init() with a struct
rte_pci_device that's only valid in that process
- For legacy mode vtpci_init() calls rte_eal_pci_ioport() with that pci
device and a the struct rte_pci_ioport that's in shared memory
- The secondary processes will of course not call vtpci_init()
- When a secondary process tries to notify the vqueue in either the the RX
or TX path, it will do so via the shared memory ioport.
- When rte_eal_pci_ioport_write() tries to dispatch the ioport to the right
place, it'll need to access the PCI device. But that's a garbage pointer in
the context of this process. (Usually it's still pointing to some allocated
memory, so you don't even get a segfault but the ioport write is just
silently aborted).
- This causes the queues to stall, unless the primary process happens to
notify them as well for some reason.

Is there a clean solution? My current workaround is to allocate
rte_pci_device structs in shared memory rather than the heap. (Though all
processes still have their own copy). But that requires rearranging the
initialization order in rte_eal_init() to delay the PCI init, and I'm
guessing there's a good reason for the current order.

-- 
Juho Snellman

                 reply	other threads:[~2016-09-14  2:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAMv0bscUjVopX2BKLNKaQbaRzPXXaH9e4MCQOaQumaCAChPeiA@mail.gmail.com \
    --to=jsnell@iki.fi \
    --cc=dev@dpdk.org \
    /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).