NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA RDMA Bridge
Collaboration diagram for DOCA RDMA Bridge:

Macros

#define UM_MAX_ERRNO   999
 Maximum possible value for errno, to use by encoding error in a pointer address. More...
 
#define UM_ENOMEM   12
 Encoding of the ENOMEM error. More...
 
#define __DEVX_IFC_H__
 Defining DEVX_IFC_H discards the definitions in \MLNX_WinOF2_DevX_SDK\inc\mlx5_ifc_devx.h that is included by the WinOF header files below. More...
 

Typedefs

typedef uint16_t __be16
 
typedef uint32_t __be32
 
typedef uint64_t __be64
 
typedef uint16_t u16
 
typedef uint32_t u32
 
typedef uint64_t u64
 

Functions

DOCA_STABLE doca_error_t doca_rdma_bridge_get_dev_pd (const struct doca_dev *dev, struct ibv_pd **pd)
 Get the protection domain associated with a DOCA device. More...
 
DOCA_STABLE doca_error_t doca_rdma_bridge_open_dev_from_pd (struct ibv_pd *pd, struct doca_dev **dev)
 Open a DOCA device using an ibv_pd. More...
 
DOCA_STABLE doca_error_t doca_rdma_bridge_get_buf_mkey (const struct doca_buf *buf, struct doca_dev *dev, uint32_t *mkey)
 Get lkey with doca_access_flag access for a DOCA buffer of a DOCA device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_rdma_bridge_get_mmap_mkey_from_pd (const struct doca_mmap *mmap, struct ibv_pd *pd, uint32_t *mkey)
 Get the mkey of a DOCA device associated with a given ibv_pd. More...
 

Detailed Description

DOCA RDMA bridge.

Macro Definition Documentation

◆ __DEVX_IFC_H__

#define __DEVX_IFC_H__

Defining DEVX_IFC_H discards the definitions in \MLNX_WinOF2_DevX_SDK\inc\mlx5_ifc_devx.h that is included by the WinOF header files below.

Definition at line 45 of file doca_rdma_bridge.h.

◆ UM_ENOMEM

#define UM_ENOMEM   12

Encoding of the ENOMEM error.

Definition at line 40 of file doca_rdma_bridge.h.

◆ UM_MAX_ERRNO

#define UM_MAX_ERRNO   999

Maximum possible value for errno, to use by encoding error in a pointer address.

Definition at line 36 of file doca_rdma_bridge.h.

Typedef Documentation

◆ __be16

typedef uint16_t __be16

Unsigned 16-bit integer in Big Endian

Definition at line 47 of file doca_rdma_bridge.h.

◆ __be32

typedef uint32_t __be32

Unsigned 32-bit integer in Big Endian

Definition at line 48 of file doca_rdma_bridge.h.

◆ __be64

typedef uint64_t __be64

Unsigned 64-bit integer in Big Endian

Definition at line 49 of file doca_rdma_bridge.h.

◆ u16

typedef uint16_t u16

Unsigned 16-bit integer

Definition at line 50 of file doca_rdma_bridge.h.

◆ u32

typedef uint32_t u32

Unsigned 32-bit integer

Definition at line 51 of file doca_rdma_bridge.h.

◆ u64

typedef uint64_t u64

Unsigned 64-bit integer

Definition at line 52 of file doca_rdma_bridge.h.

Function Documentation

◆ doca_rdma_bridge_get_buf_mkey()

DOCA_STABLE doca_error_t doca_rdma_bridge_get_buf_mkey ( const struct doca_buf *  buf,
struct doca_dev *  dev,
uint32_t *  mkey 
)

Get lkey with doca_access_flag access for a DOCA buffer of a DOCA device.

Parameters
[in]bufThe DOCA buffer to get lkey for. MUST NOT BE NULL.
[in]devThe DOCA device to get lkey for. MUST NOT BE NULL.
[out]mkeyThe returned MKey. MUST NOT BE NULL.
Note
Access of mkey is defined by the mmap where buf was created.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if cannot find mkey by the given device.
  • DOCA_ERROR_NOT_SUPPORTED - if the given access flags is not supported

◆ doca_rdma_bridge_get_dev_pd()

DOCA_STABLE doca_error_t doca_rdma_bridge_get_dev_pd ( const struct doca_dev *  dev,
struct ibv_pd **  pd 
)

Get the protection domain associated with a DOCA device.

Parameters
[in]devDOCA device to get the pd from.
[out]pdThe protection-domain associated with the given DOCA device.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_BAD_STATE - in case the device's pd is not valid (bad state)

◆ doca_rdma_bridge_get_mmap_mkey_from_pd()

DOCA_EXPERIMENTAL doca_error_t doca_rdma_bridge_get_mmap_mkey_from_pd ( const struct doca_mmap *  mmap,
struct ibv_pd *  pd,
uint32_t *  mkey 
)

Get the mkey of a DOCA device associated with a given ibv_pd.

Parameters
[in]mmapThe DOCA Mmap to which the desired device was previously added. MUST NOT BE NULL.
[in]pdThe protection domain associated with the desired DOCA device to get mkey for. MUST NOT BE NULL.
[out]mkeyThe returned MKey. MUST NOT BE NULL.
Note
Access of mkey is defined by the mmap.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - in case of invalid input.
  • DOCA_ERROR_NOT_FOUND - if the given pd was not found in the given mmap.
  • DOCA_ERROR_OPERATING_SYSTEM - failed to acquire mmap lock

◆ doca_rdma_bridge_open_dev_from_pd()

DOCA_STABLE doca_error_t doca_rdma_bridge_open_dev_from_pd ( struct ibv_pd *  pd,
struct doca_dev **  dev 
)

Open a DOCA device using an ibv_pd.

Always prefer using a DOCA device obtained from doca_devinfo_create_list() This call will fail if PD was acquired by DOCA through doca_devinfo_create_list() and then doca_rdma_bridge_get_dev_pd()

This API should be used only to bridge between rdma-core and DOCA, to allow them to share memory registrations E.g., application already has logic that utilizes an ibv_pd, to read and write memory using RDMA, and wants to extend the logic by using libraries in DOCA, but such libraries will require a doca_dev and doca_buf instead of an ibv_pd and mkey in order to read write same memory. Then this method can be used to get a doca_dev that can be added to a doca_mmap, such that any doca_buf created from the doca_mmap can yield mkeys that are associated with the same ibv_pd using doca_rdma_bridge_get_buf_mkey()

For reference: doca_dev - is parallel to an ibv_pd doca_buf - is parallel to an ibv_mr registered on multiple devices doca_mmap - is parallel to creating an ibv_mr for multiple devices

The only APIs that are supported for the newly created device:

Parameters
[in]pdA protection domain that is not associated with any DOCA device
[out]devA newly created DOCA device with same protection domain as 'pd'
Returns
DOCA_SUCCESS - in case of success