All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH] mlx5: Expose correct page_size_cap in device attributes
Date: Thu, 23 Jul 2015 17:41:38 -0400	[thread overview]
Message-ID: <55B15F92.6070604@redhat.com> (raw)
In-Reply-To: <1437478812-9650-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

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

On 07/21/2015 07:40 AM, Sagi Grimberg wrote:
> Should be all the page sizes that are supported by the
> device.
> 
> Reported-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> Signed-off-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/main.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 725f857..a90ef7a 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -212,6 +212,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>  	int err = -ENOMEM;
>  	int max_rq_sg;
>  	int max_sq_sg;
> +	u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
>  
>  	if (uhw->inlen || uhw->outlen)
>  		return -EINVAL;
> @@ -264,7 +265,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>  	props->hw_ver		   = mdev->pdev->revision;
>  
>  	props->max_mr_size	   = ~0ull;
> -	props->page_size_cap	   = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
> +	props->page_size_cap	   = ~(min_page_size - 1);
>  	props->max_qp		   = 1 << MLX5_CAP_GEN(mdev, log_max_qp);
>  	props->max_qp_wr	   = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz);
>  	max_rq_sg =  MLX5_CAP_GEN(mdev, max_wqe_sz_rq) /
> 

I assume this prevents the driver from working at all on certain arches
(like ppc with 64k page size)?  It looks obviously correct enough that
I've picked it up for 4.2-rc.  Thanks.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  parent reply	other threads:[~2015-07-23 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 11:40 [PATCH] mlx5: Expose correct page_size_cap in device attributes Sagi Grimberg
     [not found] ` <1437478812-9650-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-21 16:32   ` Jason Gunthorpe
2015-07-23 21:41   ` Doug Ledford [this message]
     [not found]     ` <55B15F92.6070604-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-23 21:48       ` Jason Gunthorpe
     [not found]         ` <20150723214832.GA16756-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-24 14:34           ` Doug Ledford
2015-07-26 11:02           ` 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=55B15F92.6070604@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sagig-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 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.