mirror of
https://github.com/qemu/qemu.git
synced 2025-08-02 12:45:00 +00:00

MAD (Management Datagram) packets are widely used by various modules both in kernel and in user space for example the rdma_* API which is used to create and maintain "connection" layer on top of RDMA uses several types of MAD packets. For more information please refer to chapter 13.4 in Volume 1 Architecture Specification, Release 1.1 available here: https://www.infinibandta.org/ibta-specifications-download/ To support MAD packets the device uses an external utility (contrib/rdmacm-mux) to relay packets from and to the guest driver. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
72 lines
1.7 KiB
C
72 lines
1.7 KiB
C
/*
|
|
* RDMA device: Definitions of Backend Device structures
|
|
*
|
|
* Copyright (C) 2018 Oracle
|
|
* Copyright (C) 2018 Red Hat Inc
|
|
*
|
|
* Authors:
|
|
* Yuval Shaia <yuval.shaia@oracle.com>
|
|
* Marcel Apfelbaum <marcel@redhat.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#ifndef RDMA_BACKEND_DEFS_H
|
|
#define RDMA_BACKEND_DEFS_H
|
|
|
|
#include "qemu/thread.h"
|
|
#include "chardev/char-fe.h"
|
|
#include <infiniband/verbs.h>
|
|
|
|
typedef struct RdmaDeviceResources RdmaDeviceResources;
|
|
|
|
typedef struct RdmaBackendThread {
|
|
QemuThread thread;
|
|
QemuMutex mutex;
|
|
bool run; /* Set by thread manager to let thread know it should exit */
|
|
bool is_running; /* Set by the thread to report its status */
|
|
} RdmaBackendThread;
|
|
|
|
typedef struct RecvMadList {
|
|
QemuMutex lock;
|
|
QList *list;
|
|
} RecvMadList;
|
|
|
|
typedef struct RdmaBackendDev {
|
|
struct ibv_device_attr dev_attr;
|
|
RdmaBackendThread comp_thread;
|
|
union ibv_gid gid;
|
|
PCIDevice *dev;
|
|
RdmaDeviceResources *rdma_dev_res;
|
|
struct ibv_device *ib_dev;
|
|
struct ibv_context *context;
|
|
struct ibv_comp_channel *channel;
|
|
uint8_t port_num;
|
|
uint8_t backend_gid_idx;
|
|
RecvMadList recv_mads_list;
|
|
CharBackend *mad_chr_be;
|
|
} RdmaBackendDev;
|
|
|
|
typedef struct RdmaBackendPD {
|
|
struct ibv_pd *ibpd;
|
|
} RdmaBackendPD;
|
|
|
|
typedef struct RdmaBackendMR {
|
|
struct ibv_pd *ibpd;
|
|
struct ibv_mr *ibmr;
|
|
} RdmaBackendMR;
|
|
|
|
typedef struct RdmaBackendCQ {
|
|
RdmaBackendDev *backend_dev;
|
|
struct ibv_cq *ibcq;
|
|
} RdmaBackendCQ;
|
|
|
|
typedef struct RdmaBackendQP {
|
|
struct ibv_pd *ibpd;
|
|
struct ibv_qp *ibqp;
|
|
} RdmaBackendQP;
|
|
|
|
#endif
|