Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sebastien dugue <sebastien.dugue-6ktuUTfB/bM@public.gmane.org>
To: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-next 3/6] IB/mlx4: Fix parameter checking in create_cq
Date: Fri, 11 May 2012 09:10:08 +0200	[thread overview]
Message-ID: <20120511091008.40d1dc3d@b012350-ux> (raw)
In-Reply-To: <1336681689-16668-4-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>


Hi,

On Thu, 10 May 2012 23:28:06 +0300
Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:

> From: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Round up the number of entries before checking against the device's
> capabilities and not after that.
> 
> Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/cq.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
> index f69ccd2..222a06c 100644
> --- a/drivers/infiniband/hw/mlx4/cq.c
> +++ b/drivers/infiniband/hw/mlx4/cq.c
> @@ -172,6 +172,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, int entries, int vector
>  	struct mlx4_uar *uar;
>  	int err;
>  
> +	entries      = roundup_pow_of_two(entries + 1);
>  	if (entries < 1 || entries > dev->dev->caps.max_cqes)

  Is the first check still needed here then?


  Sébastien.


>  		return ERR_PTR(-EINVAL);
>  
> @@ -179,7 +180,6 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, int entries, int vector
>  	if (!cq)
>  		return ERR_PTR(-ENOMEM);
>  
> -	entries      = roundup_pow_of_two(entries + 1);
>  	cq->ibcq.cqe = entries - 1;
>  	mutex_init(&cq->resize_mutex);
>  	spin_lock_init(&cq->lock);
--
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:[~2012-05-11  7:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 20:28 [PATCH for-next 0/6] IB: 2nd batch of fixes for 3.5 Or Gerlitz
     [not found] ` <1336681689-16668-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-10 20:28   ` [PATCH for-next V1 1/6] net/mlx4_core: Change bitmap allocator to work in round-robin fashion Or Gerlitz
     [not found]     ` <1336681689-16668-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-14 20:44       ` Roland Dreier
2012-05-10 20:28   ` [PATCH for-next 2/6] IB/core: fix mismatch between locked and pinned pages Or Gerlitz
     [not found]     ` <1336681689-16668-3-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-10 20:38       ` Christoph Lameter
2012-05-11 17:06       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.00.1205111205530.31049-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2012-05-11 18:38           ` Roland Dreier
     [not found]             ` <CAL1RGDWVQuhSWkK1qK98Ar6YrsL02_m9kkAY4pDFaCqhMyHKiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-13  7:11               ` Or Gerlitz
2012-05-10 20:28   ` [PATCH for-next 3/6] IB/mlx4: Fix parameter checking in create_cq Or Gerlitz
     [not found]     ` <1336681689-16668-4-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-11  7:10       ` sebastien dugue [this message]
2012-05-11  7:39         ` Or Gerlitz
     [not found]           ` <CAJZOPZLYp87tgMOBmaJGA4VqdH_t6=jAVr1o=Q7RJuVYZNethw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-11  8:15             ` sebastien dugue
2012-05-10 20:28   ` [PATCH for-next 4/6] IB/core: Fix IB_SA_COMP_MASK macro Or Gerlitz
     [not found]     ` <1336681689-16668-5-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-19  0:16       ` Roland Dreier
2012-05-10 20:28   ` [PATCH for-next 5/6] net/mlx4: Adjust initial value of vl_cap in mlx4_SET_PORT Or Gerlitz
     [not found]     ` <1336681689-16668-6-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-19  0:40       ` Roland Dreier
     [not found]         ` <CAL1RGDUjNrRnU2_cfbdJd790K9oLD+rRFQDOyR6eX-3R1tWbQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-20 11:21           ` Or Gerlitz
     [not found]             ` <4FB8D3C0.7040603-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-21 16:14               ` Roland Dreier
2012-05-21 10:15           ` Or Gerlitz
2012-05-10 20:28   ` [PATCH for-next 6/6] IB/mlx4: bug fix for mlx4_ib_add error flow Or Gerlitz
     [not found]     ` <1336681689-16668-7-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-19  0:45       ` Roland Dreier

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=20120511091008.40d1dc3d@b012350-ux \
    --to=sebastien.dugue-6ktuutfb/bm@public.gmane.org \
    --cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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