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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 BDA21C43381 for ; Mon, 25 Feb 2019 18:50:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8867F2087C for ; Mon, 25 Feb 2019 18:50:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="lydE8LP6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728475AbfBYSuR (ORCPT ); Mon, 25 Feb 2019 13:50:17 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38989 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbfBYSuR (ORCPT ); Mon, 25 Feb 2019 13:50:17 -0500 Received: by mail-pl1-f193.google.com with SMTP id b65so1879176plb.6 for ; Mon, 25 Feb 2019 10:50:16 -0800 (PST) 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=rYs1l4m3RsXsxuutqz9IHtO3NyxcqIs29okqxpyuB6s=; b=lydE8LP6oVR254lJBPv02r8MdlqPUye5wGCko5xBoVxSStItfWhpuM2dKWU2F8iY1i EAUuvSKsyTtKP1AYZS/m7nmySnJbHe9aXLFg/V5ey9ZKnMWwNC2tdNEDauPfT7uj3RAJ syOvur0xVGsTu3uU0gcr/5/u2FATgMKBwZJQv9uzQ6ncg2pY2yJ+uMhKVORaEbYcro9w UGnZHD4MoIOUYr8cQqdOwO6aJktoVCFq8smiXbKFeZ1O1LbGpDpDkTuEoZreR63XFJGg vF/W17Z6+5L8U0nJU1Mx9t9EnIGLCayQ4o2t/WJBO7vKPtZZMyOstkUjwcxpQtgXJch3 xFNQ== 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=rYs1l4m3RsXsxuutqz9IHtO3NyxcqIs29okqxpyuB6s=; b=he1T3FotMpi3KFyXSm+QNpzUVdlCCZZTPDZ1R+5ARVcXshrS0XipiYMd/ltqAquvhk 9bc96eMhbFxoCe42Zz4b4K4dlPyoR07hr5NYGOCXKOy53oluSIG60Oby44MhnldmNgxv 7AM33M4R09iZVBy+pThjwYoKQIq1+VPXrCiGupcqQGpXeaAJpPJ+MhP5UGp1D2pZO5YZ qb+fgEjg6Sug6hDYZG4W6lcDHgxSjCMy8gsE2O0BJ/8xM0EWwjd/WzX7QFOF3cVQPaex 0d+oMhz1Tl2VwyazfxIebRFbVDtqLH3J/fSciaAmRkB+dqleVhx6rnNuUQML/TCP1rhf 980Q== X-Gm-Message-State: AHQUAuZuWsto48k0IPAEY0SDj6bmUlkMEP28ZBjuGr+7aV/9PboDykhD rynYCtR8vtnzvlibXAlV0hjunQ== X-Google-Smtp-Source: AHgI3IYpByHeDAuEsaaA9KAWrXHSNyvx7/9aYgCd6Gs7EuVboLcKF9lbcWw7vjrlzwLYhg6TTYcLrA== X-Received: by 2002:a17:902:1a9:: with SMTP id b38mr9945956plb.37.1551120616473; Mon, 25 Feb 2019 10:50:16 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id 64sm15029429pfe.143.2019.02.25.10.50.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 10:50:15 -0800 (PST) Received: from jgg by jggl.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gyLKR-0005mj-7Z; Mon, 25 Feb 2019 11:50:15 -0700 Date: Mon, 25 Feb 2019 11:50:15 -0700 From: Jason Gunthorpe To: Gal Pressman Cc: Shiraz Saleem , dledford@redhat.com, davem@davemloft.net, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, mustafa.ismail@intel.com, jeffrey.t.kirsher@intel.com, Yossi Leybovich Subject: Re: [RFC v1 12/19] RDMA/irdma: Implement device supported verb APIs Message-ID: <20190225185015.GD21863@ziepe.ca> References: <20190215171107.6464-1-shiraz.saleem@intel.com> <20190215171107.6464-13-shiraz.saleem@intel.com> <01b0d571-81d8-ed6c-77b7-e83ee0ab9caa@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01b0d571-81d8-ed6c-77b7-e83ee0ab9caa@amazon.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Feb 24, 2019 at 04:35:02PM +0200, Gal Pressman wrote: > > +/**> + * irdma_disassociate_ucontext - Disassociate user context> + * @context: ib user context> + */> +static void irdma_disassociate_ucontext(struct ib_ucontext *context) > > +{ > > +} > > What's the motivation for a nop callback (over not implementing the > function)? This is my fault, I didn't finish yet and conver disassociate_ucontext into a flags once they were all made empty. > > + ret = irdma_alloc_rsrc(iwdev->rf, > > + iwdev->rf->allocated_mrs, iwdev->rf->max_mr, > > + &stag_index, &next_stag_index); > > + if (!ret) { > > + stag = stag_index << IRDMA_CQPSQ_STAG_IDX_S; > > + stag |= driver_key; > > + stag += (u32)consumer_key; > > + irdma_add_devusecount(iwdev); > > + } > > This is confusing IMHO, better to test for 'if (ret)' and keep the main flow > unindented. Yes please follow the standard 'success oriented flow' Jason