rdmacm-mux.h (1424B)
1/* 2 * QEMU paravirtual RDMA - rdmacm-mux declarations 3 * 4 * Copyright (C) 2018 Oracle 5 * Copyright (C) 2018 Red Hat Inc 6 * 7 * Authors: 8 * Yuval Shaia <yuval.shaia@oracle.com> 9 * Marcel Apfelbaum <marcel@redhat.com> 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 RDMACM_MUX_H 17#define RDMACM_MUX_H 18 19#include "linux/if.h" 20#include <infiniband/verbs.h> 21#include <infiniband/umad.h> 22#include <rdma/rdma_user_cm.h> 23 24typedef enum RdmaCmMuxMsgType { 25 RDMACM_MUX_MSG_TYPE_REQ = 0, 26 RDMACM_MUX_MSG_TYPE_RESP = 1, 27} RdmaCmMuxMsgType; 28 29typedef 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; 34 35typedef 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; 42 43typedef struct RdmaCmMuxHdr { 44 RdmaCmMuxMsgType msg_type; 45 RdmaCmMuxOpCode op_code; 46 union ibv_gid sgid; 47 RdmaCmMuxErrCode err_code; 48} RdmaCmUHdr; 49 50typedef struct RdmaCmUMad { 51 struct ib_user_mad hdr; 52 char mad[RDMA_MAX_PRIVATE_DATA]; 53} RdmaCmUMad; 54 55typedef struct RdmaCmMuxMsg { 56 RdmaCmUHdr hdr; 57 int umad_len; 58 RdmaCmUMad umad; 59} RdmaCmMuxMsg; 60 61#endif