]> Git Repo - qemu.git/blob - hw/rdma/rdma_backend_defs.h
Add getsockopt for settable SOL_IPV6 options
[qemu.git] / hw / rdma / rdma_backend_defs.h
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 "qemu/thread.h"
20 #include "chardev/char-fe.h"
21 #include <infiniband/verbs.h>
22 #include "contrib/rdmacm-mux/rdmacm-mux.h"
23
24 typedef struct RdmaDeviceResources RdmaDeviceResources;
25
26 typedef struct RdmaBackendThread {
27     QemuThread thread;
28     QemuMutex mutex;
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 */
31 } RdmaBackendThread;
32
33 typedef struct RecvMadList {
34     QemuMutex lock;
35     QList *list;
36 } RecvMadList;
37
38 typedef struct RdmaCmMux {
39     CharBackend *chr_be;
40     int can_receive;
41 } RdmaCmMux;
42
43 typedef struct RdmaBackendDev {
44     struct ibv_device_attr dev_attr;
45     RdmaBackendThread comp_thread;
46     PCIDevice *dev;
47     RdmaDeviceResources *rdma_dev_res;
48     struct ibv_device *ib_dev;
49     struct ibv_context *context;
50     struct ibv_comp_channel *channel;
51     uint8_t port_num;
52     RecvMadList recv_mads_list;
53     RdmaCmMux rdmacm_mux;
54 } RdmaBackendDev;
55
56 typedef struct RdmaBackendPD {
57     struct ibv_pd *ibpd;
58 } RdmaBackendPD;
59
60 typedef struct RdmaBackendMR {
61     struct ibv_pd *ibpd;
62     struct ibv_mr *ibmr;
63 } RdmaBackendMR;
64
65 typedef struct RdmaBackendCQ {
66     RdmaBackendDev *backend_dev;
67     struct ibv_cq *ibcq;
68 } RdmaBackendCQ;
69
70 typedef struct RdmaBackendQP {
71     struct ibv_pd *ibpd;
72     struct ibv_qp *ibqp;
73     uint8_t sgid_idx;
74 } RdmaBackendQP;
75
76 #endif
This page took 0.027815 seconds and 4 git commands to generate.