From: Doug Ledford <dledford@redhat.com>
To: Sagi Grimberg <sagig@mellanox.com>,
linux-rdma@vger.kernel.org, target-devel@vger.kernel.org
Cc: Steve Wise <swise@opengridcomputing.com>,
"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
Or Gerlitz <ogerlitz@mellanox.com>
Subject: Re: [PATCH v2 1/2] mlx4: Expose correct max_sge_rd limit
Date: Tue, 8 Dec 2015 12:56:50 -0500 [thread overview]
Message-ID: <566719E2.7040403@redhat.com> (raw)
In-Reply-To: <1446031696-19022-2-git-send-email-sagig@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 2468 bytes --]
On 10/28/2015 07:28 AM, Sagi Grimberg wrote:
> mlx4 devices (ConnectX-2, ConnectX-3) 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.
>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> Reviewed-by: Steve Wise <swise@opengridcomputing.com>
> ---
> drivers/infiniband/hw/mlx4/main.c | 2 +-
> include/linux/mlx4/device.h | 11 +++++++++++
> 2 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> index 7026580..e0232a2 100644
> --- a/drivers/infiniband/hw/mlx4/main.c
> +++ b/drivers/infiniband/hw/mlx4/main.c
> @@ -499,7 +499,7 @@ static int mlx4_ib_init_device_flags(struct ib_device *ibdev)
> ibdev->max_qp_wr = dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE;
> ibdev->max_sge = min(dev->dev->caps.max_sq_sg,
> dev->dev->caps.max_rq_sg);
> - ibdev->max_sge_rd = ibdev->max_sge;
> + ibdev->max_sge_rd = MLX4_MAX_SGE_RD;
> ibdev->max_cq = dev->dev->quotas.cq;
> ibdev->max_cqe = dev->dev->caps.max_cqes;
> ibdev->max_mr = dev->dev->quotas.mpt;
What code tree did you make this patch from? Because in an upstream 4.4
kernel, there is no function mlx4_ib_init_device_flags(), but there is
mlx4_ib_query_device() that does much the same thing. But in there,
there is no ibdev->max_sge_rd, there is props->max_sge_rd. It's like
this came from an entirely different source base somewhere.
> diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
> index dac6872..3dcae41 100644
> --- a/include/linux/mlx4/device.h
> +++ b/include/linux/mlx4/device.h
> @@ -427,6 +427,17 @@ enum {
> };
>
> 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)
> + */
> + MLX4_MAX_SGE_RD = (512 - 16 - 16) / 16
> +};
> +
> +enum {
> MLX4_DEV_PMC_SUBTYPE_GUID_INFO = 0x14,
> MLX4_DEV_PMC_SUBTYPE_PORT_INFO = 0x15,
> MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE = 0x16,
>
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
next prev parent reply other threads:[~2015-12-08 17:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 11:28 [PATCH v2 0/2] Handle mlx4 max_sge_rd correctly Sagi Grimberg
2015-10-28 11:28 ` [PATCH v2 1/2] mlx4: Expose correct max_sge_rd limit Sagi Grimberg
2015-12-08 17:56 ` Doug Ledford [this message]
[not found] ` <1446031696-19022-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-28 11:28 ` [PATCH v2 2/2] iser-target: Remove explicit mlx4 work-around Sagi Grimberg
2015-11-10 10:36 ` [PATCH v2 0/2] Handle mlx4 max_sge_rd correctly Sagi Grimberg
[not found] ` <5641C8BC.40507-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-03 14:27 ` Christoph Hellwig
[not found] ` <20151203142730.GA20520-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-03 15:07 ` Sagi Grimberg
2015-12-08 17:01 ` Christoph Hellwig
[not found] ` <20151208170139.GA425-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-08 17:58 ` Doug Ledford
2015-12-08 18:13 ` Sagi Grimberg
2015-12-08 18:17 ` Doug Ledford
[not found] ` <56671EB8.6010207-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-12-08 18:18 ` Doug Ledford
2015-12-09 9:33 ` Sagi Grimberg
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=566719E2.7040403@redhat.com \
--to=dledford@redhat.com \
--cc=linux-rdma@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=ogerlitz@mellanox.com \
--cc=sagig@mellanox.com \
--cc=swise@opengridcomputing.com \
--cc=target-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).