summaryrefslogtreecommitdiffstats
path: root/hw/rdma/rdma_rm.c
diff options
context:
space:
mode:
authorYuval Shaia2018-03-20 20:00:22 +0100
committerMarcel Apfelbaum2018-03-23 16:38:55 +0100
commitc99f217431fa926003f015b83e60d5de72305388 (patch)
tree99366082b6a1709f530984fdef2228d0405d7920 /hw/rdma/rdma_rm.c
parentMerge remote-tracking branch 'remotes/borntraeger/tags/s390x-20180323' into s... (diff)
downloadqemu-c99f217431fa926003f015b83e60d5de72305388.tar.gz
qemu-c99f217431fa926003f015b83e60d5de72305388.tar.xz
qemu-c99f217431fa926003f015b83e60d5de72305388.zip
hw/rdma: Add Query QP operation
This operation is needed by rdma devices - implement it. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Diffstat (limited to 'hw/rdma/rdma_rm.c')
-rw-r--r--hw/rdma/rdma_rm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c
index b5fc45ddab..43f73adecf 100644
--- a/hw/rdma/rdma_rm.c
+++ b/hw/rdma/rdma_rm.c
@@ -453,6 +453,24 @@ int rdma_rm_modify_qp(RdmaDeviceResources *dev_res, RdmaBackendDev *backend_dev,
return 0;
}
+int rdma_rm_query_qp(RdmaDeviceResources *dev_res, RdmaBackendDev *backend_dev,
+ uint32_t qp_handle, struct ibv_qp_attr *attr,
+ int attr_mask, struct ibv_qp_init_attr *init_attr)
+{
+ RdmaRmQP *qp;
+
+ pr_dbg("qpn=%d\n", qp_handle);
+
+ qp = rdma_rm_get_qp(dev_res, qp_handle);
+ if (!qp) {
+ return -EINVAL;
+ }
+
+ pr_dbg("qp_type=%d\n", qp->qp_type);
+
+ return rdma_backend_query_qp(&qp->backend_qp, attr, attr_mask, init_attr);
+}
+
void rdma_rm_dealloc_qp(RdmaDeviceResources *dev_res, uint32_t qp_handle)
{
RdmaRmQP *qp;