From: Jason Gunthorpe <jgg@nvidia.com>
To: Wenpeng Liang <liangwenpeng@huawei.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
linuxarm@huawei.com, leon@kernel.org,
Xi Wang <wangxi11@huawei.com>
Subject: Re: [PATCH v4 for-next 01/12] RDMA/hns: Introduce DCA for RC QP
Date: Thu, 19 Aug 2021 20:54:49 -0300 [thread overview]
Message-ID: <20210819235449.GA398955@nvidia.com> (raw)
In-Reply-To: <1627525163-1683-2-git-send-email-liangwenpeng@huawei.com>
On Thu, Jul 29, 2021 at 10:19:12AM +0800, Wenpeng Liang wrote:
> +static int UVERBS_HANDLER(HNS_IB_METHOD_DCA_MEM_REG)(
> + struct uverbs_attr_bundle *attrs)
> +{
> + struct hns_roce_ucontext *uctx = uverbs_attr_to_hr_uctx(attrs);
> + struct hns_roce_dev *hr_dev = to_hr_dev(uctx->ibucontext.device);
> + struct ib_uobject *uobj =
> + uverbs_attr_get_uobject(attrs, HNS_IB_ATTR_DCA_MEM_REG_HANDLE);
> + struct dca_mem_attr init_attr = {};
> + struct dca_mem *mem;
> + int ret;
> +
> + if (uverbs_copy_from(&init_attr.addr, attrs,
> + HNS_IB_ATTR_DCA_MEM_REG_ADDR) ||
> + uverbs_copy_from(&init_attr.size, attrs,
> + HNS_IB_ATTR_DCA_MEM_REG_LEN) ||
> + uverbs_copy_from(&init_attr.key, attrs,
> + HNS_IB_ATTR_DCA_MEM_REG_KEY))
> + return -EFAULT;
This should return the code from uverbs_copy_from() not
-EFAULT.
> +DECLARE_UVERBS_NAMED_METHOD(
> + HNS_IB_METHOD_DCA_MEM_REG,
> + UVERBS_ATTR_IDR(HNS_IB_ATTR_DCA_MEM_REG_HANDLE, HNS_IB_OBJECT_DCA_MEM,
> + UVERBS_ACCESS_NEW, UA_MANDATORY),
> + UVERBS_ATTR_PTR_IN(HNS_IB_ATTR_DCA_MEM_REG_LEN, UVERBS_ATTR_TYPE(u32),
> + UA_MANDATORY),
> + UVERBS_ATTR_PTR_IN(HNS_IB_ATTR_DCA_MEM_REG_ADDR, UVERBS_ATTR_TYPE(u64),
> + UA_MANDATORY),
> + UVERBS_ATTR_PTR_IN(HNS_IB_ATTR_DCA_MEM_REG_KEY, UVERBS_ATTR_TYPE(u64),
> + UA_MANDATORY));
I think these ptr_in's are supposed to be const_in these days? The
code you were referencing for this pre-dates const_in and hasn't been
converted.
The distinction is that const_in is only for small < 64 bit types.
Please check all the cases for both of these things
> +extern const struct uapi_definition hns_roce_dca_uapi_defs[];
> +static const struct uapi_definition hns_roce_uapi_defs[] = {
> + UAPI_DEF_CHAIN(hns_roce_dca_uapi_defs),
> + {}
> +};
The 2nd array isn't necessary, is it?
Jason
next prev parent reply other threads:[~2021-08-19 23:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 2:19 [PATCH v4 for-next 00/12] RDMA/hns: Add support for Dynamic Context Attachment Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 01/12] RDMA/hns: Introduce DCA for RC QP Wenpeng Liang
2021-08-19 23:54 ` Jason Gunthorpe [this message]
2021-08-21 9:37 ` Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 02/12] RDMA/hns: Add method for shrinking DCA memory pool Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 03/12] RDMA/hns: Configure DCA mode for the userspace QP Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 04/12] RDMA/hns: Refactor QP modify flow Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 05/12] RDMA/hns: Add method for attaching WQE buffer Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 06/12] RDMA/hns: Setup the configuration of WQE addressing to QPC Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 07/12] RDMA/hns: Add method to detach WQE buffer Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 08/12] RDMA/hns: Add method to query WQE buffer's address Wenpeng Liang
2021-08-19 23:58 ` Jason Gunthorpe
2021-08-21 9:39 ` Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 09/12] RDMA/hns: Add a shared memory to sync DCA status Wenpeng Liang
2021-08-19 23:43 ` Jason Gunthorpe
2021-08-21 9:42 ` Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 10/12] RDMA/hns: Sync DCA status by the shared memory Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 11/12] RDMA/nldev: Add detailed CTX information support Wenpeng Liang
2021-07-29 2:19 ` [PATCH v4 for-next 12/12] RDMA/hns: Dump detailed driver-specific UCTX Wenpeng Liang
2021-08-12 12:42 ` [PATCH v4 for-next 00/12] RDMA/hns: Add support for Dynamic Context Attachment Wenpeng Liang
2021-08-21 9:34 ` Wenpeng Liang
2021-08-22 22:25 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210819235449.GA398955@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=liangwenpeng@huawei.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=wangxi11@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.