DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Legacy virtio vs. multi-process mode
@ 2016-09-14  2:43 Juho Snellman
  0 siblings, 0 replies; only message in thread
From: Juho Snellman @ 2016-09-14  2:43 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-14  2:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14  2:43 [dpdk-dev] Legacy virtio vs. multi-process mode Juho Snellman

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).