From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D33BC433E0 for ; Mon, 1 Jun 2020 12:27:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E224207BC for ; Mon, 1 Jun 2020 12:27:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="iy+gJs/u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726133AbgFAM10 (ORCPT ); Mon, 1 Jun 2020 08:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbgFAM1Z (ORCPT ); Mon, 1 Jun 2020 08:27:25 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214F1C061A0E for ; Mon, 1 Jun 2020 05:27:25 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id w1so8776167qkw.5 for ; Mon, 01 Jun 2020 05:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PKVdNwhkp7XsfYsgOqc49jOrL5d1+RDMlh1791f6yRY=; b=iy+gJs/uZZBIe8fICOF2ugnxZ9qIHKiwm+R3k074+kDaSKC0+LW0fIkO/+T/Xo2dZ3 PHM4G+5w8oLLS7J2RqsTv1r0F8SrWs6Tqwr1RqHUBQqYKhWQ4m3FoAQKSLtyYiwJ/9wr vpudvsBzBzttfJTkIraknWe43pZ+MOXX341ObdBAye1cXqgGWPdeNO6Rc7Khax0Zbitt QZOrPIAGor/9NcQS9Xt651wqc78mGY4jIdSp57scD/SXtTemBNrhWHDwVBzRGsTo5Wyr SEQQrUncdzk+MAQt496LZThit+ilNEHBWcfoBc6aifEL6D0KYY2SvUrB+WwDkboszH/i n6Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PKVdNwhkp7XsfYsgOqc49jOrL5d1+RDMlh1791f6yRY=; b=iplxDJKp2+CiKdi5nG4RJCXOQHpiYr67TGyvK5HifS/ljk/oYAkb2zCe5I7ZwfmowQ 6nG2x+KIA5xsJbSIpAND0MTKKgfReX4CYA5yfDAw5V7y/TsCPUB1/6B2h9/utfx+jKaP X09jiuhtvHvEUPGR8Wl7fMtB3TKrFM0Bfh07kWtR6tC/iTbGj5CX4BDbxqc2V8GTWafi 7208F4CAwPgoIqYY8iV9zkafv6P7gHRfCzj8yWEw0dx1s0gKpCTh9FraFdpje73cs9qB WUL1IwE2NIRbc6yH7/7qAVyO6vhSBaoEV/mjG1lAuXueLW/HxuWmdsYVZiF/wRzP10XP 4zRg== X-Gm-Message-State: AOAM532WtvqAUq4rwr6FvKAdwDZPxfuunXyNOM+V4A7TRYvK/PzoVrkK dsKJWXPsG8erczdmMwi5EkhZ39DcSGI= X-Google-Smtp-Source: ABdhPJzBcvuaFvFWy86YzAUof85bQx0g1z7uniGfW2txq+d6j+CNtyXWTb+BcNpPQlLegs6BdE/2XA== X-Received: by 2002:a37:9c91:: with SMTP id f139mr20445965qke.371.1591014444227; Mon, 01 Jun 2020 05:27:24 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id n13sm16852613qtb.20.2020.06.01.05.27.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jun 2020 05:27:23 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jfjXH-0002V7-EH; Mon, 01 Jun 2020 09:27:23 -0300 Date: Mon, 1 Jun 2020 09:27:23 -0300 From: Jason Gunthorpe To: Leon Romanovsky Cc: Dan Carpenter , Mike Marciniszyn , Grzegorz Andrejczuk , Dennis Dalessandro , Doug Ledford , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v2] IB/hfi1: Fix hfi1_netdev_rx_init() error handling Message-ID: <20200601122723.GB4872@ziepe.ca> References: <20200530140224.GA1330098@mwanda> <20200531100512.GH66309@unreal> <20200531173655.GT22511@kadam> <20200601042433.GA34024@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200601042433.GA34024@unreal> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Jun 01, 2020 at 07:24:33AM +0300, Leon Romanovsky wrote: > On Sun, May 31, 2020 at 08:36:55PM +0300, Dan Carpenter wrote: > > On Sun, May 31, 2020 at 01:05:12PM +0300, Leon Romanovsky wrote: > > > On Sat, May 30, 2020 at 05:02:24PM +0300, Dan Carpenter wrote: > > > > The hfi1_vnic_up() function doesn't check whether hfi1_netdev_rx_init() > > > > returns errors. In hfi1_vnic_init() we need to change the code to > > > > preserve the error code instead of returning success. > > > > > > > > Fixes: 2280740f01ae ("IB/hfi1: Virtual Network Interface Controller (VNIC) HW support") > > > > Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") > > > > Signed-off-by: Dan Carpenter > > > > v2: Add error handling in hfi1_vnic_up() and add second fixes tag > > > > > > > > drivers/infiniband/hw/hfi1/vnic_main.c | 11 +++++++++-- > > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/infiniband/hw/hfi1/vnic_main.c b/drivers/infiniband/hw/hfi1/vnic_main.c > > > > index b183c56b7b6a4..03f8be8e9488e 100644 > > > > +++ b/drivers/infiniband/hw/hfi1/vnic_main.c > > > > @@ -457,13 +457,19 @@ static int hfi1_vnic_up(struct hfi1_vnic_vport_info *vinfo) > > > > if (rc < 0) > > > > return rc; > > > > > > > > - hfi1_netdev_rx_init(dd); > > > > + rc = hfi1_netdev_rx_init(dd); > > > > + if (rc < 0) > > > > + goto err_remove; > > > > > > Why did you check for the negative value here and didn't check below? > > > > > > > I just copied the pattern in the nearest code. I didn't realize until > > now that it was different in both functions... The checking isn't done > > consistently in this file. > > > > I can resend on Tuesday though if you want. > > I imagine that Jason will fix it once he will apply the patch. If someone from hfi says which is the right one, sure.. Jason From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Date: Mon, 01 Jun 2020 12:27:23 +0000 Subject: Re: [PATCH v2] IB/hfi1: Fix hfi1_netdev_rx_init() error handling Message-Id: <20200601122723.GB4872@ziepe.ca> List-Id: References: <20200530140224.GA1330098@mwanda> <20200531100512.GH66309@unreal> <20200531173655.GT22511@kadam> <20200601042433.GA34024@unreal> In-Reply-To: <20200601042433.GA34024@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Leon Romanovsky Cc: Dan Carpenter , Mike Marciniszyn , Grzegorz Andrejczuk , Dennis Dalessandro , Doug Ledford , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org On Mon, Jun 01, 2020 at 07:24:33AM +0300, Leon Romanovsky wrote: > On Sun, May 31, 2020 at 08:36:55PM +0300, Dan Carpenter wrote: > > On Sun, May 31, 2020 at 01:05:12PM +0300, Leon Romanovsky wrote: > > > On Sat, May 30, 2020 at 05:02:24PM +0300, Dan Carpenter wrote: > > > > The hfi1_vnic_up() function doesn't check whether hfi1_netdev_rx_init() > > > > returns errors. In hfi1_vnic_init() we need to change the code to > > > > preserve the error code instead of returning success. > > > > > > > > Fixes: 2280740f01ae ("IB/hfi1: Virtual Network Interface Controller (VNIC) HW support") > > > > Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") > > > > Signed-off-by: Dan Carpenter > > > > v2: Add error handling in hfi1_vnic_up() and add second fixes tag > > > > > > > > drivers/infiniband/hw/hfi1/vnic_main.c | 11 +++++++++-- > > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/infiniband/hw/hfi1/vnic_main.c b/drivers/infiniband/hw/hfi1/vnic_main.c > > > > index b183c56b7b6a4..03f8be8e9488e 100644 > > > > +++ b/drivers/infiniband/hw/hfi1/vnic_main.c > > > > @@ -457,13 +457,19 @@ static int hfi1_vnic_up(struct hfi1_vnic_vport_info *vinfo) > > > > if (rc < 0) > > > > return rc; > > > > > > > > - hfi1_netdev_rx_init(dd); > > > > + rc = hfi1_netdev_rx_init(dd); > > > > + if (rc < 0) > > > > + goto err_remove; > > > > > > Why did you check for the negative value here and didn't check below? > > > > > > > I just copied the pattern in the nearest code. I didn't realize until > > now that it was different in both functions... The checking isn't done > > consistently in this file. > > > > I can resend on Tuesday though if you want. > > I imagine that Jason will fix it once he will apply the patch. If someone from hfi says which is the right one, sure.. Jason