Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091680rwb; Mon, 15 Aug 2022 17:55:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Sp1/D5QKGBuia7GXjwtlnn+RsnjuYM2HSfxFIyWod5qiBL+9c8W0QDiPSvKXHr8MY00ja X-Received: by 2002:a05:6402:388e:b0:43a:d5ff:60f0 with SMTP id fd14-20020a056402388e00b0043ad5ff60f0mr16258590edb.152.1660611334681; Mon, 15 Aug 2022 17:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611334; cv=none; d=google.com; s=arc-20160816; b=XUpsjDBSo04tGX2qPHNsD3OuE0PIfYhW3IITBcWq6Dyu7z1AaKzA4/gmRKEpWrEMGF Qsz9VUVTtvNSMaTc0jMHBUcfJlrNrKBoQbg0RuHWRWj9Vdq85rluIP2wEbNgcFU/lFgZ taHQyCm+RTT9zxbsdbDbhXBDuFAMO8DZaOvcmH9jCZeg0/CehWJuBKadoAX/eONUc2g5 ZI9XBtFcmW+EOmKv/CIHx1eASoqI7g0030Zfaa3hV6taBOBNST22Iqbpc95kbVaOCo8k hnPhp6bgGEoLcjReVX2kkX9nf/R7D+bzyEglXJSwR2i9NQ8KoO9VoTcp93SH1evQOsDN mcyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y4ZmbmlQq4sRsTQEOjGJ5zV6sMYqO4CujvW+ieiSnAY=; b=lOrCgVa3FZxA8L7HA7Ja46TIhaBp6KapN47LdcPAPBSOH0FEPKS/I0i0HJTdYN+vDD lROL3FzAPt77qEX8WVXKRUfZB4PvTz309r35s7faYbSUkHoRxmbT5SuTxSgt5oVZ87KL cP4l4YzqgKTXA+cSrRLzwhEjQcu4UJgzJzNRE+faYoFmJliAhXAxtXhEkk5a8YMTbjg9 xcAFZr/xRpum77TCWfYZM6pNPQmw2UmhURdtqgTSijQ2sUx0hblr41+yhqMwFvVt7UyG 8XFOF/flPtV719x5IRkBJ8hcHqQMbb1Vk/q5QcnsfPo1H/IGxTRLroQT8hnIAAMP9/eF RAnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A2vNksOS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp25-20020a1709073e1900b0073309f33443si9476256ejc.636.2022.08.15.17.55.08; Mon, 15 Aug 2022 17:55:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A2vNksOS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349404AbiHPAaL (ORCPT + 99 others); Mon, 15 Aug 2022 20:30:11 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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-766dfd10e8f2@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 = wqe->wr.wr.mw.rkey & 0xff; - if (mw->ibmw.type == IB_MW_TYPE_1) { if (unlikely(mw->state != RXE_MW_STATE_VALID)) { pr_err_once( @@ -87,11 +85,6 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, } } - if (unlikely(key == (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; -- 2.35.1