block: include base when checking image chain for block allocation
[qemu/ar7.git] / contrib / rdmacm-mux / rdmacm-mux.h
blob07a472291370f2cf0c3bba8b82ab9287dc6a67fa
1 /*
2 * QEMU paravirtual RDMA - rdmacm-mux declarations
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
7 * Authors:
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 RDMACM_MUX_H
17 #define RDMACM_MUX_H
19 #include "linux/if.h"
20 #include <infiniband/verbs.h>
21 #include <infiniband/umad.h>
22 #include <rdma/rdma_user_cm.h>
24 typedef enum RdmaCmMuxMsgType {
25 RDMACM_MUX_MSG_TYPE_REQ = 0,
26 RDMACM_MUX_MSG_TYPE_RESP = 1,
27 } RdmaCmMuxMsgType;
29 typedef enum RdmaCmMuxOpCode {
30 RDMACM_MUX_OP_CODE_REG = 0,
31 RDMACM_MUX_OP_CODE_UNREG = 1,
32 RDMACM_MUX_OP_CODE_MAD = 2,
33 } RdmaCmMuxOpCode;
35 typedef enum RdmaCmMuxErrCode {
36 RDMACM_MUX_ERR_CODE_OK = 0,
37 RDMACM_MUX_ERR_CODE_EINVAL = 1,
38 RDMACM_MUX_ERR_CODE_EEXIST = 2,
39 RDMACM_MUX_ERR_CODE_EACCES = 3,
40 RDMACM_MUX_ERR_CODE_ENOTFOUND = 4,
41 } RdmaCmMuxErrCode;
43 typedef struct RdmaCmMuxHdr {
44 RdmaCmMuxMsgType msg_type;
45 RdmaCmMuxOpCode op_code;
46 union ibv_gid sgid;
47 RdmaCmMuxErrCode err_code;
48 } RdmaCmUHdr;
50 typedef struct RdmaCmUMad {
51 struct ib_user_mad hdr;
52 char mad[RDMA_MAX_PRIVATE_DATA];
53 } RdmaCmUMad;
55 typedef struct RdmaCmMuxMsg {
56 RdmaCmUHdr hdr;
57 int umad_len;
58 RdmaCmUMad umad;
59 } RdmaCmMuxMsg;
61 #endif