Skip to content

Commit

Permalink
pyverbs: Add OOO QP support
Browse files Browse the repository at this point in the history
Support OOO QP creation in pyverbs.

Signed-off-by: Maxim Chicherin <maximc@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
  • Loading branch information
Maxim Chicherin authored and EdwardSro committed Nov 12, 2024
1 parent 48d0db2 commit 054622e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pyverbs/providers/mlx5/libmlx5.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ cdef extern from 'infiniband/mlx5dv.h':
uint8_t log_max_num_deks
uint32_t flags

cdef struct mlx5dv_ooo_recv_wrs_caps:
uint32_t max_rc
uint32_t max_xrc
uint32_t max_dct
uint32_t max_ud
uint32_t max_uc

cdef struct mlx5dv_context:
unsigned char version
unsigned long flags
Expand All @@ -62,6 +69,7 @@ cdef extern from 'infiniband/mlx5dv.h':
size_t max_wr_memcpy_length
uint64_t max_dc_rd_atom
uint64_t max_dc_init_rd_atom
mlx5dv_ooo_recv_wrs_caps ooo_recv_wrs_caps


cdef struct mlx5dv_dci_streams:
Expand Down
2 changes: 2 additions & 0 deletions pyverbs/providers/mlx5/mlx5_enums.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ cdef extern from 'infiniband/mlx5dv.h':
MLX5DV_CONTEXT_MASK_WR_MEMCPY_LENGTH = 1 << 12
MLX5DV_CONTEXT_MASK_CRYPTO_OFFLOAD = 1 << 13
MLX5DV_CONTEXT_MASK_MAX_DC_RD_ATOM = 1 << 14
MLX5DV_CONTEXT_MASK_OOO_RECV_WRS = 1 << 16

cpdef enum mlx5dv_context_flags:
MLX5DV_CONTEXT_FLAGS_CQE_V1 = 1 << 0
Expand Down Expand Up @@ -101,6 +102,7 @@ cdef extern from 'infiniband/mlx5dv.h':
MLX5DV_QP_CREATE_ALLOW_SCATTER_TO_CQE = 1 << 4
MLX5DV_QP_CREATE_PACKET_BASED_CREDIT_MODE = 1 << 5
MLX5DV_QP_CREATE_SIG_PIPELINING = 1 << 6
MLX5DV_QP_CREATE_OOO_DP = 1 << 7

cpdef enum mlx5dv_dc_type:
MLX5DV_DCTYPE_DCT = 1
Expand Down
7 changes: 6 additions & 1 deletion pyverbs/providers/mlx5/mlx5dv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ cdef class Mlx5Context(Context):
dve.MLX5DV_CONTEXT_MASK_DCI_STREAMS |\
dve.MLX5DV_CONTEXT_MASK_WR_MEMCPY_LENGTH |\
dve.MLX5DV_CONTEXT_MASK_CRYPTO_OFFLOAD |\
dve.MLX5DV_CONTEXT_MASK_MAX_DC_RD_ATOM
dve.MLX5DV_CONTEXT_MASK_MAX_DC_RD_ATOM |\
dve.MLX5DV_CONTEXT_MASK_OOO_RECV_WRS
else:
dv_attr.comp_mask = comp_mask
rc = dv.mlx5dv_query_device(self.context, &dv_attr.dv)
Expand Down Expand Up @@ -543,6 +544,10 @@ cdef class Mlx5DVContext(PyverbsObject):
def max_dc_init_rd_atom(self):
return self.dv.max_dc_init_rd_atom

@property
def ooo_recv_wrs_caps(self):
return self.dv.ooo_recv_wrs_caps

def __str__(self):
print_format = '{:20}: {:<20}\n'
ident_format = ' {:20}: {:<20}\n'
Expand Down
2 changes: 1 addition & 1 deletion pyverbs/srq.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ cdef class SRQ(PyverbsCM):
self.qps = weakref.WeakSet()
if isinstance(creator, PD):
self._create_srq(creator, attr)
elif type(creator) == Context:
elif isinstance(creator, Context):
self._create_srq_ex(creator, attr)
else:
raise PyverbsRDMAError('Srq needs either Context or PD for creation')
Expand Down

0 comments on commit 054622e

Please sign in to comment.