All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
	sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sagi Grimberg <sagig-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
Subject: [PATCH 01/12] IB/mlx5: Expose correct max_sge_rd limit
Date: Mon, 18 Apr 2016 16:14:12 -0400	[thread overview]
Message-ID: <1461010463-6603-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1461010463-6603-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>

From: Sagi Grimberg <sagig-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>

mlx5 devices (Connect-IB, ConnectX-4, ConnectX-4-LX) has a limitation
where rdma read work queue entries cannot exceed 512 bytes.
A rdma_read wqe needs to fit in 512 bytes:
- wqe control segment (16 bytes)
- rdma segment (16 bytes)
- scatter elements (16 bytes each)

So max_sge_rd should be: (512 - 16 - 16) / 16 = 30.

Reported-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Tested-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Signed-off-by: Sagi Grimberg <sagig-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c |  2 +-
 include/linux/mlx5/device.h       | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 5acf346..049754f 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -530,7 +530,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		     sizeof(struct mlx5_wqe_ctrl_seg)) /
 		     sizeof(struct mlx5_wqe_data_seg);
 	props->max_sge = min(max_rq_sg, max_sq_sg);
-	props->max_sge_rd = props->max_sge;
+	props->max_sge_rd	   = MLX5_MAX_SGE_RD;
 	props->max_cq		   = 1 << MLX5_CAP_GEN(mdev, log_max_cq);
 	props->max_cqe = (1 << MLX5_CAP_GEN(mdev, log_max_cq_sz)) - 1;
 	props->max_mr		   = 1 << MLX5_CAP_GEN(mdev, log_max_mkey);
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 8156e3c..b3575f3 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -392,6 +392,17 @@ enum {
 	MLX5_CAP_OFF_CMDIF_CSUM		= 46,
 };
 
+enum {
+	/*
+	 * Max wqe size for rdma read is 512 bytes, so this
+	 * limits our max_sge_rd as the wqe needs to fit:
+	 * - ctrl segment (16 bytes)
+	 * - rdma segment (16 bytes)
+	 * - scatter elements (16 bytes each)
+	 */
+	MLX5_MAX_SGE_RD	= (512 - 16 - 16) / 16
+};
+
 struct mlx5_inbox_hdr {
 	__be16		opcode;
 	u8		rsvd[4];
-- 
2.1.4

--
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:[~2016-04-18 20:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 20:14 generic RDMA READ/WRITE API V7 Christoph Hellwig
2016-04-18 20:14 ` [PATCH 02/12] IB/cma: pass the port number to ib_create_qp Christoph Hellwig
2016-04-18 20:14 ` [PATCH 03/12] IB/core: allow passing mapping an offset into the SG in ib_map_mr_sg Christoph Hellwig
2016-04-18 20:14 ` [PATCH 04/12] IB/core: add a helper to check for READ WITH INVALIDATE support Christoph Hellwig
2016-04-18 20:14 ` [PATCH 05/12] IB/core: refactor ib_create_qp Christoph Hellwig
2016-04-18 20:14 ` [PATCH 06/12] IB/core: add a simple MR pool Christoph Hellwig
     [not found] ` <1461010463-6603-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-04-18 20:14   ` Christoph Hellwig [this message]
2016-04-18 20:14   ` [PATCH 07/12] IB/core: add a need_inval flag to struct ib_mr Christoph Hellwig
2016-04-18 20:14 ` [PATCH 08/12] IB/core: generic RDMA READ/WRITE API Christoph Hellwig
2016-04-18 20:14 ` [PATCH 09/12] target: enhance and export target_alloc_sgl/target_free_sgl Christoph Hellwig
2016-04-19 14:11   ` Sagi Grimberg
2016-04-18 20:14 ` [PATCH 10/12] IB/srpt: convert to the generic RDMA READ/WRITE API Christoph Hellwig
2016-04-18 20:14 ` [PATCH 11/12] IB/core: add RW API support for signature MRs Christoph Hellwig
     [not found]   ` <1461010463-6603-12-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-04-19 14:20     ` Sagi Grimberg
2016-04-19 17:26       ` Jason Gunthorpe
     [not found]         ` <20160419172627.GC20844-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-04-19 18:29           ` Christoph Hellwig
     [not found]             ` <20160419182950.GC989-jcswGhMUV9g@public.gmane.org>
2016-04-19 18:46               ` Sagi Grimberg
     [not found]       ` <57163E99.8090301-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2016-04-19 18:27         ` Christoph Hellwig
2016-04-18 20:14 ` [PATCH 12/12] IB/isert: convert to the generic RDMA READ/WRITE API Christoph Hellwig
2016-04-19 14:23   ` Sagi Grimberg
  -- strict thread matches above, loose matches on Subject: below --
2016-04-11 21:32 generic RDMA READ/WRITE API V6 Christoph Hellwig
     [not found] ` <1460410360-13104-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-04-11 21:32   ` [PATCH 01/12] IB/mlx5: Expose correct max_sge_rd limit Christoph Hellwig
     [not found]     ` <1460410360-13104-2-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-04-17 13:53       ` Leon Romanovsky
     [not found]         ` <20160417135341.GC6349-2ukJVAZIZ/Y@public.gmane.org>
2016-04-17 18:06           ` Christoph Hellwig

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=1461010463-6603-2-git-send-email-hch@lst.de \
    --to=hch-jcswghmuv9g@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    --cc=sagig-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
    --cc=target-devel-u79uwXL29TY76Z2rM5mHXA@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 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.