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=1796304022; b=FRmwInrCS2kN09S2nrT2P5LltV8EcmOP7ltl4K0a5xBxZ8zTNJdt8/qd4FkwHi3F0dIQ U6dTnTGHaUYSxYoGL1lKTEK4qdRPSMpeXUiSINglaz1/NfE4kX2lW5soQPRTPyEnIdkVj cJXeCV1Wwzs3MeBOcY7NFbatITehsc7/Oi+IQ+rVcAgbZoWWQgFZ3hqXejK2bvAU/JkOo zlRxcSm6yUYsVNJcZC4mrn1M9eAh0nE7u50zV5tbyq6kNY9hcsdZKLZspFukXoNr0Re/T ehGTY4rqcXapnxRriivY91pGl1ZDRKkiO49G+2CLfp30wP9gY2frZSRpNX68EcV20XA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304022; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=zDq4c6J4sT1uQGs3HGcu5WndKYnKEpNDU22i80FigfU=; b=zfGs8agFKxTlI0vvMOxdrZfdpqBtGqgmbWVf0W8v5DrJEeawiRvfWj7Hp6S+JCqcNbEC 9XCfiga376/pG7hy/Wh2bPudBJffWJndIWgNHPtrWidDo+IQED1sPZZi4uNhfjfYV3/Gx oLQ98wRcdNIuyZN9r0CXt7W+HaPDaR8MAYfsqsv80eE7dReItk+mChE5C4H2ESeLnck8Z UJHmUahi0Y8Epq6e4zHNG8u7/nJhe8uYeV60FdWFJ1aZJWibxHs87AM/3Tg6djnxmSii/ W2LPgWW6CnSQeaPXCwIkreCk9Ix04Tut5PiZ7ThsVXC7lj55YaK3L7wyUJ0HahMuZ9g== 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=QIvKq1CC; 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 4744C606A322 for ; Thu, 3 Dec 2026 13:20:22 +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=QIvKq1CC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 147CF1F000C1; Thu, 3 Dec 2026 13:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796304022; bh=zDq4c6J4sT1uQGs3HGcu5WndKYnKEpNDU22i80FigfU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=QIvKq1CC/lgixTDj8JSW+qFIolD0sCUqEyjxpRt0XDHQieRxqJqIuqww9k//yXErO ivNRXKLHXBs3Qlbs657ytkSS2tNz+9yB52YITyCyB+hzXFhPh7fQL3DjMl7gc7f7B/ ZZ/RLP/m33hspTZPNV2iL4w4Z5eUC4QgUk+o6Fuf+3b74InLZ9loVjqpHBUvMWRck6 fgAsjkkz/vxH37ul/YsNbHmPyaaMtHXTMMhocxdn5QIRc4/STVv3BKvM/2/rx04QNM lHP77V4h04cfyZqf1xh/dejBXAuOAkXe0qVmXfCP1gZlq7EGS1yAyiD45BZpGMHpRa vG/+oxecEt/ew== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH rdma v10 4/7] RDMA/zrdma: Add hardware resource initialization and verbs skeleton Reply-To: sashiko-reviews@lists.linux.dev To: "Yanze Zhang" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261203124928.48716-5-zhang.yanze@zte.com.cn> References: <20261203124928.48716-1-zhang.yanze@zte.com.cn> <20261203124928.48716-5-zhang.yanze@zte.com.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 13:20:21 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] RDMA/zrdma: zxdh_initialize_hw_rsrc() reserves two MR entries undocumented - [Low] RDMA/zrdma: zrdma_verbs.h missing zrdma_type.h include for struct zxdh_sc_pd - [Low] RDMA/zrdma: MAX_AH and MAX_SRQ in zrdma_verbs.h mismatch zrdma_hw.c pools -- commit 5fe108987a433420b66283ff408fc8bd93f00adb Author: Yanze Zhang RDMA/zrdma: Add hardware resource initialization and verbs skeleton This commit adds hardware resource bitmap initialization in zrdma_hw.c and a minimal verbs layer skeleton with device registration in zrdma_verbs.c and zrdma_verbs.h. > diff --git a/drivers/infiniband/hw/zrdma/zrdma_hw.c b/drivers/infiniband/= hw/zrdma/zrdma_hw.c > new file mode 100644 > index 0000000000000..ba0e5760b52ca > --- /dev/null > +++ b/drivers/infiniband/hw/zrdma/zrdma_hw.c > @@ -0,0 +1,118 @@ [ ... ] > + /* The first entry of the pools that are already in use is > + * reserved, so that a resource number of zero is not handed out. > + * The pools of the completion queues, the shared receive queues, > + * the user priorities and the 8K indices do not reserve an entry > + * yet, they are not allocated from yet. > + */ > + set_bit(0, rf->allocated_mrs); > + set_bit(1, rf->allocated_mrs); > + set_bit(0, rf->allocated_pds); > + set_bit(0, rf->allocated_qps); > + set_bit(0, rf->allocated_ahs); > + set_bit(0, rf->allocated_mcgs); [Severity: Low] Why is bit 1 also reserved in rf->allocated_mrs here? Both this comment and the commit message say only the first entry is reserved, whereas MAX_MR is 0xfffe (ZXDH_MAX_MR - 2). If index 1 is intentionally reserved, the comment and commit message should explain why; otherwise set_bit(1, rf->allocated_mrs) can be dropped. [ ... ] > diff --git a/drivers/infiniband/hw/zrdma/zrdma_verbs.h b/drivers/infiniba= nd/hw/zrdma/zrdma_verbs.h > new file mode 100644 > index 0000000000000..a435891ab7cf5 > --- /dev/null > +++ b/drivers/infiniband/hw/zrdma/zrdma_verbs.h > @@ -0,0 +1,119 @@ [ ... ] > +#define MAX_SRQ 0x200 > +#define MAX_SRQ_WR 0x7fff > +#define MAX_SRQ_SGE 0xf > +#define LOCAL_CA_ACK_DELAY 16 > +#define HCA_CORE_CLOCK (1000 * 1000UL) > +#define MAX_WQ_TYPE_RQ 0x3fff > +#define MAX_AH 0x10000 [Severity: Low] Should MAX_AH be 0xffff and MAX_SRQ match ZXDH_MAX_SRQ? zxdh_initialize_hw_rsrc() allocates ZXDH_MAX_AH (0x10000) bits for rf->allocated_ahs and reserves bit 0, leaving 0xffff usable AH entries, unlike MAX_QP, MAX_PD, and MAX_MR which subtract their reserved entries. Similarly, rf->allocated_srqs is sized to ZXDH_MAX_SRQ (0x2000), which is 16 times larger than MAX_SRQ (0x200). [ ... ] > +struct zxdh_ucontext { > + struct ib_ucontext ibucontext; > + struct zxdh_device *zdev; [ ... ] > +struct zxdh_pd { > + struct ib_pd ibpd; > + struct zxdh_sc_pd sc_pd; > +}; [Severity: Low] Does zrdma_verbs.h fail to compile if included standalone or before zrdma_main.h? struct zxdh_pd embeds struct zxdh_sc_pd by value, which is defined in zrdma_type.h, but zrdma_verbs.h does not include zrdma_type.h. It also uses struct zxdh_device *zdev without a forward declaration, and defines generic unprefixed macros (such as CHIP_VERSION, MAX_QP, MAX_CQ, MAX_MR, MAX_PD, MAX_AH, MAX_SRQ, TIMESTAMP_MASK, and MAX_MSG_SZ) that risk namespace collisions. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203124928.4871= 6-1-zhang.yanze@zte.com.cn?part=3D4