From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5947D25A642; Tue, 25 Mar 2025 12:31:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742905880; cv=none; b=UfeYCm+Z+M17EsVISnGIJ4HxTotxrn7Dfvi5Ff3e4tCQ7f+wCkUd3ZaPxNFfk9GHJKK7GkECrF5yukiq6EtolrZwUn2RrQK0Rb/OMCin+udG5GYCopEJq+qt3CRUlJYEecuuNcj/QVe5am79OGw885rtQY0oyP+d1nADHGTQ5Uo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742905880; c=relaxed/simple; bh=5exMf5yJtQcDG3yxlGc9yn+F4aY7o72ZPccaBQnnZN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TYIRry/gmVv32eJgfb0cFe0onhXH8WYlOgnMRlPmmQUQ5lweGPVaLteaIXgwFX53D2ZNEK7DoskKYv2wIUj/rHurOKWmBBwIFrz5l+S4WPa3HRPjgdgWWZKoeiDYyoi9kMjMioQE9Bl4fis1tLM8F1eJ0SqtTqFG4jTI3UW3gC4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i9yAQZCt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="i9yAQZCt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A312CC4CEE4; Tue, 25 Mar 2025 12:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1742905879; bh=5exMf5yJtQcDG3yxlGc9yn+F4aY7o72ZPccaBQnnZN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i9yAQZCtgHBgjcTXbbulUpDMgHhg2zJOaFowbGEnDZtoCzZ+KX7I8zbz26iQZltS5 drrVlSacnE4Xv3FATKbP7mr7rzsM7vTVr2Ejn6zXe5/faufYJtFI2qst4HwpNyb9CL OK4Fcu4Ty+A8lq1dhnp2gXMQUdJGGBRu4pLWjv64= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kalesh AP , Kashyap Desai , Selvin Xavier , Leon Romanovsky , Sasha Levin Subject: [PATCH 6.13 015/119] RDMA/bnxt_re: Add missing paranthesis in map_qp_id_to_tbl_indx Date: Tue, 25 Mar 2025 08:21:13 -0400 Message-ID: <20250325122149.454291929@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250325122149.058346343@linuxfoundation.org> References: <20250325122149.058346343@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kashyap Desai [ Upstream commit 67ee8d496511ad8e1cb88f72944847e7b3e4e47c ] The modulo operation returns wrong result without the paranthesis and that resulted in wrong QP table indexing. Fixes: 84cf229f4001 ("RDMA/bnxt_re: Fix the qp table indexing") Reviewed-by: Kalesh AP Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier Link: https://patch.msgid.link/1741021178-2569-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h index 88814cb3aa741..5e649371e1b67 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h @@ -285,9 +285,10 @@ int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw); int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw, struct bnxt_qplib_ctx *ctx, int is_virtfn); void bnxt_qplib_mark_qp_error(void *qp_handle); + static inline u32 map_qp_id_to_tbl_indx(u32 qid, struct bnxt_qplib_rcfw *rcfw) { /* Last index of the qp_tbl is for QP1 ie. qp_tbl_size - 1*/ - return (qid == 1) ? rcfw->qp_tbl_size - 1 : qid % rcfw->qp_tbl_size - 2; + return (qid == 1) ? rcfw->qp_tbl_size - 1 : (qid % (rcfw->qp_tbl_size - 2)); } #endif /* __BNXT_QPLIB_RCFW_H__ */ -- 2.39.5