]>
Commit | Line | Data |
---|---|---|
b3a92277 YS |
1 | /* |
2 | * RDMA device: Definitions of Backend Device structures | |
3 | * | |
4 | * Copyright (C) 2018 Oracle | |
5 | * Copyright (C) 2018 Red Hat Inc | |
6 | * | |
7 | * Authors: | |
8 | * Yuval Shaia <[email protected]> | |
9 | * Marcel Apfelbaum <[email protected]> | |
10 | * | |
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. | |
13 | * | |
14 | */ | |
15 | ||
16 | #ifndef RDMA_BACKEND_DEFS_H | |
17 | #define RDMA_BACKEND_DEFS_H | |
18 | ||
19 | #include <infiniband/verbs.h> | |
0efc9511 | 20 | #include "qemu/thread.h" |
b3a92277 YS |
21 | |
22 | typedef struct RdmaDeviceResources RdmaDeviceResources; | |
23 | ||
24 | typedef struct RdmaBackendThread { | |
25 | QemuThread thread; | |
26 | QemuMutex mutex; | |
27 | bool run; | |
28 | } RdmaBackendThread; | |
29 | ||
30 | typedef struct RdmaBackendDev { | |
31 | struct ibv_device_attr dev_attr; | |
32 | RdmaBackendThread comp_thread; | |
33 | union ibv_gid gid; | |
34 | PCIDevice *dev; | |
35 | RdmaDeviceResources *rdma_dev_res; | |
36 | struct ibv_device *ib_dev; | |
37 | struct ibv_context *context; | |
38 | struct ibv_comp_channel *channel; | |
39 | uint8_t port_num; | |
40 | uint8_t backend_gid_idx; | |
41 | } RdmaBackendDev; | |
42 | ||
43 | typedef struct RdmaBackendPD { | |
44 | struct ibv_pd *ibpd; | |
45 | } RdmaBackendPD; | |
46 | ||
47 | typedef struct RdmaBackendMR { | |
48 | struct ibv_pd *ibpd; | |
49 | struct ibv_mr *ibmr; | |
50 | } RdmaBackendMR; | |
51 | ||
52 | typedef struct RdmaBackendCQ { | |
53 | RdmaBackendDev *backend_dev; | |
54 | struct ibv_cq *ibcq; | |
55 | } RdmaBackendCQ; | |
56 | ||
57 | typedef struct RdmaBackendQP { | |
58 | struct ibv_pd *ibpd; | |
59 | struct ibv_qp *ibqp; | |
60 | } RdmaBackendQP; | |
61 | ||
62 | #endif |