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=1796327853; b=YoOVe605ko1jBEQyChY2Lg1lw4xRCUTs6ADFICdnLY6CLcg6njNdI+E4gxj6c6WAuGAA EL5/HOESCnC6iS59nBmevhcbUvqqstAj607bFHJSSExsxBgECZjaBiU0wYO9Vz7a+B2el Ow2r4Ohy0Flcmz4gsT7jN4LdyTJ5v+r9uEMCDA2aSnfkgrSgvpGblRFECyPd3mfwE+y9X bIrW4aUQLQd1vhCwI4QfMZ4mZu0uo61Vk+JXaXyvAJXRaUUfF3OP3SBZ5VkOkbzYV71bS 2IZOBtcJIMRK2ZfHHqI3QURMbjLDyani56gdA7UsBkA+Mya+UAG0+1omVi+mWmS76BQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327853; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FegzuU6+CFvpPD73EUjDMSSoIif2DNzfhTcl2oprqPs=; b=DQ5wIegRlj8Ua0mq/CkDjFnsXuI7DgnxgDKHhxMuEsQ/rC8nDQo4wItEyIrtl8ByXDKQ HVTLge6+lwrLedu2jFnk8rZxmkYNYTzAvTIxJ939qUOzafGPR74MV04rj639m3BlRIeyK pO0d/vOdx3yW6hz+6XnSPaqe5OzGVT1Re3BkWu6Br2kY5KAOr6vReJE9XCEvhwgQGxlTA Q6N0d0FfVc7K3AiLMPD4os8rHz+H3y9h8w86Rj+WnjtI7m8rewYXbN7/M7sEIv3B7DkMr sLUyHcMpZJHHvSgXtHwHThHLmTOkFLW98ftBcsg5x1cN1odpX73VyZ/ALrWy2URUaqw== 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=L+2KYo0V; 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 4FF84606A322 for ; Thu, 3 Dec 2026 19:57: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=L+2KYo0V Received: by smtp.kernel.org (Postfix) with ESMTPSA id 544891F000CE; Thu, 3 Dec 2026 19:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327852; bh=FegzuU6+CFvpPD73EUjDMSSoIif2DNzfhTcl2oprqPs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=L+2KYo0VJh58aeq2Oez5rJY4Eg3riPumRa0R8gkqhQMrnT2O1adD4Ye+bDo1ZWusN v4u2YVED9ruLuUC6HxNUk7LdEoSEtwAb3NCpGFoTFIDr/t0VmFt51sMpWwDlTMVuj7 vl4ibAqVetz04RU57bxKccFXUnTGg1GVPynjMS5p3nzfY8DCdoFDU+yDlpuWxKCUnJ keN9gQElJcQ8EzP4FtuYZLZPqlgk6g+VxnU4VqWKg96eqIbBDOJmH6GXa7UtjnIb9+ oXniD+2PCaSyiPtEP82TJE5NaHwVi5uBruH45o9pdCWPggg+DY7RpS7yaLOkVrtQoX QkExsTXv22BNA== Date: Thu, 3 Dec 2026 21:57:29 +0200 From: Leon Romanovsky To: Showrya M N Cc: linux-rdma@vger.kernel.org, jgg@ziepe.ca, Potnuri Bharat Teja Subject: Re: [PATCH v4] RDMA/cxgb4: fix the length of large fast-reg MRs Message-ID: <20261203195729.GZ31440@unreal> References: <20261203185637.27223-1-showrya@chelsio.com> <20261203225044.18030-1-showrya@chelsio.com> X-Mailing-List: linux-rdma@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: <20261203225044.18030-1-showrya@chelsio.com> On Thu, Dec 03, 2026 at 05:50:44PM -0500, Showrya M N wrote: > From: Potnuri Bharat Teja > > 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. > > 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. > > 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. > > Fixes: edd31551148c ("IB: Correct MR length field to be 64-bit") > Signed-off-by: Potnuri Bharat Teja > Signed-off-by: Showrya M N > --- > Changes v3 -> v4: > - Drop Fixes: 2550a88d956f; fast-reg MRs could only reach 4GB/8GB > once ib_mr.length became u64 in edd31551148c, which is already > cited (sashiko review). > > Changes v2 -> v3: > - Also apply the T4/T5 8GB MR limit (mr_exceeds_hw_limits()) to > fast-reg MRs in c4iw_map_mr_sg(); until now only user MRs were > checked (sashiko review). > - Update the subject accordingly. > > Changes v1 -> v2: > - Fixes: point to edd31551148c, which widened ib_mr.length to u64; > at 8376b86de7d3 the length was still 32 bits. (sashiko review) > > drivers/infiniband/hw/cxgb4/mem.c | 7 ++++++- > drivers/infiniband/hw/cxgb4/qp.c | 8 ++++---- > 2 files changed, 10 insertions(+), 5 deletions(-) Please don't send a new version of the patches as a reply to the previous version. It significantly disrupts my workflow. Thanks