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=1796304813; b=0GnHN3gM801FVZ9P8QC/15B/bk4jN5jBRxyI4fiL/Sxbfnjd7jqf8RucVCi2j+l+KEkP rembhnW6w64oYsP+OhuE8+f7fUYWMsNLtOCL6KvMcoqg2ArkcSietdKpY6Bx5+I1lEUQQ w8Au5n3nF/dSRbZ+mJWS90AUCVqrmJt6s0nbRCgTHOefqy9Zj3tDM9FCo9kt/XAxInKiQ +ESs8saQFkGMiyaojPukBPA6PFkV57WA8kCKKQDWk9c1+qsJ9jirN46PybsiWhDBKeGZ+ NFvnRgmycIHJXkJ9OrH9tylIw228WU7cCo1DU20t0FbRGRaqJa1l72N4AD6vDCJwhfQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304813; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=10OUEgeEJcNr5/ajfUKU576lNiV4Pu67BkOyaL+xuM8=; b=yrMUMUbUt7hWWGXlRKefqWmLaGPiexXkGzhRtKMyhvmnJgsgI+cBlkDoeLDJxuqxSAl4 Xc61AkPQE+pJQ6eIb5HoTzlpYoRd/BdvdOsRUmPrYWOL9R7ILx6o76njN4DXHiJe5Xqa2 yI8myq8LPjHMcb9Uo9Qa1oDi69akWNIKsbEejOx5EybeUb8HtBdEs1IZ41Zr/hZeKofOY r9kseSGICFRZb03pRSR2ZhGNVo27a8Kze27t2h3CtNZZrczV4mnJQG+oyWJZZagyR7KIk LGabeGseaPjgPDdxxmWLVtIDCi0fgJrXWUuDA7aAaxpUOCtIF+8Tt2LSU+FQutsdqdA== 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=GbRcBAWL; 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 A088F606A32C for ; Thu, 3 Dec 2026 13:33:33 +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=GbRcBAWL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67E061F000C1; Thu, 3 Dec 2026 13:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796304813; bh=10OUEgeEJcNr5/ajfUKU576lNiV4Pu67BkOyaL+xuM8=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=GbRcBAWLGX7bQR0tPd/D/sXpsutR0ht9QRed9T1PAlh8LaPH1Mgh+KjPY5JiND3sk hiq+21xpq/RnrzL7oybi+82cr8nMYOEczc9X2Sdta9II+OlPbQxFsPLv3dL41ogDgA Y9pgWk2wEBlnImswfejtrkpZUUszZkHwhIQ9e9wu/ct5KJB+EOEXE7fkTlWJBogO7X 3MH9SWANztmD1afzVRMGhNteFEoYX0BvVySVLfzNDwR3pQSryWL3Tp+wh1Ehcsqpzz K3xwLRztcU4uHRv9tvs1XuVBZTkvoM4OiKTL3wJNIYbjU+2jRSW+/DWhrySvYD1beE EWTIUOepqyDSA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4] RDMA/cxgb4: fix the length of large fast-reg MRs Reply-To: sashiko-reviews@lists.linux.dev To: "Showrya M N" , linux-rdma@vger.kernel.org In-Reply-To: <20261203225044.18030-1-showrya@chelsio.com> References: <20261203185637.27223-1-showrya@chelsio.com> <20261203225044.18030-1-showrya@chelsio.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 13:33:33 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: Potnuri Bharat Teja >=20 > ib_mr.length is a u64 and cxgb4 advertises max_mr_size as ~0ULL, but > build_memreg() and build_tpte_memreg() always program len_hi as 0 and > truncate the length into len_lo. A kernel fast-reg MR of 4GB or more, > e.g. one mapped with a large page size, is therefore registered in HW > with a truncated length. >=20 > Program len_hi/len_lo from the upper and lower 32 bits of the MR length, > as write_tpt_entry() already does for regular MRs. >=20 > Also, T4 and T5 can't handle MRs of 8GB or more. c4iw_reg_user_mr() > already rejects such MRs via mr_exceeds_hw_limits(), but fast-reg MRs > get their length only in c4iw_map_mr_sg() and are never checked. With > DSGL, a fast-reg MR holds up to 128 pages of up to 128MB, so it can > reach 16GB. Apply the same limit in c4iw_map_mr_sg() and fail the > mapping with -EINVAL. >=20 > Fixes: edd31551148c ("IB: Correct MR length field to be 64-bit") > Signed-off-by: Potnuri Bharat Teja > Signed-off-by: Showrya M N Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203225044.1803= 0-1-showrya@chelsio.com?part=3D1