From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
jgg-uk2M96/98Pc@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH rdma-core] libhns: Add rereg mr interface in userspace
Date: Tue, 21 Nov 2017 15:53:10 +0200 [thread overview]
Message-ID: <20171121135310.GV18825@mtr-leonro.local> (raw)
In-Reply-To: <1511266846-137693-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2943 bytes --]
On Tue, Nov 21, 2017 at 08:20:46PM +0800, Lijun Ou wrote:
> This patch adds the rereg mr verbs in userspace.
>
> Signed-off-by: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> providers/hns/hns_roce_u.c | 1 +
> providers/hns/hns_roce_u.h | 2 ++
> providers/hns/hns_roce_u_verbs.c | 14 ++++++++++++++
> 3 files changed, 17 insertions(+)
>
> diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c
> index ababd9c..9b5de44 100644
> --- a/providers/hns/hns_roce_u.c
> +++ b/providers/hns/hns_roce_u.c
> @@ -118,6 +118,7 @@ static struct ibv_context *hns_roce_alloc_context(struct ibv_device *ibdev,
> context->ibv_ctx.ops.alloc_pd = hns_roce_u_alloc_pd;
> context->ibv_ctx.ops.dealloc_pd = hns_roce_u_free_pd;
> context->ibv_ctx.ops.reg_mr = hns_roce_u_reg_mr;
> + context->ibv_ctx.ops.rereg_mr = hns_roce_u_rereg_mr;
> context->ibv_ctx.ops.dereg_mr = hns_roce_u_dereg_mr;
>
> context->ibv_ctx.ops.create_cq = hns_roce_u_create_cq;
> diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h
> index 0e98f22..2f4f3dc 100644
> --- a/providers/hns/hns_roce_u.h
> +++ b/providers/hns/hns_roce_u.h
> @@ -254,6 +254,8 @@ int hns_roce_u_free_pd(struct ibv_pd *pd);
>
> struct ibv_mr *hns_roce_u_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
> int access);
> +int hns_roce_u_rereg_mr(struct ibv_mr *mr, int flags, struct ibv_pd *pd,
> + void *addr, size_t length, int access);
> int hns_roce_u_dereg_mr(struct ibv_mr *mr);
>
> struct ibv_cq *hns_roce_u_create_cq(struct ibv_context *context, int cqe,
> diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
> index d0ab10a..4fa188f 100644
> --- a/providers/hns/hns_roce_u_verbs.c
> +++ b/providers/hns/hns_roce_u_verbs.c
> @@ -150,6 +150,20 @@ struct ibv_mr *hns_roce_u_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
> return mr;
> }
>
> +int hns_roce_u_rereg_mr(struct ibv_mr *mr, int flags, struct ibv_pd *pd,
> + void *addr, size_t length, int access)
> +{
> + struct ibv_rereg_mr cmd;
> + struct ibv_rereg_mr_resp resp;
> +
> + if (flags & IBV_REREG_MR_KEEP_VALID)
> + return ENOTSUP;
You need to write the supported flags here, so the people will
be able to extend ibv_rereg_mr_flags without worries about your driver.
Thanks
> +
> + return ibv_cmd_rereg_mr(mr, flags, addr, length, (uintptr_t)addr,
> + access, pd, &cmd, sizeof(cmd), &resp,
> + sizeof(resp));
> +}
> +
> int hns_roce_u_dereg_mr(struct ibv_mr *mr)
> {
> int ret;
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-11-21 13:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 12:20 [PATCH rdma-core] libhns: Add rereg mr interface in userspace Lijun Ou
[not found] ` <1511266846-137693-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-21 13:53 ` Leon Romanovsky [this message]
[not found] ` <20171121135310.GV18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-21 15:18 ` Jason Gunthorpe
2017-11-24 8:38 ` oulijun
[not found] ` <facbc654-30ad-1bb7-f066-6dff2d5deaca-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-24 16:03 ` Jason Gunthorpe
[not found] ` <20171124160347.GA3552-uk2M96/98Pc@public.gmane.org>
2017-11-25 1:23 ` oulijun
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=20171121135310.GV18825@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jgg-uk2M96/98Pc@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox