2 * RDMA device: Definitions of Backend Device 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_BACKEND_DEFS_H
17 #define RDMA_BACKEND_DEFS_H
19 #include <infiniband/verbs.h>
20 #include "qemu/thread.h"
22 typedef struct RdmaDeviceResources RdmaDeviceResources
;
24 typedef struct RdmaBackendThread
{
27 bool run
; /* Set by thread manager to let thread know it should exit */
28 bool is_running
; /* Set by the thread to report its status */
31 typedef struct RdmaBackendDev
{
32 struct ibv_device_attr dev_attr
;
33 RdmaBackendThread comp_thread
;
36 RdmaDeviceResources
*rdma_dev_res
;
37 struct ibv_device
*ib_dev
;
38 struct ibv_context
*context
;
39 struct ibv_comp_channel
*channel
;
41 uint8_t backend_gid_idx
;
44 typedef struct RdmaBackendPD
{
48 typedef struct RdmaBackendMR
{
53 typedef struct RdmaBackendCQ
{
54 RdmaBackendDev
*backend_dev
;
58 typedef struct RdmaBackendQP
{