IB/uverbs: Allow resize CQ operation to return driver-specific data
authorRalph Campbell <ralph.campbell@qlogic.com>
Fri, 22 Sep 2006 22:22:24 +0000 (15:22 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 22 Sep 2006 22:22:24 +0000 (15:22 -0700)
Add a ib_uverbs_resize_cq_resp.driver_data field so that low-level
drivers can return data from a resize CQ operation to userspace.  Have
ib_uverbs_resize_cq() only copy the cqe field, to avoid having to bump
the userspace ABI.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/uverbs_cmd.c
include/rdma/ib_user_verbs.h

index 8b6df7cec0bf90508be20f522d7982d82b171ef0..deae43f31e79b7cbc8846e16ff64f9b9d3759e91 100644 (file)
@@ -879,11 +879,10 @@ ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file,
        if (ret)
                goto out;
 
-       memset(&resp, 0, sizeof resp);
        resp.cqe = cq->cqe;
 
        if (copy_to_user((void __user *) (unsigned long) cmd.response,
-                        &resp, sizeof resp))
+                        &resp, sizeof resp.cqe))
                ret = -EFAULT;
 
 out:
index 7b5372010f4b0a5168f5b7226389b990fa62aa92..db1b814b62cca06583b9d3f53dd96194ec653d90 100644 (file)
@@ -275,6 +275,8 @@ struct ib_uverbs_resize_cq {
 
 struct ib_uverbs_resize_cq_resp {
        __u32 cqe;
+       __u32 reserved;
+       __u64 driver_data[0];
 };
 
 struct ib_uverbs_poll_cq {