linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next 0/3] Dump and fill MKEY
@ 2018-06-19  5:47 Leon Romanovsky
  2018-06-19  5:47 ` [PATCH mlx5-next 1/3] net/mlx5: Limit scope of dump_fill_mkey function Leon Romanovsky
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Leon Romanovsky @ 2018-06-19  5:47 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Leon Romanovsky <leonro@mellanox.com>

MLX5 IB HCA offers the memory key, dump_fill_mkey to increase
performance, when used in a send or receive operations.

It is used to force local HCA operations to skip the PCI bus access,
while keeping track of the processed length in the ibv_sge handling.

In this three patch series, we expose various bits in our HW
spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and
export such memory key to user space thought our mlx5-abi header file.

Thanks

Leon Romanovsky (1):
  net/mlx5: Add hardware definitions for dump_fill_mkey

Yonatan Cohen (2):
  net/mlx5: Limit scope of dump_fill_mkey function
  IB/mlx5: Expose dump and fill memory key

 drivers/infiniband/hw/mlx5/cmd.c             | 15 +++++++++++++++
 drivers/infiniband/hw/mlx5/cmd.h             |  1 +
 drivers/infiniband/hw/mlx5/main.c            | 16 +++++++++++++++-
 drivers/net/ethernet/mellanox/mlx5/core/mr.c | 17 -----------------
 include/linux/mlx5/driver.h                  |  2 --
 include/linux/mlx5/mlx5_ifc.h                |  4 +++-
 include/uapi/rdma/mlx5-abi.h                 |  3 ++-
 7 files changed, 36 insertions(+), 22 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH mlx5-next 1/3] net/mlx5: Limit scope of dump_fill_mkey function
  2018-06-19  5:47 [PATCH rdma-next 0/3] Dump and fill MKEY Leon Romanovsky
@ 2018-06-19  5:47 ` Leon Romanovsky
  2018-06-19  5:47 ` [PATCH mlx5-next 2/3] net/mlx5: Add hardware definitions for dump_fill_mkey Leon Romanovsky
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Leon Romanovsky @ 2018-06-19  5:47 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Yonatan Cohen <yonatanc@mellanox.com>

mlx5_core_dump_fill_mkey() is going to be used in next
patch in IB and doesn't need to be visible to whole
mlx5_core. Move that command to mlx5_ib.

Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/cmd.c             | 15 +++++++++++++++
 drivers/infiniband/hw/mlx5/cmd.h             |  1 +
 drivers/net/ethernet/mellanox/mlx5/core/mr.c | 17 -----------------
 include/linux/mlx5/driver.h                  |  2 --
 4 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/cmd.c b/drivers/infiniband/hw/mlx5/cmd.c
index 188512bf46e6..ccc0b5d06a7d 100644
--- a/drivers/infiniband/hw/mlx5/cmd.c
+++ b/drivers/infiniband/hw/mlx5/cmd.c
@@ -32,6 +32,21 @@
 
 #include "cmd.h"
 
+int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey)
+{
+	u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {0};
+	u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)]   = {0};
+	int err;
+
+	MLX5_SET(query_special_contexts_in, in, opcode,
+		 MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
+	err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
+	if (!err)
+		*mkey = MLX5_GET(query_special_contexts_out, out,
+				 dump_fill_mkey);
+	return err;
+}
+
 int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey)
 {
 	u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {};
diff --git a/drivers/infiniband/hw/mlx5/cmd.h b/drivers/infiniband/hw/mlx5/cmd.h
index e7206c8a8011..98ea4648c655 100644
--- a/drivers/infiniband/hw/mlx5/cmd.h
+++ b/drivers/infiniband/hw/mlx5/cmd.h
@@ -37,6 +37,7 @@
 #include <linux/kernel.h>
 #include <linux/mlx5/driver.h>
 
+int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey);
 int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey);
 int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point,
 			       void *out, int out_size);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mr.c b/drivers/net/ethernet/mellanox/mlx5/core/mr.c
index f4f02f775c93..0670165afd5f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mr.c
@@ -146,23 +146,6 @@ int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mkey *mkey,
 }
 EXPORT_SYMBOL(mlx5_core_query_mkey);
 
-int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mkey *_mkey,
-			     u32 *mkey)
-{
-	u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {0};
-	u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)]   = {0};
-	int err;
-
-	MLX5_SET(query_special_contexts_in, in, opcode,
-		 MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
-	err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
-	if (!err)
-		*mkey = MLX5_GET(query_special_contexts_out, out,
-				 dump_fill_mkey);
-	return err;
-}
-EXPORT_SYMBOL(mlx5_core_dump_fill_mkey);
-
 static inline u32 mlx5_get_psv(u32 *out, int psv_index)
 {
 	switch (psv_index) {
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 80cbb7fdce4a..1cb1c0317b77 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1067,8 +1067,6 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev,
 			   struct mlx5_core_mkey *mkey);
 int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mkey *mkey,
 			 u32 *out, int outlen);
-int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mkey *_mkey,
-			     u32 *mkey);
 int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn);
 int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn);
 int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH mlx5-next 2/3] net/mlx5: Add hardware definitions for dump_fill_mkey
  2018-06-19  5:47 [PATCH rdma-next 0/3] Dump and fill MKEY Leon Romanovsky
  2018-06-19  5:47 ` [PATCH mlx5-next 1/3] net/mlx5: Limit scope of dump_fill_mkey function Leon Romanovsky
