public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.org
Subject: Re: [PATCH] vmw_pvrdma: Avoid rounding up of sge count to power of 2
Date: Fri, 16 Feb 2018 10:27:02 -0800	[thread overview]
Message-ID: <7a727517-7f46-e691-4547-b253acf48545@vmware.com> (raw)
In-Reply-To: <20180216072216.GK2197-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>

On 2/15/18 11:22 PM, Leon Romanovsky wrote:
> On Thu, Feb 15, 2018 at 04:39:52PM -0800, Adit Ranadive wrote:
>> Creation of resources can fail if the rounding up exceeds
>> provider supported values.
>>
>> Fixes: 4c8ed14eb6b7 ("vmw_pvrdma: Add SRQ support")
>> Reviewed-by: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>> Reviewed-by: Nitish Bhat <bnitish-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>> Signed-off-by: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>> Cc: stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.org
>> ---
>>  providers/vmw_pvrdma/qp.c | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/providers/vmw_pvrdma/qp.c b/providers/vmw_pvrdma/qp.c
>> index efcc99b..4b9f897 100644
>> --- a/providers/vmw_pvrdma/qp.c
>> +++ b/providers/vmw_pvrdma/qp.c
>> @@ -113,7 +113,7 @@ struct ibv_srq *pvrdma_create_srq(struct ibv_pd *pd,
>>  	int ret;
>>
>>  	attr->attr.max_wr = align_next_power2(max_t(uint32_t, 1U, attr->attr.max_wr));
>> -	attr->attr.max_sge = align_next_power2(max_t(uint32_t, 1U, attr->attr.max_sge));
>> +	attr->attr.max_sge = max_t(uint32_t, 1U, attr->attr.max_sge);
> 
> One of two: or your commit message is not correct and you should mention
> that align_next_power2() is not needed, or your code is incorrect,
> because user can provide large enough number and this call will fail
> anyway.

Sorry, that's a terrible commit message. Yeah the align_next_power2 is extraneous.
Will send v1 out with updated message.
--
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:[~2018-02-16 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  0:39 [PATCH] vmw_pvrdma: Avoid rounding up of sge count to power of 2 Adit Ranadive
     [not found] ` <1518741592-12723-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2018-02-16  7:22   ` Leon Romanovsky
     [not found]     ` <20180216072216.GK2197-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-02-16 18:27       ` Adit Ranadive [this message]
2018-02-16 16:15   ` Jason Gunthorpe
     [not found]     ` <20180216161526.GC22739-uk2M96/98Pc@public.gmane.org>
2018-02-16 17:18       ` Leon Romanovsky

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=7a727517-7f46-e691-4547-b253acf48545@vmware.com \
    --to=aditr-pghwnbhtmq7qt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stable-Xl5UnYtxxKxKUA01WzcqbQ@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