Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1100218imu; Wed, 23 Jan 2019 10:44:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN7YQ4PP3ngiTfdba2fqD613NZ1d4gofZn/WiZrYKxsBEOBaYyO4+JrASMsEFDi1M3x301fW X-Received: by 2002:a63:451a:: with SMTP id s26mr3066965pga.150.1548269065227; Wed, 23 Jan 2019 10:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548269065; cv=none; d=google.com; s=arc-20160816; b=ZKdAANYjwf6jVWK/ogF/VFYQh04Cn2qTZOuCiDecZ3M02FpDmK5ocWAkslTlc/Iqtg TQxnwrJna4qST+732ZOqty5d0sNg5fgTqzzb1/XWktb46/WCNwtKrf4iRF49MZ+9tQXz fwHAvLRzfN14QmpwCE1Uq9mYzaIpWbSjCahhw0iFGG7gm010M1Qk/zqrqPiSvwxwo9JT aJMdwXJsFOI9aIKx84JRLZ+IuiFTR2dpP4rgqO6SBVt2VPE3q6otnktqffNRyjJDbNGf ctmd+2UzQ2PfQ3P6pdGdfkKH4sxfA91WwLfIZasKBM0TGINIrUde37htBYsO5vC0qFd5 VxRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to; bh=uUNHcJHU0J5gx1WP0aS/r/o0UnndDQZsuS8WzVA7RBY=; b=v8s+Oi8RTYe1RaQb0ulW10NmZUDQzKDVnW3IsMtCdRbJ4wP0aE0uY7ZB8yoS8VzYgo YuLJbARM7E16tccTTRVW//Mc+szO/CeEcb93e1zADjMZnKjYLw8oPgXWFTC8zV5Jc4SO wiPy5vimdY6ARIGZnBHLvc0iclXS5cXrf4x40xP5zZOIzGJfJf5xGpG/poCWbJxl69Q5 YYPmJwqORDY7QZiOV8sbz85Ruci2iBCij7xk+MXUqfdONTglce9T2+u72p9uorKb4Yhk 6b/IAqTl27q4NIfckjiMwIDiVm8KkOM8fqP7n68U5SeMJzgIlSodifZf7aCm8X/I1ws/ pIJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12si19591180pgb.402.2019.01.23.10.44.08; Wed, 23 Jan 2019 10:44:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726167AbfAWSnM (ORCPT + 99 others); Wed, 23 Jan 2019 13:43:12 -0500 Received: from opengridcomputing.com ([72.48.214.68]:50792 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbfAWSnM (ORCPT ); Wed, 23 Jan 2019 13:43:12 -0500 Received: from [10.10.0.239] (cody.ogc.int [10.10.0.239]) by smtp.opengridcomputing.com (Postfix) with ESMTPSA id 956F621EC0; Wed, 23 Jan 2019 12:43:11 -0600 (CST) Reply-To: swise@chelsio.com Subject: Re: [PATCH RFC] iw_cxgb4: drop check - dead code To: Jason Gunthorpe , Nicholas Mc Guire Cc: Doug Ledford , Raju Rangoju , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <1547947633-10515-1-git-send-email-hofrat@osadl.org> <20190123183008.GA15698@ziepe.ca> From: Steve Wise Message-ID: <762bd516-b357-fb51-510e-ccce6215e281@chelsio.com> Date: Wed, 23 Jan 2019 12:43:15 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190123183008.GA15698@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/23/2019 12:30 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 >> Fixes: 6a0b6174d35a ("rdma/cxgb4: Add support for kernel mode SRQ's") >> --- > > Steve? It seems weird to have NOFAIL and then have an error unwind > path, what is the deal here? > >> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c >> index 917ce5c..c2a12ba 100644 >> --- a/drivers/infiniband/hw/cxgb4/qp.c >> +++ b/drivers/infiniband/hw/cxgb4/qp.c >> @@ -2597,8 +2597,6 @@ static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx, >> wr_len = sizeof(*res_wr) + sizeof(*res); >> >> skb = alloc_skb(wr_len, GFP_KERNEL | __GFP_NOFAIL); >> - if (!skb) >> - goto err_free_queue; >> set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0); >> >> res_wr = (struct fw_ri_res_wr *)__skb_put(skb, wr_len); >> -- >> 2.1.4 >> The other queue allocations in qp.c don't use __GFP_NOFAIL. So either leave it and remove the error check as per this patch, or remove the NOFAIL and leave the check. I suggest you remove the __GFP_NOFAIL. Steve.