summaryrefslogtreecommitdiff
path: root/hw/rdma/rdma_backend_defs.h
diff options
context:
space:
mode:
authorYuval Shaia <yuval.shaia@oracle.com>2018-12-21 16:40:25 +0200
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>2018-12-22 11:09:56 +0200
commit2b05705dc8ad80c09a3aa9cc70c14fb8323b0fd3 (patch)
treef3d3a9f7632b9fd1dcfa8a2dbdd83de617222289 /hw/rdma/rdma_backend_defs.h
parent4a5c9903f3164cef134e7f81b361b3fa7d5c0b52 (diff)
downloadqemu-2b05705dc8ad80c09a3aa9cc70c14fb8323b0fd3.zip
hw/pvrdma: Add support to allow guest to configure GID table
The control over the RDMA device's GID table is done by updating the device's Ethernet function addresses. Usually the first GID entry is determined by the MAC address, the second by the first IPv6 address and the third by the IPv4 address. Other entries can be added by adding more IP addresses. The opposite is the same, i.e. whenever an address is removed, the corresponding GID entry is removed. The process is done by the network and RDMA stacks. Whenever an address is added the ib_core driver is notified and calls the device driver add_gid function which in turn update the device. To support this in pvrdma device we need to hook into the create_bind and destroy_bind HW commands triggered by pvrdma driver in guest. Whenever a change is made to the pvrdma port's GID table a special QMP message is sent to be processed by libvirt to update the address of the backend Ethernet device. 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>
Diffstat (limited to 'hw/rdma/rdma_backend_defs.h')
-rw-r--r--hw/rdma/rdma_backend_defs.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/rdma/rdma_backend_defs.h b/hw/rdma/rdma_backend_defs.h
index 2a7e667075..1e5c3dd3bf 100644
--- a/hw/rdma/rdma_backend_defs.h
+++ b/hw/rdma/rdma_backend_defs.h
@@ -19,6 +19,7 @@
#include "qemu/thread.h"
#include "chardev/char-fe.h"
#include <infiniband/verbs.h>
+#include "contrib/rdmacm-mux/rdmacm-mux.h"
typedef struct RdmaDeviceResources RdmaDeviceResources;
@@ -34,19 +35,22 @@ typedef struct RecvMadList {
QList *list;
} RecvMadList;
+typedef struct RdmaCmMux {
+ CharBackend *chr_be;
+ int can_receive;
+} RdmaCmMux;
+
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;
+ RdmaCmMux rdmacm_mux;
} RdmaBackendDev;
typedef struct RdmaBackendPD {
@@ -66,6 +70,7 @@ typedef struct RdmaBackendCQ {
typedef struct RdmaBackendQP {
struct ibv_pd *ibpd;
struct ibv_qp *ibqp;
+ uint8_t sgid_idx;
} RdmaBackendQP;
#endif