2 * RDMA device: Definitions of Resource Manager structures
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
8 * Yuval Shaia <yuval.shaia@oracle.com>
9 * Marcel Apfelbaum <marcel@redhat.com>
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
16 #ifndef RDMA_RM_DEFS_H
17 #define RDMA_RM_DEFS_H
19 #include "rdma_backend_defs.h"
22 #define MAX_PORT_GIDS 1
23 #define MAX_GIDS MAX_PORT_GIDS
24 #define MAX_PORT_PKEYS 1
25 #define MAX_PKEYS MAX_PORT_PKEYS
27 #define MAX_MR_SIZE (1UL << 27)
33 #define MAX_QP_RD_ATOM 16
34 #define MAX_QP_INIT_RD_ATOM 16
37 #define MAX_RM_TBL_NAME 16
38 typedef struct RdmaRmResTbl
{
39 char name
[MAX_RM_TBL_NAME
];
41 unsigned long *bitmap
;
47 typedef struct RdmaRmPD
{
48 RdmaBackendPD backend_pd
;
52 typedef struct RdmaRmCQ
{
53 RdmaBackendCQ backend_cq
;
59 typedef struct RdmaRmMR
{
60 RdmaBackendMR backend_mr
;
69 typedef struct RdmaRmUC
{
73 typedef struct RdmaRmQP
{
74 RdmaBackendQP backend_qp
;
78 uint32_t send_cq_handle
;
79 uint32_t recv_cq_handle
;
80 enum ibv_qp_state qp_state
;
83 typedef struct RdmaRmPort
{
84 union ibv_gid gid_tbl
[MAX_PORT_GIDS
];
85 enum ibv_port_state state
;
88 typedef struct RdmaDeviceResources
{
89 RdmaRmPort ports
[MAX_PORTS
];
95 RdmaRmResTbl cqe_ctx_tbl
;
96 GHashTable
*qp_hash
; /* Keeps mapping between real and emulated */
97 } RdmaDeviceResources
;