@ 2018-06-19  5:47 ` Leon Romanovsky
  2018-06-19  5:47 ` [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key Leon Romanovsky
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Leon Romanovsky @ 2018-06-19  5:47 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Leon Romanovsky <leonro@mellanox.com>

MLX5 IB HCA offers the memory key, dump_fill_mkey to boost
performance by forcing local HCA operations to skip the PCI bus
access,

This patch adds needed hardware definitions.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 include/linux/mlx5/mlx5_ifc.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 00b539303f5d..b4302ccb63a6 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -889,7 +889,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8         log_max_eq_sz[0x8];
 	u8         reserved_at_e8[0x2];
 	u8         log_max_mkey[0x6];
-	u8         reserved_at_f0[0xc];
+	u8         reserved_at_f0[0x8];
+	u8         dump_fill_mkey[0x1];
+	u8         reserved_at_fa[0x3];
 	u8         log_max_eq[0x4];
 
 	u8         max_indirection[0x8];
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key
  2018-06-19  5:47 [PATCH rdma-next 0/3] Dump and fill MKEY Leon Romanovsky
  2018-06-19  5:47 ` [PATCH mlx5-next 1/3] net/mlx5: Limit scope of dump_fill_mkey function Leon Romanovsky
  2018-06-19  5:47 ` [PATCH mlx5-next 2/3] net/mlx5: Add hardware definitions for dump_fill_mkey Leon Romanovsky
@ 2018-06-19  5:47 ` Leon Romanovsky
  2018-07-04 19:09   ` Jason Gunthorpe
  2018-06-19 14:21 ` [PATCH rdma-next 0/3] Dump and fill MKEY Jason Gunthorpe
  2018-07-04 17:47 ` Jason Gunthorpe
  4 siblings, 1 reply; 11+ messages in thread
From: Leon Romanovsky @ 2018-06-19  5:47 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Yonatan Cohen <yonatanc@mellanox.com>

MLX5 IB HCA offers the memory key, dump_fill_mkey to boost
performance, when used in a send or receive operations.

It is used to force local HCA operations to skip the PCI bus access,
while keeping track of the processed length in the ibv_sge handling.

Meaning, instead of a PCI write access the HCA leaves the target
memory untouched, and skips filling that packet section. Similar
behavior is done upon send, the HCA skips data in memory relevant
to this key and saves PCI bus access.

This functionality saves PCI read/write operations.

Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 16 +++++++++++++++-
 include/uapi/rdma/mlx5-abi.h      |  3 ++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index c29c7c838980..97113957398d 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1634,6 +1634,7 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
 	int err;
 	size_t min_req_v2 = offsetof(struct mlx5_ib_alloc_ucontext_req_v2,
 				     max_cqe_version);
+	u32 dump_fill_mkey;
 	bool lib_uar_4k;
 
 	if (!dev->ib_active)
@@ -1743,8 +1744,12 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
 		}
 
 		err = mlx5_ib_devx_create(dev, context);
+	}
+
+	if (MLX5_CAP_GEN(dev->mdev, dump_fill_mkey)) {
+		err = mlx5_cmd_dump_fill_mkey(dev->mdev, &dump_fill_mkey);
 		if (err)
-			goto out_td;
+			goto out_mdev;
 	}
 
 	INIT_LIST_HEAD(&context->vma_private_list);
@@ -1805,6 +1810,15 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
 		resp.response_length += sizeof(resp.num_dyn_bfregs);
 	}
 
