2 * RDMA device: Definitions of Backend Device structures
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
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_BACKEND_DEFS_H
17 #define RDMA_BACKEND_DEFS_H
19 #include "qemu/thread.h"
20 #include "chardev/char-fe.h"
21 #include <infiniband/verbs.h>
22 #include "contrib/rdmacm-mux/rdmacm-mux.h"
23 #include "rdma_utils.h"
25 typedef struct RdmaDeviceResources RdmaDeviceResources;
27 typedef struct RdmaBackendThread {
29 bool run; /* Set by thread manager to let thread know it should exit */
30 bool is_running; /* Set by the thread to report its status */
33 typedef struct RdmaCmMux {
38 typedef struct RdmaBackendDev {
39 RdmaBackendThread comp_thread;
41 RdmaDeviceResources *rdma_dev_res;
42 struct ibv_device *ib_dev;
43 struct ibv_context *context;
44 struct ibv_comp_channel *channel;
46 RdmaProtectedQList recv_mads_list;
50 typedef struct RdmaBackendPD {
54 typedef struct RdmaBackendMR {
59 typedef struct RdmaBackendCQ {
60 RdmaBackendDev *backend_dev;
64 typedef struct RdmaBackendQP {
68 RdmaProtectedGSList cqe_ctx_list;
71 typedef struct RdmaBackendSRQ {
72 struct ibv_srq *ibsrq;
73 RdmaProtectedGSList cqe_ctx_list;