diff mbox series

[V3,for-next] RDMA/hns: Update the kernel header file of hns

Message ID 1548209367-87693-1-git-send-email-oulijun@huawei.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series [V3,for-next] RDMA/hns: Update the kernel header file of hns | expand

Commit Message

Lijun Ou Jan. 23, 2019, 2:09 a.m. UTC
The hns_roce_ib_create_srq_resp is used to interact with the
user for data. As a result, it is added to tranfer the srqn
to the user.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
V2->V3:
-Fix the comment given by Jason Gunthorpe

V1->V2:
-Use hns_roce_ib_create_srq_resp to transfer srqn
---
 drivers/infiniband/hw/hns/hns_roce_srq.c | 5 ++++-
 include/uapi/rdma/hns-abi.h              | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Jason Gunthorpe Jan. 23, 2019, 9:38 p.m. UTC | #1
On Wed, Jan 23, 2019 at 10:09:27AM +0800, Lijun Ou wrote:
> The hns_roce_ib_create_srq_resp is used to interact with the
> user for data. As a result, it is added to tranfer the srqn
> to the user.
> 
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_srq.c | 5 ++++-
>  include/uapi/rdma/hns-abi.h              | 5 +++++
>  2 files changed, 9 insertions(+), 1 deletion(-)

I added a fixes line:

    Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")

Applied to for-rc

Thanks,
Jason
Lijun Ou Jan. 24, 2019, 12:56 a.m. UTC | #2
在 2019/1/24 5:38, Jason Gunthorpe 写道:
> On Wed, Jan 23, 2019 at 10:09:27AM +0800, Lijun Ou wrote:
>> The hns_roce_ib_create_srq_resp is used to interact with the
>> user for data. As a result, it is added to tranfer the srqn
>> to the user.
>>
>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>> ---
>>  drivers/infiniband/hw/hns/hns_roce_srq.c | 5 ++++-
>>  include/uapi/rdma/hns-abi.h              | 5 +++++
>>  2 files changed, 9 insertions(+), 1 deletion(-)
> I added a fixes line:
>
>     Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
>
> Applied to for-rc
>
> Thanks,
> Jason
>
Thanks
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_srq.c b/drivers/infiniband/hw/hns/hns_roce_srq.c
index 8975f85..7c50e67 100644
--- a/drivers/infiniband/hw/hns/hns_roce_srq.c
+++ b/drivers/infiniband/hw/hns/hns_roce_srq.c
@@ -210,6 +210,7 @@  struct ib_srq *hns_roce_create_srq(struct ib_pd *pd,
 				   struct ib_udata *udata)
 {
 	struct hns_roce_dev *hr_dev = to_hr_dev(pd->device);
+	struct hns_roce_ib_create_srq_resp resp = {};
 	struct hns_roce_srq *srq;
 	int srq_desc_size;
 	int srq_buf_size;
@@ -377,9 +378,11 @@  struct ib_srq *hns_roce_create_srq(struct ib_pd *pd,
 
 	srq->event = hns_roce_ib_srq_event;
 	srq->ibsrq.ext.xrc.srq_num = srq->srqn;
+	resp.srqn = srq->srqn;
 
 	if (udata) {
-		if (ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {
+		if (ib_copy_to_udata(udata, &resp,
+				     min(udata->outlen, sizeof(resp)))) {
 			ret = -EFAULT;
 			goto err_wrid;
 		}
diff --git a/include/uapi/rdma/hns-abi.h b/include/uapi/rdma/hns-abi.h
index ef3c7ec..eb76b38 100644
--- a/include/uapi/rdma/hns-abi.h
+++ b/include/uapi/rdma/hns-abi.h
@@ -52,6 +52,11 @@  struct hns_roce_ib_create_srq {
 	__aligned_u64 que_addr;
 };
 
+struct hns_roce_ib_create_srq_resp {
+	__u32	srqn;
+	__u32	reserved;
+};
+
 struct hns_roce_ib_create_qp {
 	__aligned_u64 buf_addr;
 	__aligned_u64 db_addr;