public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Idan Burstein <idanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-next 3/3] IB/mlx5: Support out of order data placement
Date: Mon, 12 Jun 2017 09:49:18 +0300	[thread overview]
Message-ID: <20170612064918.12510-4-leon@kernel.org> (raw)
In-Reply-To: <20170612064918.12510-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

From: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

This patch sets out of order data placement capability whenever
device supports it. Currently its supports on RC and XRC QPs.
It also extends the support to set such attribute for a QP during
state transition.

Signed-off-by: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c | 12 ++++++++++++
 drivers/infiniband/hw/mlx5/qp.c   | 25 +++++++++++++++++++++++++
 include/linux/mlx5/mlx5_ifc.h     |  5 ++++-
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 0c79983c8b1a..7f5284c08b8d 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -572,6 +572,16 @@ static int mlx5_query_node_desc(struct mlx5_ib_dev *dev, char *node_desc)
 				    MLX5_REG_NODE_DESC, 0, 0);
 }
 
+static void mlx5_ib_fill_ooo_caps(struct mlx5_ib_dev *dev,
+				  struct ib_ooo_caps *caps)
+{
+	if (MLX5_CAP_GEN(dev->mdev, multi_path_rc_rdma))
+		caps->rc_caps |= IB_OOO_RW_DATA_PLACEMENT;
+
+	if (MLX5_CAP_GEN(dev->mdev, multi_path_xrc_rdma))
+		caps->xrc_caps |= IB_OOO_RW_DATA_PLACEMENT;
+}
+
 static int mlx5_ib_query_device(struct ib_device *ibdev,
 				struct ib_device_attr *props,
 				struct ib_udata *uhw)
@@ -765,6 +775,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 			1 << MLX5_CAP_GEN(dev->mdev, log_max_rq);
 	}
 