+	if (field_avail(typeof(resp), dump_fill_mkey, udata->outlen)) {
+		if (MLX5_CAP_GEN(dev->mdev, dump_fill_mkey)) {
+			resp.dump_fill_mkey = dump_fill_mkey;
+			resp.comp_mask |=
+				MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY;
+		}
+		resp.response_length += sizeof(resp.dump_fill_mkey);
+	}
+
 	err = ib_copy_to_udata(udata, &resp, resp.response_length);
 	if (err)
 		goto out_mdev;
diff --git a/include/uapi/rdma/mlx5-abi.h b/include/uapi/rdma/mlx5-abi.h
index 5d591ff28139..addbb9c4529e 100644
--- a/include/uapi/rdma/mlx5-abi.h
+++ b/include/uapi/rdma/mlx5-abi.h
@@ -93,6 +93,7 @@ struct mlx5_ib_alloc_ucontext_req_v2 {
 
 enum mlx5_ib_alloc_ucontext_resp_mask {
 	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
+	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY    = 1UL << 1,
 };
 
 enum mlx5_user_cmds_supp_uhw {
@@ -141,7 +142,7 @@ struct mlx5_ib_alloc_ucontext_resp {
 	__u32	log_uar_size;
 	__u32	num_uars_per_page;
 	__u32	num_dyn_bfregs;
-	__u32	reserved3;
+	__u32	dump_fill_mkey;
 };
 
 struct mlx5_ib_alloc_pd_resp {
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 0/3] Dump and fill MKEY
  2018-06-19  5:47 [PATCH rdma-next 0/3] Dump and fill MKEY Leon Romanovsky
                   ` (2 preceding siblings ...)
  2018-06-19  5:47 ` [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key Leon Romanovsky
@ 2018-06-19 14:21 ` Jason Gunthorpe
  2018-06-19 14:26   ` Leon Romanovsky
  2018-07-04 17:47 ` Jason Gunthorpe
  4 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2018-06-19 14:21 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Guy Levi,
	Yishai Hadas, Yonatan Cohen, Saeed Mahameed, linux-netdev

On Tue, Jun 19, 2018 at 08:47:21AM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> MLX5 IB HCA offers the memory key, dump_fill_mkey to increase
> performance, when used in a send or receive operations.
> 
> It is used to force local HCA operations to skip the PCI bus access,
> while keeping track of the processed length in the ibv_sge handling.
> 
> In this three patch series, we expose various bits in our HW
> spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and
> export such memory key to user space thought our mlx5-abi header file.

Where is the user space for this?

Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 0/3] Dump and fill MKEY
  2018-06-19 14:21 ` [PATCH rdma-next 0/3] Dump and fill MKEY Jason Gunthorpe
@ 2018-06-19 14:26   ` Leon Romanovsky
  0 siblings, 0 replies; 11+ messages in thread
From: Leon Romanovsky @ 2018-06-19 14:26 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Doug Ledford, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

On Tue, Jun 19, 2018 at 08:21:06AM -0600, Jason Gunthorpe wrote:
> On Tue, Jun 19, 2018 at 08:47:21AM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > MLX5 IB HCA offers the memory key, dump_fill_mkey to increase
> > performance, when used in a send or receive operations.
> >
> > It is used to force local HCA operations to skip the PCI bus access,
> > while keeping track of the processed length in the ibv_sge handling.
> >
> > In this three patch series, we expose various bits in our HW
> > spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and
> > export such memory key to user space thought our mlx5-abi header file.
>
> Where is the user space for this?

It will be published in the near future.

Thanks

>
> Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 0/3] Dump and fill MKEY
  2018-06-19  5:47 [PATCH rdma-next 0/3] Dump and fill MKEY Leon Romanovsky
                   ` (3 preceding siblings ...)
  2018-06-19 14:21 ` [PATCH rdma-next 0/3] Dump and fill MKEY Jason Gunthorpe
@ 2018-07-04 17:47 ` Jason Gunthorpe
  2018-07-04 18:54   ` Leon Romanovsky
  4 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2018-07-04 17:47 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Guy Levi,
	Yishai Hadas, Yonatan Cohen, Saeed Mahameed, linux-netdev

On Tue, Jun 19, 2018 at 08:47:21AM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> MLX5 IB HCA offers the memory key, dump_fill_mkey to increase
> performance, when used in a send or receive operations.
> 
> It is used to force local HCA operations to skip the PCI bus access,
> while keeping track of the processed length in the ibv_sge handling.
> 
> In this three patch series, we expose various bits in our HW
> spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and
> export such memory key to user space thought our mlx5-abi header file.
> 
> Thanks

This looks fine, can you send a pull request off the mlx5 branch
please?

Thanks,
Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 0/3] Dump and fill MKEY
  2018-07-04 17:47 ` Jason Gunthorpe
@ 2018-07-04 18:54   ` Leon Romanovsky
  2018-07-04 19:29     ` Jason Gunthorpe
  0 siblings, 1 reply; 11+ messages in thread
From: Leon Romanovsky @ 2018-07-04 18:54 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Doug Ledford, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

On Wed, Jul 04, 2018 at 11:47:39AM -0600, Jason Gunthorpe wrote:
> On Tue, Jun 19, 2018 at 08:47:21AM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > MLX5 IB HCA offers the memory key, dump_fill_mkey to increase
> > performance, when used in a send or receive operations.
> >
> > It is used to force local HCA operations to skip the PCI bus access,
> > while keeping track of the processed length in the ibv_sge handling.
> >
> > In this three patch series, we expose various bits in our HW
> > spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and
> > export such memory key to user space thought our mlx5-abi header file.
> >
> > Thanks
>
> This looks fine, can you send a pull request off the mlx5 branch
> please?

Updated mlx5-next with first two commits,
b183ee27f5fb net/mlx5: Add hardware definitions for dump_fill_mkey
4d4fb5dc988a net/mlx5: Limit scope of dump_fill_mkey function

Thanks

>
> Thanks,
> Jason

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key
  2018-06-19  5:47 ` [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key Leon Romanovsky
@ 2018-07-04 19:09   ` Jason Gunthorpe
  2018-07-04 19:20     ` Leon Romanovsky
  0 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2018-07-04 19:09 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Guy Levi,
	Yishai Hadas, Yonatan Cohen, Saeed Mahameed, linux-netdev

On Tue, Jun 19, 2018 at 08:47:24AM +0300, Leon Romanovsky wrote:
> From: Yonatan Cohen <yonatanc@mellanox.com>
> 
> MLX5 IB HCA offers the memory key, dump_fill_mkey to boost
> performance, when used in a send or receive operations.
> 
> It is used to force local HCA operations to skip the PCI bus access,
> while keeping track of the processed length in the ibv_sge handling.
> 
> Meaning, instead of a PCI write access the HCA leaves the target
> memory untouched, and skips filling that packet section. Similar
> behavior is done upon send, the HCA skips data in memory relevant
> to this key and saves PCI bus access.
> 
> This functionality saves PCI read/write operations.
> 
> Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
> Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> Reviewed-by: Guy Levi <guyle@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>  drivers/infiniband/hw/mlx5/main.c | 16 +++++++++++++++-
>  include/uapi/rdma/mlx5-abi.h      |  3 ++-
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index c29c7c838980..97113957398d 100644
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -1634,6 +1634,7 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
>  	int err;
>  	size_t min_req_v2 = offsetof(struct mlx5_ib_alloc_ucontext_req_v2,
>  				     max_cqe_version);
> +	u32 dump_fill_mkey;
>  	bool lib_uar_4k;
>  
>  	if (!dev->ib_active)
> @@ -1743,8 +1744,12 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
>  		}
>  
>  		err = mlx5_ib_devx_create(dev, context);
> +	}
> +
> +	if (MLX5_CAP_GEN(dev->mdev, dump_fill_mkey)) {
> +		err = mlx5_cmd_dump_fill_mkey(dev->mdev, &dump_fill_mkey);
>  		if (err)
> -			goto out_td;
> +			goto out_mdev;
>  	}

Dropping the if (err) after mlx5_ib_devx_create is a rebasing error,
right?

Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key
  2018-07-04 19:09   ` Jason Gunthorpe
@ 2018-07-04 19:20     ` Leon Romanovsky
  0 siblings, 0 replies; 11+ messages in thread
From: Leon Romanovsky @ 2018-07-04 19:20 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Doug Ledford, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]

On Wed, Jul 04, 2018 at 01:09:37PM -0600, Jason Gunthorpe wrote:
> On Tue, Jun 19, 2018 at 08:47:24AM +0300, Leon Romanovsky wrote:
> > From: Yonatan Cohen <yonatanc@mellanox.com>
> >
> > MLX5 IB HCA offers the memory key, dump_fill_mkey to boost
> > performance, when used in a send or receive operations.
> >
> > It is used to force local HCA operations to skip the PCI bus access,
> > while keeping track of the processed length in the ibv_sge handling.
> >
> > Meaning, instead of a PCI write access the HCA leaves the target
> > memory untouched, and skips filling that packet section. Similar
> > behavior is done upon send, the HCA skips data in memory relevant
> > to this key and saves PCI bus access.
> >
> > This functionality saves PCI read/write operations.
> >
> > Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
> > Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> > Reviewed-by: Guy Levi <guyle@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >  drivers/infiniband/hw/mlx5/main.c | 16 +++++++++++++++-
> >  include/uapi/rdma/mlx5-abi.h      |  3 ++-
> >  2 files changed, 17 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index c29c7c838980..97113957398d 100644
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -1634,6 +1634,7 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
> >  	int err;
> >  	size_t min_req_v2 = offsetof(struct mlx5_ib_alloc_ucontext_req_v2,
> >  				     max_cqe_version);
> > +	u32 dump_fill_mkey;
> >  	bool lib_uar_4k;
> >
> >  	if (!dev->ib_active)
> > @@ -1743,8 +1744,12 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
> >  		}
> >
> >  		err = mlx5_ib_devx_create(dev, context);
> > +	}
> > +
> > +	if (MLX5_CAP_GEN(dev->mdev, dump_fill_mkey)) {
> > +		err = mlx5_cmd_dump_fill_mkey(dev->mdev, &dump_fill_mkey);
> >  		if (err)
> > -			goto out_td;
> > +			goto out_mdev;
> >  	}
>
> Dropping the if (err) after mlx5_ib_devx_create is a rebasing error,
> right?

Sorry, you are right, the fixup is pretty straightforward.

diff --git a/drivers/infiniband/hw/mlx5/main.c
b/drivers/infiniband/hw/mlx5/main.c
index 2bbafee6976c..71f3e9677622 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1739,6 +1739,8 @@ static struct ib_ucontext
*mlx5_ib_alloc_ucontext(struct ib_device *ibdev,
                }

                err = mlx5_ib_devx_create(dev,  context);
                if (err)
 +                       goto out_td;
         }

         if (MLX5_CAP_GEN(dev->mdev, dump_fill_mkey)) {


>
> Jason

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH rdma-next 0/3] Dump and fill MKEY
  2018-07-04 18:54   ` Leon Romanovsky
@ 2018-07-04 19:29     ` Jason Gunthorpe
  0 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2018-07-04 19:29 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

On Wed, Jul 04, 2018 at 09:54:59PM +0300, Leon Romanovsky wrote:
> On Wed, Jul 04, 2018 at 11:47:39AM -0600, Jason Gunthorpe wrote:
> > On Tue, Jun 19, 2018 at 08:47:21AM +0300, Leon Romanovsky wrote:
> > > From: Leon Romanovsky <leonro@mellanox.com>
> > >
> > > MLX5 IB HCA offers the memory key, dump_fill_mkey to increase
> > > performance, when used in a send or receive operations.
> > >
> > > It is used to force local HCA operations to skip the PCI bus access,
> > > while keeping track of the processed length in the ibv_sge handling.
> > >
> > > In this three patch series, we expose various bits in our HW
> > > spec file (mlx5_ifc.h), move unneeded for mlx5_core FW command and
> > > export such memory key to user space thought our mlx5-abi header file.
> > >
> > > Thanks
> >
> > This looks fine, can you send a pull request off the mlx5 branch
> > please?
> 
> Updated mlx5-next with first two commits,
> b183ee27f5fb net/mlx5: Add hardware definitions for dump_fill_mkey
> 4d4fb5dc988a net/mlx5: Limit scope of dump_fill_mkey function

Okay, applied to for-next, with the missing 'if (err)' fixed.

Thanks,
Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-07-04 19:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19  5:47 [PATCH rdma-next 0/3] Dump and fill MKEY Leon Romanovsky
2018-06-19  5:47 ` [PATCH mlx5-next 1/3] net/mlx5: Limit scope of dump_fill_mkey function Leon Romanovsky
2018-06-19  5:47 ` [PATCH mlx5-next 2/3] net/mlx5: Add hardware definitions for dump_fill_mkey Leon Romanovsky
2018-06-19  5:47 ` [PATCH rdma-next 3/3] IB/mlx5: Expose dump and fill memory key Leon Romanovsky
2018-07-04 19:09   ` Jason Gunthorpe
2018-07-04 19:20     ` Leon Romanovsky
2018-06-19 14:21 ` [PATCH rdma-next 0/3] Dump and fill MKEY Jason Gunthorpe
2018-06-19 14:26   ` Leon Romanovsky
2018-07-04 17:47 ` Jason Gunthorpe
2018-07-04 18:54   ` Leon Romanovsky
2018-07-04 19:29     ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).