Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4356688pxv; Tue, 20 Jul 2021 01:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhtN3+2BZOfdIDeEsJl8Gw4wpoeDilAsDlaKquq3ZNkUTdfMC5tX7h9Kae6M10Ij4NCcOl X-Received: by 2002:a5d:8c9a:: with SMTP id g26mr22183275ion.121.1626770217306; Tue, 20 Jul 2021 01:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626770217; cv=none; d=google.com; s=arc-20160816; b=qsYNhgIvr8G6Y4tuBvprwFQJ/dZsqzPT2u+qTjGF4Z/GAwuo1oynHTGPXhQS3CYf7L 44ObJwnTdnE/JN4aySvXrbykCi2DlcDjU1nyuC2Qm58X1ytZ4p+TtZ/Mvz+f1kpdGBnb mr427fcB/Ukvq7BCV75ZoSMtVq7OV6wX13O7jAKnXcPpKVY7Ily7io6BciA4dbhrv/81 uY0pPHeeEsZstbLWpWulA+r4qFRSLLB+HdToB+tIbspOHoP2H1FXDQ8mZpMNlTRBI1J5 kvZV7E+XtdGOFAE/hdMSuAWoimtg18iIjr6UevTwQvaRYD+InDHVEER2aksPVLL603E0 IwfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mRhKokM+SDsWQer/dc+KaTRUwL5TcSeHuzf7J2WbRrI=; b=LVQWre5dNwWizsECmgIAQwHxneVIALFfjHpC3VveYOu+FJ9Qr1twBFUut62jXuZh1C miBxIHhuE7SzezrRRv/+z9+R6E+mbftKq5pGp5bjltkrW1HzBaorh2bvDKjBW9cBEGso 6kk1hafbCBNX19Y6s0vssKgfB1/kYG09kri6rlZtG/aGP8VLx/JO7w3ulgtNy0bmmFZJ SOWbYoWzyNATMLeDbXlHvZrbO+KeyJWcdsEW8H/IZP0lvwGoydltmIzEQt8FaiqtXiVz 37it3Ugw8308uj3Ipmd6Eo/OQnDcZOJHaii5iuL46HU04o1afxEdkVWBp+12AnNpOuHj iH8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cxxH0ysL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 7si25208734ilx.20.2021.07.20.01.36.46; Tue, 20 Jul 2021 01:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cxxH0ysL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234445AbhGTHzL (ORCPT + 99 others); Tue, 20 Jul 2021 03:55:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:58918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234420AbhGTHyc (ORCPT ); Tue, 20 Jul 2021 03:54:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CFB3C611EF; Tue, 20 Jul 2021 08:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626770110; bh=vNxMCTznwpbJiAUJa7hf9jYlEIb/HWnfH0bHXTkY6mk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cxxH0ysLvCEQiQ21zHOTlgwbCv5MDJ+DAr1Bbx32hRq4sMs1LTyxXil2sAq6EUeFM xGo92BzY3o3I3dHibAv//UeZ0j5HmSgeXpP36InStUXHZt+sVpCCzoLOKaZx6SU2L9 WRmUwlTFuALS/7+agLOpSxEwi9IH4pTum4u/t4PybjNeJ70Urd7JhTwn5WN1JceF9D RbUs3luPZLKFFoxPn5bpqd3VdCui+8mYoWFB2YYGczwhbEnwe99R/Dc5UuYdZ93CUQ GvAo6SpYTrBwqN26i1SNjFjU5EuwhKlLAe7RhHvv9doVjedJFobezj2hWFWv/9Z3ZB KmKJl3zWs7m9w== Date: Tue, 20 Jul 2021 11:35:07 +0300 From: Leon Romanovsky To: Gal Pressman Cc: Doug Ledford , Jason Gunthorpe , Adit Ranadive , Ariel Elior , Bernard Metzler , Christian Benvenuti , Dennis Dalessandro , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Michal Kalderon , Mike Marciniszyn , Mustafa Ismail , Naresh Kumar PBS , Nelson Escobar , Potnuri Bharat Teja , Selvin Xavier , Shiraz Saleem , Steve Wise , VMware PV-Drivers , Weihang Li , Wenpeng Liang , Yishai Hadas , Zhu Yanjun Subject: Re: [PATCH rdma-next 8/9] RDMA: Globally allocate and release QP memory Message-ID: References: <5b3bff16da4b6f925c872594262cd8ed72b301cd.1626609283.git.leonro@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 04:42:11PM +0300, Gal Pressman wrote: > On 18/07/2021 15:00, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > Convert QP object to follow IB/core general allocation scheme. > > That change allows us to make sure that restrack properly kref > > the memory. > > > > Signed-off-by: Leon Romanovsky > > EFA and core parts look good to me. > Reviewed-by: Gal Pressman > Tested-by: Gal Pressman Thanks a lot. > > > +static inline void *rdma_zalloc_obj(struct ib_device *dev, size_t size, > > + gfp_t gfp, bool is_numa_aware) > > +{ > > + if (is_numa_aware && dev->ops.get_numa_node) > > Honestly I think it's better to return an error if a numa aware allocation is > requested and get_numa_node is not provided. We don't want any driver to use and implement ".get_numa_node()" callback. Initially, I thought about adding WARN_ON(driver_id != HFI && .get_numa_node) to the device.c, but decided to stay with comment in ib_verbs.h only. > > > + return kzalloc_node(size, gfp, dev->ops.get_numa_node(dev)); > > + > > + return kzalloc(size, gfp); > > +}