[SPDK] Shared memory allocated spdk_dma_malloc from among process

Lego Lin <lego.lin at gmail.com> Thu, 20 Oct 2022 23:32:15 +0800
Newsgroups dev.linux.lists.spdk
Message-ID <CALR1Az+RfcUcitOvDurcozL6N+7d_WNCsvVKPQSg92Xae-jMsg@mail.gmail.com>
--===============2982028427768477564==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Hi, all:

Can anyone give me some guidelines that how to share memory from
spdk_dma_malloc among 2 processes?

I know how to use shm_open / mmap to create and share memory among
processes.
It looks like DPDK memzone can be shared among processes through it's
internal API (rte_memzone_lookup / dump_memzone)
But I didn't find obvious clues about sharing memory from spdk_dma_malloc
to another process.
My idea is Process A get the physical address of memory from
spdk_dma_malloc.
Process A put these physical address to a shared memory.
Process B get physical address from shared memory and map them to virtual
space of process B.

Is there other ways to do this?

Thanks

--===============2982028427768477564==--