+	mlx5_ib_fill_ooo_caps(dev, &props->ooo_caps);
+
 	if (field_avail(typeof(resp), cqe_comp_caps, uhw->outlen)) {
 		resp.cqe_comp_caps.max_num =
 			MLX5_CAP_GEN(dev->mdev, cqe_compression) ?
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index ebb6768684de..bbe616e373b3 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -54,6 +54,10 @@ enum {
 	MLX5_IB_SQ_STRIDE	= 6,
 };
 
+enum {
+	MLX5_QP_OOO_ATTR	= 25,
+};
+
 static const u32 mlx5_ib_opcode[] = {
 	[IB_WR_SEND]				= MLX5_OPCODE_SEND,
 	[IB_WR_LSO]				= MLX5_OPCODE_LSO,
@@ -2810,6 +2814,27 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
 	if (qp->flags & MLX5_IB_QP_SQPN_QP1)
 		context->deth_sqpn = cpu_to_be32(1);
 
+	if (attr_mask & IB_QP_OOO_RW_DATA_PLACEMENT) {
+		if (ibqp->qp_type == IB_QPT_RC) {
+			if (MLX5_CAP_GEN(dev->mdev, multi_path_rc_rdma)) {
+				context->flags_pd |=
+					cpu_to_be32(1 << MLX5_QP_OOO_ATTR);
+			} else {
+				err = -EINVAL;
+				goto out;
+			}
+		} else if (ibqp->qp_type == IB_QPT_XRC_INI ||
+			   ibqp->qp_type == IB_QPT_XRC_TGT) {
+			if (MLX5_CAP_GEN(dev->mdev, multi_path_xrc_rdma)) {
+				context->flags_pd |=
+					cpu_to_be32(1 << MLX5_QP_OOO_ATTR);
+			} else {
+				err = -EINVAL;
+				goto out;
+			}
+		}
+	}
+
 	mlx5_cur = to_mlx5_state(cur_state);
 	mlx5_new = to_mlx5_state(new_state);
 	mlx5_st = to_mlx5_st(ibqp->qp_type);
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index edafedb7b509..3d1e77e97552 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -856,7 +856,10 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8         pps[0x1];
 	u8         pps_modify[0x1];
 	u8         log_max_msg[0x5];
-	u8         reserved_at_1c8[0x4];
+	u8         multi_path_xrc_rdma[0x1];
+	u8         reserved_at_1c9[0x1];
+	u8         multi_path_rc_rdma[0x1];
+	u8         reserved_at_1cb[0x1];
 	u8         max_tc[0x4];
 	u8         reserved_at_1d0[0x1];
 	u8         dcbx[0x1];
-- 
2.12.2

--
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

  parent reply	other threads:[~2017-06-12  6:49 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12  6:49 [PATCH rdma-next 0/3] Support out of order data placement Leon Romanovsky
     [not found] ` <20170612064918.12510-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-06-12  6:49   ` [PATCH rdma-next 1/3] IB/core: Expose out of order data placement capability Leon Romanovsky
2017-06-12  6:49   ` [PATCH rdma-next 2/3] IB/uverbs: Enable user space programs to use out of order placement Leon Romanovsky
2017-06-12  6:49   ` Leon Romanovsky [this message]
2017-06-12 15:28   ` [PATCH rdma-next 0/3] Support out of order data placement Bart Van Assche
     [not found]     ` <1497281280.2770.1.camel-Sjgp3cTcYWE@public.gmane.org>
2017-06-12 16:19       ` Parav Pandit
     [not found]         ` <VI1PR0502MB3008478FC7C70D1F398FE2B2D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 16:29           ` Jason Gunthorpe
     [not found]             ` <20170612162917.GA11993-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 16:42               ` Parav Pandit
     [not found]                 ` <VI1PR0502MB3008EA451DA9ECEBECE27362D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 16:43                   ` Jason Gunthorpe
     [not found]                     ` <20170612164343.GA12435-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 16:53                       ` Parav Pandit
     [not found]                         ` <VI1PR0502MB300831A1560531E67B29589DD1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 16:55                           ` Jason Gunthorpe
     [not found]                             ` <20170612165536.GB12435-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 17:11                               ` Parav Pandit
     [not found]                                 ` <VI1PR0502MB30089EDC828A142338B1EE06D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 17:14                                   ` Jason Gunthorpe
     [not found]                                     ` <20170612171436.GA12739-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 17:28                                       ` Parav Pandit
     [not found]                                         ` <VI1PR0502MB3008304F8465C19ACCFF3D68D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 17:32                                           ` Jason Gunthorpe
     [not found]                                             ` <20170612173221.GA13302-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 17:46                                               ` Parav Pandit
     [not found]                                                 ` <VI1PR0502MB30081FD74492E97043F45BD8D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 17:51                                                   ` Jason Gunthorpe
2017-06-12 21:09                               ` Tom Talpey
     [not found]                                 ` <6747e257-67b0-a364-be21-04f73ef82ffe-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-06-12 21:32                                   ` Parav Pandit
     [not found]                                     ` <VI1PR0502MB30080B672B80836FF0A328DCD1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 21:41                                       ` Jason Gunthorpe
     [not found]                                         ` <20170612214135.GB30578-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 21:59                                           ` Parav Pandit
     [not found]                                             ` <VI1PR0502MB30087762738A4E02A1DA24D0D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 22:07                                               ` Jason Gunthorpe
     [not found]                                                 ` <20170612220730.GA32510-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 22:16                                                   ` Parav Pandit
     [not found]                                                     ` <VI1PR0502MB30088258D7BADC83B0609F38D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 22:21                                                       ` Jason Gunthorpe
2017-06-12 22:19                                       ` Tom Talpey
     [not found]                                         ` <475e1873-e842-ecb9-d260-34777da57e51-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-06-12 22:54                                           ` Parav Pandit
     [not found]                                             ` <VI1PR0502MB3008B7FE60CAB3BD49907A1BD1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 23:44                                               ` Tom Talpey
     [not found]                                                 ` <d3a436a0-9ace-b11a-2e4c-387fc575877e-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-06-12 23:59                                                   ` Parav Pandit
     [not found]                                                     ` <VI1PR0502MB3008E04612EED6BC83F37115D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-13  0:11                                                       ` Tom Talpey
     [not found]                                                         ` <fbdcf05b-ccd8-bd9c-c9c8-86f373303250-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-06-13  0:36                                                           ` Parav Pandit
     [not found]                                                             ` <VI1PR0502MB30089271EB542493AA58060CD1C20-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-13  1:30                                                               ` Tom Talpey
     [not found]                                                                 ` <fb11f261-b80b-f71a-8076-204706267798-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-06-13 19:17                                                                   ` Jason Gunthorpe
2017-06-23 16:03                                                                   ` Parav Pandit
2017-07-19  5:33                                                                   ` Parav Pandit
     [not found]                                                                     ` <VI1PR0502MB3008D488FEE8A7104A7B0A7CD1A60-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-07-19 17:12                                                                       ` Jason Gunthorpe
     [not found]                                                                         ` <20170719171211.GB25714-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-20 15:06                                                                           ` Parav Pandit
2017-07-22  2:29                                                                       ` Tom Talpey
     [not found]                                                                         ` <142c2fed-baa5-1295-1458-be765c94b957-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-07-22  4:50                                                                           ` Parav Pandit
     [not found]                                                                             ` <VI1PR0502MB300886ED1B5B1363B55F53F0D1A50-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-07-22  5:03                                                                               ` Tom Talpey
     [not found]                                                                                 ` <e5cee768-586c-516a-6056-ea4a44f89134-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-07-22  5:32                                                                                   ` Parav Pandit
     [not found]                                                                                     ` <VI1PR0502MB30089915EB792CD20CA9D179D1A50-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-07-22 14:51                                                                                       ` Tom Talpey
     [not found]                                                                                         ` <4444a96a-c1e6-ad33-204a-680982e19bfe-CLs1Zie5N5HQT0dZR+AlfA@public.gmane.org>
2017-07-22 15:11                                                                                           ` Parav Pandit
2017-07-22 16:09                                                                                           ` Jason Gunthorpe
     [not found]                                                                                             ` <20170722160939.GA30007-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-22 17:32                                                                                               ` Parav Pandit
     [not found]                                                                                                 ` <VI1PR0502MB3008E483BB36F944C2E212ACD1A50-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-07-22 21:27                                                                                                   ` Jason Gunthorpe
     [not found]                                                                                                     ` <20170722212706.GA14714-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-01 18:14                                                                                                       ` Parav Pandit
     [not found]                                                                                                         ` <VI1PR0502MB300871C35E1CC06EB378D6C8D1B30-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-08-01 19:00                                                                                                           ` Jason Gunthorpe
     [not found]                                                                                                             ` <20170801190052.GA31205-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-01 22:06                                                                                                               ` Parav Pandit
     [not found]                                                                                                                 ` <VI1PR0502MB3008D65E9568764C4A781230D1B30-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-08-01 23:37                                                                                                                   ` Jason Gunthorpe
     [not found]                                                                                                                     ` <20170801233754.GB10239-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-02  0:30                                                                                                                       ` Parav Pandit
     [not found]                                                                                                                         ` <VI1PR0502MB300860BDA4E6BD0B10F5DB1ED1B00-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-08-02  2:48                                                                                                                           ` Jason Gunthorpe
2017-06-27  9:47                               ` Sagi Grimberg
2017-06-12 16:29           ` Bart Van Assche
     [not found]             ` <1497284956.2770.8.camel-Sjgp3cTcYWE@public.gmane.org>
2017-06-12 16:51               ` Parav Pandit
2017-06-12 17:18   ` Steve Wise
2017-06-12 17:37     ` Parav Pandit
     [not found]       ` <VI1PR0502MB3008CE85A4F274886B74DF2BD1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 19:06         ` Dennis Dalessandro
     [not found]           ` <3fa7a4b5-5c19-8c6a-d78b-93219a9be888-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-06-12 19:19             ` Hefty, Sean
     [not found]               ` <1828884A29C6694DAF28B7E6B8A82373AB142A9B-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-06-12 20:14                 ` Parav Pandit
     [not found]                   ` <VI1PR0502MB300885A1DD676E1649CDB268D1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 20:35                     ` Dennis Dalessandro
     [not found]                       ` <b5279c09-027f-e374-ffde-7f236c52322c-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-06-12 20:46                         ` Hefty, Sean
     [not found]                           ` <1828884A29C6694DAF28B7E6B8A82373AB142BEC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-06-12 20:57                             ` Steve Wise
2017-06-12 21:02                               ` Jason Gunthorpe
     [not found]                                 ` <20170612210259.GA25652-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 21:18                                   ` Steve Wise
2017-06-12 21:22                                     ` Jason Gunthorpe
2017-06-12 21:53                                     ` Parav Pandit
     [not found]                                       ` <VI1PR0502MB30082486BC3B1669FE48764ED1CD0-o1MPJYiShExKsLr+rGaxW8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-12 21:57                                         ` Jason Gunthorpe
     [not found]                                           ` <20170612215741.GA31693-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-12 22:00                                             ` Parav Pandit
2017-06-13  5:29                                   ` Leon Romanovsky
2017-06-12 20:41                     ` Hefty, Sean
     [not found]                       ` <1828884A29C6694DAF28B7E6B8A82373AB142BC8-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-06-12 21:25                         ` Parav Pandit

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=20170612064918.12510-4-leon@kernel.org \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=idanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=parav-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