From nobody Mon Sep 29 22:35:07 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFDD2C00140 for ; Tue, 16 Aug 2022 00:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347664AbiHPAaM (ORCPT ); Mon, 15 Aug 2022 20:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352072AbiHPA3P (ORCPT ); Mon, 15 Aug 2022 20:29:15 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F42D182795; Mon, 15 Aug 2022 13:35:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id EA2A4CE12E9; Mon, 15 Aug 2022 20:34:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7C59C433D7; Mon, 15 Aug 2022 20:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595676; bh=jkbo/Yg30K6BmnHia0081/JzYBije/0EvmupwInnKEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A2vNksOSdj//lNR94zB+xPtumGs1defTSgLeGV178MXBqQI17aYLGYvWVM+CZ1uXJ /DqBAHKf9qMI0GuYrQXa+cti9+e4b2Xm+FcBNjs+QBiJ93sr2wZKwAL91J+1OczmFT ICNOPasw3qbrPzLH0egWT8aIv69Nq4PWFMTlzggI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Pearson , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.19 0840/1157] RDMA/rxe: Fix mw bind to allow any consumer key portion Date: Mon, 15 Aug 2022 20:03:16 +0200 Message-Id: <20220815180513.090785728@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bob Pearson [ Upstream commit 1603f89935ec86d40a7667e1250392626976ccc2 ] The current implementation of rxe_check_bind_mw() in rxe_mw.c is incorrect since it requires the new key portion provided by the mw consumer to be different than the previous key portion. This is not required by the IBA. Remove the test. Link: https://lore.kernel.org/linux-rdma/fb4614e7-4cac-0dc7-3ef7-766dfd10e8= f2@gmail.com/ Fixes: 32a577b4c3a9 ("Add support for bind MW work requests") Link: https://lore.kernel.org/r/20220714204619.13396-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_mw.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_mw.c b/drivers/infiniband/sw/rxe= /rxe_mw.c index 2e1fa844fabf..824739008d5b 100644 --- a/drivers/infiniband/sw/rxe/rxe_mw.c +++ b/drivers/infiniband/sw/rxe/rxe_mw.c @@ -48,8 +48,6 @@ int rxe_dealloc_mw(struct ib_mw *ibmw) static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, struct rxe_mw *mw, struct rxe_mr *mr) { - u32 key =3D wqe->wr.wr.mw.rkey & 0xff; - if (mw->ibmw.type =3D=3D IB_MW_TYPE_1) { if (unlikely(mw->state !=3D RXE_MW_STATE_VALID)) { pr_err_once( @@ -87,11 +85,6 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct r= xe_send_wqe *wqe, } } =20 - if (unlikely(key =3D=3D (mw->rkey & 0xff))) { - pr_err_once("attempt to bind MW with same key\n"); - return -EINVAL; - } - /* remaining checks only apply to a nonzero MR */ if (!mr) return 0; --=20 2.35.1