From: Steve Wise <swise@opengridcomputing.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Nicholas Mc Guire <hofrat@osadl.org>
Cc: Doug Ledford <dledford@redhat.com>,
Raju Rangoju <rajur@chelsio.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] iw_cxgb4: drop check - dead code
Date: Wed, 23 Jan 2019 15:48:15 -0600 [thread overview]
Message-ID: <6493ca88-32d8-0ad7-51b5-06e011506a37@opengridcomputing.com> (raw)
In-Reply-To: <20190123214415.GA20648@ziepe.ca>
On 1/23/2019 3:44 PM, Jason Gunthorpe wrote:
> On Sun, Jan 20, 2019 at 02:27:13AM +0100, Nicholas Mc Guire wrote:
>> The kmalloc is called with | __GFP_NOFAIL so there is no point in
>> checking the return value - it either returns valid storage or it would
>> hang/terminate there. But it is not possible to say if the use of
>> __GFP_NOFAIL is really needed and the check should be removed or
>> vice-versa (use of __GFP_NOFAIL should be only in exceptional
>> cases as I understand it and alloc_srq_queue() is called in quite
>> a few places)
>> In either way it would need fixing.
>>
>> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
>> Fixes: 6a0b6174d35a ("rdma/cxgb4: Add support for kernel mode SRQ's")
>> ---
>
> As per steve's remarkes I revised this to the below and applied it to
> for-next
>
>>From 4b2d4262ee2ea58df867de1928bf208795344432 Mon Sep 17 00:00:00 2001
> From: Jason Gunthorpe <jgg@mellanox.com>
> Date: Sun, 20 Jan 2019 02:27:13 +0100
> Subject: [PATCH] RDMA/iw_cxgb4: Drop __GFP_NOFAIL
>
> There is no reason for this __GFP_NOFAIL, none of the other routines in
> this file use it, and there is an error unwind here. NOFAIL should be
> reserved for special cases, not used by network drivers.
>
> Fixes: 6a0b6174d35a ("rdma/cxgb4: Add support for kernel mode SRQ's")
> Reported-by: Nicholas Mc Guire <hofrat@osadl.org>
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> ---
> drivers/infiniband/hw/cxgb4/qp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index 03f4c66c265946..c00a4114412694 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -2597,7 +2597,7 @@ static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx,
> /* build fw_ri_res_wr */
> wr_len = sizeof(*res_wr) + sizeof(*res);
>
> - skb = alloc_skb(wr_len, GFP_KERNEL | __GFP_NOFAIL);
> + skb = alloc_skb(wr_len, GFP_KERNEL);
> if (!skb)
> goto err_free_queue;
> set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
>
Thanks Jason!
prev parent reply other threads:[~2019-01-23 21:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-20 1:27 [PATCH RFC] iw_cxgb4: drop check - dead code Nicholas Mc Guire
2019-01-21 2:05 ` Jason Gunthorpe
2019-01-23 18:30 ` Jason Gunthorpe
2019-01-23 18:43 ` Steve Wise
2019-01-23 18:45 ` Steve Wise
2019-01-24 1:53 ` Nicholas Mc Guire
2019-01-23 21:44 ` Jason Gunthorpe
2019-01-23 21:48 ` Steve Wise [this message]
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=6493ca88-32d8-0ad7-51b5-06e011506a37@opengridcomputing.com \
--to=swise@opengridcomputing.com \
--cc=dledford@redhat.com \
--cc=hofrat@osadl.org \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=rajur@chelsio.com \
/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