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 BA582200A3; Mon, 6 Jan 2025 15:18:56 +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=1736176736; cv=none; b=XZ389tuzyDNUmcvdBTBN9R/1G4fgVTwR2hAiCD//HiR+osoa8zJGEfmaugXy2LBSsD/sVVtiMLRSx6Gz07Der0kM775pxXlH7YUZY/RMToRmYK1uknUES3Pc9PVHw9rJNqWD/vbsoHkXtV4HyP9ZPBQW2C7khbt9oN/vTIONMWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736176736; c=relaxed/simple; bh=KMB7eiBdrQZ3boKYheS36xNdvroJSrY5HY2IJBXQx98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tc4VABj65UBD7U+Gu+z/0TuotDI8C9lVpbdkMuhYTfnx0TtfHW0LqHiONLy1ebKiVQN5DijFClDsajM2nkmYUcfk4qBaxNc2L9m0CNjHCZeE9Lugk85KDbwG1YWVrDtpn/mGqtXYqZ9cw+hXISH7olb4fWqUg2xNSYxO82tiJlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QTfrr+dp; 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="QTfrr+dp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5D7BC4CED2; Mon, 6 Jan 2025 15:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736176736; bh=KMB7eiBdrQZ3boKYheS36xNdvroJSrY5HY2IJBXQx98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QTfrr+dpKgsHOQbbVSaH3UIlfwzdLuiSljyPfzUjmPr8qKItBOCQTYOdQj/H+/bPo RaDnNygZmBp+rIVRjnmhkBK4wdS+u9RUT274zGYXIEzl1mPgJ5xm0lw4zRE2rAHbaM McO8ruzEiFDTJZYMWK0U6edObWQa+fUZDIZi9ltk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kalesh AP , Selvin Xavier , Leon Romanovsky , Sasha Levin Subject: [PATCH 6.1 15/81] RDMA/bnxt_re: Fix max_qp_wrs reported Date: Mon, 6 Jan 2025 16:15:47 +0100 Message-ID: <20250106151130.013637071@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106151129.433047073@linuxfoundation.org> References: <20250106151129.433047073@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Selvin Xavier [ Upstream commit 40be32303ec829ea12f9883e499bfd3fe9e52baf ] While creating qps, driver adds one extra entry to the sq size passed by the ULPs in order to avoid queue full condition. When ULPs creates QPs with max_qp_wr reported, driver creates QP with 1 more than the max_wqes supported by HW. Create QP fails in this case. To avoid this error, reduce 1 entry in max_qp_wqes and report it to the stack. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Reviewed-by: Kalesh AP Signed-off-by: Selvin Xavier Link: https://patch.msgid.link/20241217102649.1377704-2-kalesh-anakkur.purayil@broadcom.com Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index bae7d8926143..f59e8755f611 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -124,7 +124,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, attr->max_qp_init_rd_atom = sb->max_qp_init_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ? BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_init_rd_atom; - attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr); + attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr) - 1; /* * 128 WQEs needs to be reserved for the HW (8916). Prevent * reporting the max number -- 2.39.5