From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Aharon Landau <aharonl@nvidia.com>,
linux-rdma@vger.kernel.org,
Michael Guralnik <michaelgur@nvidia.com>
Subject: Re: [PATCH rdma-next 03/12] RDMA/mlx5: Move mkey ctrl segment logic to umr.c
Date: Mon, 25 Apr 2022 12:22:49 -0300 [thread overview]
Message-ID: <20220425152249.GA2225197@nvidia.com> (raw)
In-Reply-To: <5a7fac8ae8543521d19d174663245ae84b910310.1649747695.git.leonro@nvidia.com>
On Tue, Apr 12, 2022 at 10:23:58AM +0300, Leon Romanovsky wrote:
> From: Aharon Landau <aharonl@nvidia.com>
>
> Move set_reg_umr_segment() and its helpers to umr.c.
>
> Signed-off-by: Aharon Landau <aharonl@nvidia.com>
> Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 -
> drivers/infiniband/hw/mlx5/qp.c | 1 +
> drivers/infiniband/hw/mlx5/umr.c | 129 ++++++++++++++++++++++++
> drivers/infiniband/hw/mlx5/umr.h | 13 +++
> drivers/infiniband/hw/mlx5/wr.c | 142 +--------------------------
> 5 files changed, 147 insertions(+), 141 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> index 18ba11e4e2e6..d77a27503488 100644
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -311,9 +311,6 @@ struct mlx5_ib_flow_db {
> #define MLX5_IB_QPT_DCT IB_QPT_RESERVED4
> #define MLX5_IB_WR_UMR IB_WR_RESERVED1
>
> -#define MLX5_IB_UMR_OCTOWORD 16
> -#define MLX5_IB_UMR_XLT_ALIGNMENT 64
> -
> #define MLX5_IB_UPD_XLT_ZAP BIT(0)
> #define MLX5_IB_UPD_XLT_ENABLE BIT(1)
> #define MLX5_IB_UPD_XLT_ATOMIC BIT(2)
> diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
> index 3f467557d34e..d2f243d3c4e2 100644
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -40,6 +40,7 @@
> #include "ib_rep.h"
> #include "counters.h"
> #include "cmd.h"
> +#include "umr.h"
> #include "qp.h"
> #include "wr.h"
>
> diff --git a/drivers/infiniband/hw/mlx5/umr.c b/drivers/infiniband/hw/mlx5/umr.c
> index 46eaf919eb49..d3626a9dc8ab 100644
> +++ b/drivers/infiniband/hw/mlx5/umr.c
> @@ -4,6 +4,135 @@
> #include "mlx5_ib.h"
> #include "umr.h"
>
> +static __be64 get_umr_enable_mr_mask(void)
> +{
> + u64 result;
> +
> + result = MLX5_MKEY_MASK_KEY |
> + MLX5_MKEY_MASK_FREE;
> +
> + return cpu_to_be64(result);
> +}
> +
> +static __be64 get_umr_disable_mr_mask(void)
> +{
> + u64 result;
> +
> + result = MLX5_MKEY_MASK_FREE;
> +
> + return cpu_to_be64(result);
> +}
> +
> +static __be64 get_umr_update_translation_mask(void)
> +{
> + u64 result;
> +
> + result = MLX5_MKEY_MASK_LEN |
> + MLX5_MKEY_MASK_PAGE_SIZE |
> + MLX5_MKEY_MASK_START_ADDR;
> +
> + return cpu_to_be64(result);
> +}
This is pretty ugly, it is fine to copy it, but an add-on patch to
remove these function wrappers would be nice
#define UMR_MR_MASK_DISABLE cpu_to_be64(MLX5_MKEY_MASK_FREE)
At worst (and arguably it can just be open coded)
Jason
next prev parent reply other threads:[~2022-04-25 15:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 7:23 [PATCH rdma-next 00/12] Refactor UMR post send logic Leon Romanovsky
2022-04-12 7:23 ` [PATCH rdma-next 01/12] RDMA/mlx5: Move init and cleanup of UMR to umr.c Leon Romanovsky
2022-04-12 7:23 ` [PATCH rdma-next 02/12] RDMA/mlx5: Move umr checks to umr.h Leon Romanovsky
2022-04-12 7:23 ` [PATCH rdma-next 03/12] RDMA/mlx5: Move mkey ctrl segment logic to umr.c Leon Romanovsky
2022-04-25 15:22 ` Jason Gunthorpe [this message]
2022-04-12 7:23 ` [PATCH rdma-next 04/12] RDMA/mlx5: Simplify get_umr_update_access_mask() Leon Romanovsky
2022-04-12 7:24 ` [PATCH rdma-next 05/12] RDMA/mlx5: Expose wqe posting helpers outside of wr.c Leon Romanovsky
2022-04-12 7:24 ` [PATCH rdma-next 06/12] RDMA/mlx5: Introduce mlx5_umr_post_send_wait() Leon Romanovsky
2022-04-12 7:24 ` [PATCH rdma-next 07/12] RDMA/mlx5: Use mlx5_umr_post_send_wait() to revoke MRs Leon Romanovsky
2022-04-12 7:24 ` [PATCH rdma-next 08/12] RDMA/mlx5: Use mlx5_umr_post_send_wait() to rereg pd access Leon Romanovsky
2022-04-12 7:24 ` [PATCH rdma-next 09/12] RDMA/mlx5: Move creation and free of translation tables to umr.c Leon Romanovsky
2022-04-25 15:11 ` Jason Gunthorpe
2022-04-12 7:24 ` [PATCH rdma-next 10/12] RDMA/mlx5: Use mlx5_umr_post_send_wait() to update MR pas Leon Romanovsky
2022-04-25 17:43 ` Jason Gunthorpe
2022-04-12 7:24 ` [PATCH rdma-next 11/12] RDMA/mlx5: Use mlx5_umr_post_send_wait() to update xlt Leon Romanovsky
2022-04-12 7:24 ` [PATCH rdma-next 12/12] RDMA/mlx5: Clean UMR QP type flow from mlx5_ib_post_send() Leon Romanovsky
2022-04-25 18:48 ` [PATCH rdma-next 00/12] Refactor UMR post send logic 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=20220425152249.GA2225197@nvidia.com \
--to=jgg@nvidia.com \
--cc=aharonl@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=michaelgur@nvidia.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.