Skip to content

Commit

Permalink
IB/uverbs: Allow resize CQ operation to return driver-specific data
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
  • Loading branch information
Ralph Campbell authored and Roland Dreier committed Sep 22, 2006
1 parent fab9722 commit 64f817b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/infiniband/core/uverbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions include/rdma/ib_user_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 64f817b

Please sign in to comment.