From: Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH libmlx4] Add MR re-registeration
Date: Sun, 02 Nov 2014 14:35:58 +0200 [thread overview]
Message-ID: <5456252E.4000605@dev.mellanox.co.il> (raw)
In-Reply-To: <1414920625-20479-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On 11/2/2014 11:30 AM, Or Gerlitz wrote:
> From: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Add memory re-registeration to libmlx4.
>
> Memory re-registeration is a feature that enables one to change
> the attributes of a memory region, including PD, translation
> (address and length) and access flags.
>
> Signed-off-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> src/mlx4.c | 1 +
> src/mlx4.h | 2 ++
> src/verbs.c | 15 +++++++++++++++
> 3 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/src/mlx4.c b/src/mlx4.c
> index 2999150..115fc9c 100644
> --- a/src/mlx4.c
> +++ b/src/mlx4.c
> @@ -92,6 +92,7 @@ static struct ibv_context_ops mlx4_ctx_ops = {
> .alloc_pd = mlx4_alloc_pd,
> .dealloc_pd = mlx4_free_pd,
> .reg_mr = mlx4_reg_mr,
> + .rereg_mr = mlx4_rereg_mr,
> .dereg_mr = mlx4_dereg_mr,
> .create_cq = mlx4_create_cq,
> .poll_cq = mlx4_poll_cq,
> diff --git a/src/mlx4.h b/src/mlx4.h
> index d71450f..ccb363a 100644
> --- a/src/mlx4.h
> +++ b/src/mlx4.h
> @@ -363,6 +363,8 @@ int mlx4_close_xrcd(struct ibv_xrcd *xrcd);
>
> struct ibv_mr *mlx4_reg_mr(struct ibv_pd *pd, void *addr,
> size_t length, int access);
> +int mlx4_rereg_mr(struct ibv_mr *mr, int flags, struct ibv_pd *pd,
> + void *addr, size_t length, uint64_t access);
> int mlx4_dereg_mr(struct ibv_mr *mr);
>
> struct ibv_cq *mlx4_create_cq(struct ibv_context *context, int cqe,
> diff --git a/src/verbs.c b/src/verbs.c
> index 623d576..db97303 100644
> --- a/src/verbs.c
> +++ b/src/verbs.c
> @@ -166,6 +166,21 @@ struct ibv_mr *mlx4_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
> return mr;
> }
>
> +int mlx4_rereg_mr(struct ibv_mr *mr,
> + int flags,
> + struct ibv_pd *pd, void *addr,
> + size_t length, uint64_t access)
> +{
> + struct ibv_rereg_mr cmd;
> + struct ibv_rereg_mr_resp resp;
> +
> + return ibv_cmd_rereg_mr(mr, flags, addr, length,
> + (uintptr_t) addr,
> + access, pd,
> + &cmd, sizeof(cmd),
> + &resp, sizeof(resp));
> +}
> +
> int mlx4_dereg_mr(struct ibv_mr *mr)
> {
> int ret;
>
This looks fine to me.
Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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
prev parent reply other threads:[~2014-11-02 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-02 9:30 [PATCH libmlx4] Add MR re-registeration Or Gerlitz
[not found] ` <1414920625-20479-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-11-02 12:35 ` Sagi Grimberg [this message]
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=5456252E.4000605@dev.mellanox.co.il \
--to=sagig-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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