From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796328416; b=CuBx385tbDHomih+Zbcv+THeM+a8IrlI/UXPTFlRNv1S8ZuyxSAw+WBLv8vC1eA+tGCJ Hw37/ErbjPqRq3M4mjiBpLZASMPHMKXw3S06uW0O73TUTSKmcD9YoHhIftdukNbCp7Lnn ZWLakbojSxllMaqNpcWvjlW8TK8+3rraEDnir+wtgHJ9Hh2x1vFCbF+/7ePrDxqrmhgUG +Rguofb/Q4s51eBVrvJ6ID92mf3pAOzli/g0k/OxqQFYXIFhnyDE0vflP9gGijAUdrwev 7TfxtKfEp5Q6/c6f3hgqsDGGZ8bz7UjqIeBy9BRn3JIWBV4W1yJpKa+PxFfAw07EO9g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796328416; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=SSaXZDSO24dmFTsEJ1ZWmfs56fOwbwkPMfo+00WZbsA=; b=TVJMtlUZCSem5A0Vw20AlG+Bwy6RbUebhsanrr1YdMzGs94xttHynAKf5tFKEXTENTfN ZiBOp4P20dtpWKoicMzZB1zXKFmqFSLE12My9RrJen9C8eHIMGHUcxKWNfyk1oV/jTofR 3OUu7yHs5tqxSthixWiVfUhJoLbEZTTvyyZgV+3UMTh2rDQ+4cGgcnmL6Dwrvcb+rRXtw GxWMFFC/qbHndlSsCGESshQHgRY7u1YPTbjmRZw2MxB1f0ovk5qAo+L/fOZwRfXE/qb9L RE5rCHLnQ2hi2bE9JGZJyEaFJVfgYJ+XJJkKR/RCXl4YEfQ0QOeQpnd6CSLvbY0bQRQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=joWcfap6; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE03B606A32C; Thu, 3 Dec 2026 20:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=joWcfap6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D50E11F000C2; Thu, 3 Dec 2026 20:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796328415; bh=SSaXZDSO24dmFTsEJ1ZWmfs56fOwbwkPMfo+00WZbsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=joWcfap6pK3susPbiezMtPvHIV04xa3ovThAlW/MqmC8nBpL78OdVGXJbON4uP2Xd fn3Sp9h1sDz6SJTKfstq0SEuf6P9AF87BprFRcJ8TBmAhY5pslf0gsQWP527PA74Wd fvnJLuZmGN8TUrxFn30aYlOsMZtp8ctV1KBblagycjG9b5bqsQK3vZrOwLLpPkXoKR ZKpGCffepcLHx7d3Mj1u1HiqWAS3/sbzNfFmhPfdUV/WPlug2FGpBTB7HNSPdsbC3H 13xmbZgpCA+/iYwmTWnsQcsGeIv1gzV1lrxAj0d8BjFMBE7Qqy/xR0EUYIrQ1agdox 9JhjNYA3mO9TA== Date: Thu, 3 Dec 2026 22:06:52 +0200 From: Leon Romanovsky To: Yanze Zhang Cc: jgg@ziepe.ca, julianbraha@gmail.com, huangjunxian6@hisilicon.com, yanjun.zhu@linux.dev, Markus.Elfring@web.de, lkp@intel.com, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, wei.quan@zte.com.cn, han.junyang@zte.com.cn, ran.ming@zte.com.cn, han.chengfei@zte.com.cn Subject: Re: [PATCH rdma v10 7/7] RDMA/zrdma: Implement context, PD, and mmap operations Message-ID: <20261203200652.GA31440@unreal> References: <20261203124928.48716-1-zhang.yanze@zte.com.cn> <20261203124928.48716-8-zhang.yanze@zte.com.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203124928.48716-8-zhang.yanze@zte.com.cn> On Thu, Dec 03, 2026 at 08:49:28PM +0800, Yanze Zhang wrote: > Add implementation for allocation/deallocation of Protection Domains (PD), > User Contexts, and memory mapping (mmap) for doorbells. > > The SRQ doorbell area is not page aligned on 16K and 64K page systems, so > the mapping length is extended to the page boundary and the size > reported to userspace is the very same length. The V1 and V2 contexts do > not know the size of the SRQ doorbell area, so only the first page is > mapped for them. > > Signed-off-by: Yanze Zhang > --- > drivers/infiniband/hw/zrdma/zrdma_verbs.c | 351 ++++++++++++++++++++++ > 1 file changed, 351 insertions(+) <...> > + if (err) { > + pr_warn_ratelimited("zrdma: PD allocation failed err=%d\n", > + err); > + return err; > + } > + > + sc_pd = &zpd->sc_pd; > + if (udata) { > + struct zxdh_ucontext *ucontext; > + > + ucontext = rdma_udata_to_drv_context(udata, > + struct zxdh_ucontext, > + ibucontext); > + > + zxdh_sc_pd_init(dev, sc_pd, pd_id, ucontext->abi_ver); > + uresp.pd_id = pd_id; > + if (ib_respond_udata(udata, uresp)) { > + err = -EFAULT; > + goto error; > + } > + } else { > + /* A protection domain that the kernel allocates has no user > + * context, it uses the default ABI version. > + */ > + zxdh_sc_pd_init(dev, sc_pd, pd_id, ZXDH_ABI_VER); > + } <...> > + struct zxdh_user_mmap_entry *entry = > + kzalloc(sizeof(*entry), GFP_KERNEL); I haven't reviewed the entire series, but a few things immediately caught my attention: First, the series is structured incorrectly. Add the callbacks at the beginning, and make the final patch enable the driver for users by adding a Kbuild entry or a driver_id. Second, use kzalloc_obj instead of kzalloc. Third, replace the pr_*() calls with ibdev_*() calls. Finally, ABI does not apply to in-kernel users. I also strongly suspect that it is not being used correctly for uverbs too. Thanks