What can "mkey" returned doca_rdma_bridge_get_mmap_mkey_from_pd be used for?

hello,

i want to perform rdma operations (with libibverbs) to/from
the memory region represented by a doca_mmap.
it seems that “mkey” returned by doca_rdma_bridge_get_mmap_mkey_from_pd
(or, doca_rdma_bridge_get_buf_mkey, which seems to return the same “mkey”
value for a doca_mmap) can be used for the purpose. i wrote a test program
and it worked.

however, i’m not sure if it’s semantically correct, or just happened
to work by luck.
is this “mkey” supposed to be used as rkey/lkey for ibverbs?
if it’s the case, does the api assume no rkey/lkey distinctions?

if it matters, the doca_mmap in question was shared from the host to
the dpu with doca_mmap_create_from_export/doca_mmap_export_pci.

Are you use IB or Ethernet?

ethernet.
is it relevant?

Hi

doca_rdma_bridge_get_buf_mkey is used to obtain the lkey (local key) with the appropriate access rights for a DOCA buffer (doca_buf) on a specific DOCA device (doca_dev). The lkey is returned in the mkey output parameter and is required for performing RDMA operations (such as read/write) using RDMA-core APIs like libibverbs.

Thanks,

Suo

thank you.

how about using the mkey as rkey?