From patchwork Tue Dec 17 10:26:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13911607 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 295DF1D5CFD for ; Tue, 17 Dec 2024 10:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431524; cv=none; b=A6bSWXMRu7n3hJmj/Zw/t/43KHTuRgy+fVNRhlHOQhTRQYowS4vGDM30FOQjAd/yAZPjp2e+lOUrJfnlepvUtsKT8LFiIAGIWVNFzxEBvPH1WCkcPF6/M6M+6mkYye97UcJwoqjnyLhrvBhXgV81fwmhYSywAFjGVYYZ+lhaYvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431524; c=relaxed/simple; bh=nlO3gVti/r6DXZb8Dl44RVwU14ShV4rqZ7ei/KH3vBo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q8uhI2/QG+Vzfh5YCmso1fKwlXBSRzQp/t1Oezm7pCjVpyP8DHKIOhXQtIjVJCpIhaIcTO8nM3UtfIQigQaA6b0wjFfvExYwANkpWBJN0h/gGDpapaPBq6FAa7rW222DdgV5nhJznp0uAV4Lhz52VKAjU6TYhBSY7VMeMXd741k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=NqqbRvxV; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="NqqbRvxV" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2ee76929a98so3743581a91.1 for ; Tue, 17 Dec 2024 02:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1734431522; x=1735036322; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7GcsuZXG42/f5qV8KKzngTxp9t5eJX0F39jR+TbZUus=; b=NqqbRvxVFK8RIGfBws/+LAAqwOiwfrSya58RS/QjuHeU3SCavyVIINCEQ0wSDFS6qI I2LIqM6RMXDQYGveXDgk0RgC0ujPSr/ieUvxOepx6cuLMukyhWDKDpkmGZZQBEjQn2xK /iAvUBBj3C5YVFwQNqHvApeanqLWc+USO2y+M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734431522; x=1735036322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7GcsuZXG42/f5qV8KKzngTxp9t5eJX0F39jR+TbZUus=; b=Q7MMo40GgZ4IirhE/JBaMsTeoZpFHQOwz+IS07+k6kX/jQLb8oDCBtygLdlYkc3znT h+je47ElwhsY5SHulQyDsAc0EwfqyYtiI5QdTZ9a7V0AaymkPK77SPlL86TsMv3Oc9pf vUAPoqW3NjlCyaDM0JXQc7/DVVL18+3CbD1JbjdCniQrLdyJl0eTQUryrO6sPgN3RdQx gbjqcf/NMxvPx7/e5t8TYuQgFdYuW6pTUI4UgrBa/fuV6nhej70BZdzPBljA+Qnz4+oa JGDVyhXvAC+vUPNdEJ0QChUimBQgZ6ZoLaTErnfnUppdyKTsnwA5Pgyj9PcM/v5z8Aub cFDA== X-Gm-Message-State: AOJu0Yx4cj4+b9ow+i0XKsqESp0hxmdXoGZgSuuQTDXBZCXYD4ZE3pWn /ttPYZW/maYagfpxfb6aveB7mgc5XRpZX6YV/97FDMX/TJWoZiWCHQglKwIafQ== X-Gm-Gg: ASbGncue/OJ1zkoc9RtACs65kD8wU7GEovHHs1zBgyGNYNgGKHRcR6bQWwVE+xoInEf FOYO23Dp+F3f4iXUvDDyjkRy76FkIWWJQlyQhOglX1iwbKxkjuDD0IaRwfBWUB4Wh69msWrpWBT C4UzASbysulbbYZ2dRUprMKXHIetFA2rzWtmKRyE3ssjBUJBJsC2IjTIcmZ/OkArkhJFP99DgvX d2AWSvMfR2FZEjBxm8qsTWlhUVpalT8N4gO3Trh/T1uzGRRTBSX7YRh31sQ2JwwWfe7B4DygHEc T1NRRlduWHGV7jsuR5jSHjK7+Hehx49yubzyqzhiWTJuOQWi/IkNuS1yR0o= X-Google-Smtp-Source: AGHT+IFNdCGPPl27MfUcF+eH7DSupDq/cdflrQzSv5wqTGr3+XATUTgxM0xY8jjUyv2pCh4CcT7kkw== X-Received: by 2002:a17:90b:1b07:b0:2ef:cbcc:768b with SMTP id 98e67ed59e1d1-2f2d87bd428mr3962609a91.6.1734431522346; Tue, 17 Dec 2024 02:32:02 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142d90bd8sm10764596a91.10.2024.12.17.02.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 02:32:01 -0800 (PST) From: Kalesh AP To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com, Kalesh AP Subject: [PATCH for-rc 1/5] RDMA/bnxt_re: Fix max_qp_wrs reported Date: Tue, 17 Dec 2024 15:56:45 +0530 Message-ID: <20241217102649.1377704-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> References: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Selvin Xavier 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 --- 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 7e20ae3d2c4f..73c9baaebb4e 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -129,7 +129,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 From patchwork Tue Dec 17 10:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13911608 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2C3A1D5CFD for ; Tue, 17 Dec 2024 10:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431527; cv=none; b=bxNUyIILdJN+X9JpvLsxVXRE+xWHnv6ZwoW8zqsucE4u2+tuUsJoSk5oSRRC6Iwm2tJOOjUGeZCnJ+ksDCxqlBys9y06AKpX93OVAG+Grw3Xbro5YrL8qCM91GxWxnv2UqfdxpWv1tngcA4e4MBsSBh71FXoNTPnAjzTUuhTwEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431527; c=relaxed/simple; bh=aUd3IqFr+Mcws/PReVSP5NcENMi1dnNzFcR4/uwVqMo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qVEFEDOggDNRmE7rKBI2EtrZdfIcydR1Cb8TSyCExHNPnpixLi0J+8RDtrPqh+krcZrHeFB5IxzLljVx1mBCiqZIkCbMOZbuzNmomtv+HxwzA1iLfMzOgDm5WHGGn/HpufVWGrPUytOuLIMQQ3o41HFlITTlM7Ye/Pe73p0fWig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=KUjMwX0y; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KUjMwX0y" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-7fbc65f6c72so4589655a12.1 for ; Tue, 17 Dec 2024 02:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1734431525; x=1735036325; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9ljCrKcn/0XeoJXBCkWUZIYp6fgvcEpme61m1/wN5EM=; b=KUjMwX0ylzLawj77L3xBVY/KHal+bTXmwSUuuZhX9jrgwrE+wcDTvWNZ7ywfwWBkKX NRw+Z6Uq6VVQDYS5wEDV1WShyj81rqilbMFUjcCmWUytv8Q2UDsXmNyS/NfhcIF1iJku Pe3wP8Gn2a5CYBkwnn8Y43v1A6IwlKaeYq5oU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734431525; x=1735036325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ljCrKcn/0XeoJXBCkWUZIYp6fgvcEpme61m1/wN5EM=; b=ZMNYFFvsklOA2zjefbShDWXHHt0LZ0Jl547+wqcP1pQxzKeodHeoOgCnkqSMANsn7L e1i+WSw7yj+vENI4MqJ9/E3K+TKQPnK+82ITHiPYZ35QFiHiySHU7GPDPbdQTmJy9IoC QMeA/FuHtzKejinxuFPx2GdPkOo3+3cD7i/9eDTM7VfeEWwIjZ8khIUP+L2KfZBTT8rQ mU+SnkJGglhULY1kAnfbWdrZTS6cEnviIv6LVm+gSgWsbxOZUdV2tNllBLmEqt+hGrJS VuxlRYsizo+gFZCRaYvUraT9wXDHuGihQHRtlJn7JEtz6zitLloRBEbUgi8SWO/rWrGx 3VDA== X-Gm-Message-State: AOJu0YzuLsgN+K6XW6FUeAvZRC8dBvb6C3fvqlySMPf5bANIaF5MPaK0 DrX5JL1xyCGcDSpbLBvVGWkOCnmcF0f4uGCoe0pNOGJfpIMtxtNYdap3RZi8ptK8UCntLaNi6Ss = X-Gm-Gg: ASbGncsiiOFt0e6Zt+1SftsNiDWkakIiOjJrk01Lh6/O/yZ4xMGbpziRmAdhFlnD5ES 0EOPi7a2JA1Jh5n562OJXJIsoa9w4jQos18P335fOgtDU7j5oieRUpN7MNKoZ68ny+ED8X9SDN6 5pL+g0uMJpCytqB91LMKaR7cfTB2dnOBwbYVsHdD5MsKIiOYFsNmy9Y3iQM9io0ZGgx4ofjc0BI gQqN+r7o4l2iqgHwUBZtY5695cYEUl8AC6i9e/fwSVKg7BseY1wMn5pX8MBjDACjjBdKdzAQaMl 1MnV9Y2ZprntZ5SNgXJ4K7ZNKvAdZk/RzcgsUiJiGHwl8DKJYGiNaXjR/LE= X-Google-Smtp-Source: AGHT+IHQaAMZYxufyP4jgyv9WZE58kswXVVKoFW39BpjQkkwYy0LxtdAX+cbrdcRsGzAZlIR1rHDCA== X-Received: by 2002:a17:90b:4b01:b0:2ee:48bf:7dc9 with SMTP id 98e67ed59e1d1-2f28fb6effcmr25998851a91.15.1734431525137; Tue, 17 Dec 2024 02:32:05 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142d90bd8sm10764596a91.10.2024.12.17.02.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 02:32:04 -0800 (PST) From: Kalesh AP To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com, Kalesh AP Subject: [PATCH for-rc 2/5] RDMA/bnxt_re: Disable use of reserved wqes Date: Tue, 17 Dec 2024 15:56:46 +0530 Message-ID: <20241217102649.1377704-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> References: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Disabling the reserved wqes logic for Gen P5/P7 devices because this workaround is required only for legacy devices. Fixes: ecb53febfcad ("RDMA/bnxt_en: Enable RDMA driver support for 57500 chip") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index 73c9baaebb4e..776f8f1f1432 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -130,11 +130,13 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, 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) - 1; - /* - * 128 WQEs needs to be reserved for the HW (8916). Prevent - * reporting the max number - */ - attr->max_qp_wqes -= BNXT_QPLIB_RESERVED_QP_WRS + 1; + if (!bnxt_qplib_is_chip_gen_p5_p7(rcfw->res->cctx)) { + /* + * 128 WQEs needs to be reserved for the HW (8916). Prevent + * reporting the max number on legacy devices + */ + attr->max_qp_wqes -= BNXT_QPLIB_RESERVED_QP_WRS + 1; + } attr->max_qp_sges = cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE ? min_t(u32, sb->max_sge_var_wqe, BNXT_VAR_MAX_SGE) : 6; From patchwork Tue Dec 17 10:26:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13911609 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7B501D5CFD for ; Tue, 17 Dec 2024 10:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431530; cv=none; b=EQOMJL/u368OQJ1a1FGVhXUWJ9S3cgiQETrEmG7hpc5PgcMz6ZhoN9X5YtMaCcgY+3roiqvSN92/g601hdif1rRdkimkIyPWRU0u+l8ogGN+JRD6vh7iOBfP9G5lBOrbwUVTdA6mMesPQfsrvrDJesTe/y3PjYYZ8ulk57HozNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431530; c=relaxed/simple; bh=y85QLpFPWCm1SPAaBJxJl9LKgf0TqU5PP3yM58+Sntg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A9SVLYTR2DNMDR+urcn74I6ZD2XO5kjQOXptDxoi4BVAZK5Ypzsbgl+/hTxgAzP9h8OH3OgEIta93ZG/H4GZ+w1IqR44Ts1NGdqBPh3NGgJ9uINco68js+hecm/MbggtoumKpNOtsqEYJ3fN7kVucdu2vGH1MTqiYPRQHuDacm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=NEGJTPa7; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="NEGJTPa7" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-801c8164ef9so2703969a12.1 for ; Tue, 17 Dec 2024 02:32:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1734431528; x=1735036328; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RfS3v1Ah2unI8Gm5Pibjh5G2tHuFKyvOn4gp98jM64Y=; b=NEGJTPa7XLd25jawBEfcLCWSlJNVeQ0spazStFcJkEA1AW8glw6czHDfI+Elfh3cad 5xSACCAVyVKd29aCMfeTo0yxVbx1Qa5FIjSvx3zLMKGwmsqC59DVS7cYhUW2xhHAJnKg uazZj0+inAkjVHsFEy8shQY1Zx9WvgyFfL/6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734431528; x=1735036328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RfS3v1Ah2unI8Gm5Pibjh5G2tHuFKyvOn4gp98jM64Y=; b=OWzi6/UpCAJtpVSoQJxfRVbOaOuexK4gr8C7xAa6Sojxd8uSUICgabAnu355NgBlRf 4QZqFPRED0oWESymJIUrNbGMMOyMj932B6v7aGNa9FOomCI8Yqrt+IdpK2PUw39c4Ouf wTfInzjcDqGvTSxaWvf7CyC6DhSQBx9AcVBi60dmFqge78Bs2ebd9qbsknkFZ4lCWtNT veReTDoLf0jN9PYshK+7ApX/ArJFGhIcKKpYrWsvBLkBPWebotZjVPLSx+W24fCp6Fpk EzV92YEHexMP/9ORuXXxiwQWWP4yKMbJz15E3gM9TscMedeeUj8DH5Uay+eWQk3bKmAd RU0A== X-Gm-Message-State: AOJu0YxX8rsUlyOCgxSW4gqbhYwwhx7JxQrcPj97MI9HzeyAt8g4n9gR +v5x9a+6o3PrRHPO2Z8i0hKrHwvEHSiZdNWQQFfQ9tlzMiVxq6+2WhDeJyI7aeTgmwkJayFCcEo = X-Gm-Gg: ASbGncuy5UuDc67f5PTSJpZyr7sIqS92PIDMl//ZDRQjbzK6qwNZaviOU07oQgMcCE3 tKTIshkC6+sUo6kLbveM2JUtR2395P+TV2XmuDBc4F7lJKPX7V33Vx79QKmDP4vKpixoRptlhgN CfW71/Xfid7ayGBSwL56l/bg3yYjdfyYSuWPpKd7MxAvpP5ljsL11dGF4+wnT1JaPbkheu219w5 WYPQFdVVpM4WVMMwNfuEMMGSUCtrVOydMTi7HepMVqUs+FRfDSspZpNveK4PanHJSThktvvfte/ I8hf9eLw5ori/8du4RZrixi/qbxz9KYgm4lDrsqB7gIITy9ANwXZJYtOzao= X-Google-Smtp-Source: AGHT+IGn5ujEUI5Zqn0tJb4u9RjWGV/CQllW66F3ukryX5kIx117Z0+iAz7J5k+CfV6xUKwih0fjRQ== X-Received: by 2002:a17:90b:380c:b0:2ef:83df:bb3b with SMTP id 98e67ed59e1d1-2f2d87bd46dmr3926273a91.8.1734431528258; Tue, 17 Dec 2024 02:32:08 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142d90bd8sm10764596a91.10.2024.12.17.02.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 02:32:07 -0800 (PST) From: Kalesh AP To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com, Damodharam Ammepalli , Kalesh AP Subject: [PATCH for-rc 3/5] RDMA/bnxt_re: Add send queue size check for variable wqe Date: Tue, 17 Dec 2024 15:56:47 +0530 Message-ID: <20241217102649.1377704-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> References: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Damodharam Ammepalli For the fixed WQE case, HW supports 0xFFFF WQEs. For variable Size WQEs, HW treats this number as the 16 bytes slots. The maximum supported WQEs needs to be adjusted based on the number of slots. Set a maximum WQE limit for variable WQE scenario. Fixes: de1d364c3815 ("RDMA/bnxt_re: Add support for Variable WQE in Genp7 adapters") Reviewed-by: Kalesh AP Signed-off-by: Damodharam Ammepalli Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index 776f8f1f1432..9df3e3271577 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -138,6 +138,10 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, attr->max_qp_wqes -= BNXT_QPLIB_RESERVED_QP_WRS + 1; } + /* Adjust for max_qp_wqes for variable wqe */ + if (cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE) + attr->max_qp_wqes = BNXT_VAR_MAX_WQE - 1; + attr->max_qp_sges = cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE ? min_t(u32, sb->max_sge_var_wqe, BNXT_VAR_MAX_SGE) : 6; attr->max_cq = le32_to_cpu(sb->max_cq); From patchwork Tue Dec 17 10:26:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13911610 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E6481D5CFD for ; Tue, 17 Dec 2024 10:32:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431533; cv=none; b=WpMyp39iAvS5ZZEABZmAplRsWw2s3OPTRwFdXJGrQa030eVvY1VSbX84GGzclKi3y8p7ucMMHUClr1PvSTMxf/sPMybN10KLSQBe+Kt0m1J4De9bRb9le6SXVUVudyAnWrE9j37J3G2ogjigCKHGzylHlSYKA9BbiPu8T3+QDK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431533; c=relaxed/simple; bh=XHiOVFLZ06T5q3BE0Zu1glRuAYkfyQRuGgjXz1Z03ec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AvZdyh8TG6PSaZPcxA8386eE/t4iIPif9ZxHxwtuC61DowctY35z1pPxz2EFnME5RClbh3CNQ9US0bTpFA1u1GYdEtPTJv4zU/MxnKqkyTPOYkmAo7DCvlQm6sviZBQyE2mDtgnkdLdXsfCX8YM3mckTU9O7s10/27M1ixhHy4s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=OaHsYBVn; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="OaHsYBVn" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7fd581c2bf4so3022898a12.3 for ; Tue, 17 Dec 2024 02:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1734431531; x=1735036331; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BNeah9zdJLY6DYTaEPfaWXhKwCdAB7QZT1nhVMKmi38=; b=OaHsYBVn29zYf1dxusIPLzv/7d+l+G8ZC89fIJ81NZnfYbHoxjCdQJ4Qf7lpwGJiEl qRvdUF96OO4t00RHN/SM1n75HikasMTV2dH87Z9xfwv/06rT9ZsbChuuMo9PU6ReHEpO 74QTcEaYaLX9KuD9GGiqoyuQ3uwlSnDdtJXXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734431531; x=1735036331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BNeah9zdJLY6DYTaEPfaWXhKwCdAB7QZT1nhVMKmi38=; b=SJKEgjcoTUOx7w2w+xy0iRnU+FlPSjk3wrF9oEWHW2dHTd6R6/JYiqVbQlmsE69GoL GFesA8UbqTTeL6GBOXjELbfPDFAnrV1k/bn4k387TqyyJpJQvSDu4ZywYBfNx9pa0ESN bvAM6WCY9u5aXEhu8M2rLkHSXjF0wfsslS8L16pWUx4ZdvI1HuLhWQFCNwv/YGTK0SHI i2xrSZ+yvgCeSZBJcDOz63s9RQRxZWm84lK36C5AM/gu8g5tKO8dsBs7mgPlFDeYwUZ0 rC+MCcJpAx7m5M6VeiN7XCnd9UO/5clt+aq0bDBlilsjWtobeT0tXC1mjP2rCzBwp40Z v0+g== X-Gm-Message-State: AOJu0YwLmqki7YDL65yZ0aYNCTC03Sld8MxFHFaGpp2Xr3jYpYcwLgci DKo1wmt6nd3ogIL3mmoBXsQv/jk9G+5COmh2k1EU5/2XTY/Bp/nE0S7pEy1VWw== X-Gm-Gg: ASbGncsSmy5S74gL0gno2SN4qAg7/ZuCewcs9TLXhFEGMU+6Ze86jDYuVvIIFB/QKCD 5PxTStrSCdFA50ChuAwxycv95+k53oDMZDtIGnF4AVe9PMjSslHwyjQwZx4Bn6XEeUvI1aK7FGn zBYvN9b7DeTbGd17cmKj4FJ8/zkUpn/ESPWGYH9uxtKThLsZUc9msS4Y9tzcbwGpyO7oGvietyO j7S4twFa6R7N/c7hqF8ZKTsSv/eDYIXJNvo++Ugp9q3EbA4gL4OxoSDhlsGosFCMWNLqt7DTwRC 29hpPtBYmkHD7PZFlxD4E3N6p3RN8fbsKxYgdNPDJ3U5Z9d8mRw1JAgM+zE= X-Google-Smtp-Source: AGHT+IHb6Ur3lJgGM7rPayGxEdiWS+1Jxj11gZGhS3YyamEpbYQ0kqSBp8zmjMft+uwq6aaTcNjOcw== X-Received: by 2002:a17:90b:53c6:b0:2ee:cded:9ac7 with SMTP id 98e67ed59e1d1-2f28fd7017cmr23887548a91.20.1734431531614; Tue, 17 Dec 2024 02:32:11 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142d90bd8sm10764596a91.10.2024.12.17.02.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 02:32:10 -0800 (PST) From: Kalesh AP To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com, Damodharam Ammepalli , Kashyap Desai , Kalesh AP Subject: [PATCH for-rc 4/5] RDMA/bnxt_re: Fix MSN table size for variable wqe mode Date: Tue, 17 Dec 2024 15:56:48 +0530 Message-ID: <20241217102649.1377704-5-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> References: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Damodharam Ammepalli For variable size wqe mode, the MSN table size should be half the size of the SQ depth. Fixing this to avoid wrap around problems in the retransmission path. Fixes: de1d364c3815 ("RDMA/bnxt_re: Add support for Variable WQE in Genp7 adapters") Reviewed-by: Kashyap Desai Reviewed-by: Kalesh AP Signed-off-by: Damodharam Ammepalli Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index d8a2a929bbe3..951ad90f5aa9 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -1033,7 +1033,12 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) : 0; /* Update msn tbl size */ if (qp->is_host_msn_tbl && psn_sz) { - hwq_attr.aux_depth = roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, qp->wqe_mode)); + if (qp->wqe_mode == BNXT_QPLIB_WQE_MODE_STATIC) + hwq_attr.aux_depth = + roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, qp->wqe_mode)); + else + hwq_attr.aux_depth = + roundup_pow_of_two(bnxt_qplib_set_sq_size(sq, qp->wqe_mode)) / 2; qp->msn_tbl_sz = hwq_attr.aux_depth; qp->msn = 0; } From patchwork Tue Dec 17 10:26:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13911611 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05F7D1D5CFD for ; Tue, 17 Dec 2024 10:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431536; cv=none; b=buGqbHFYRmfSvwCFa3B2EWzWKxz5djN1AHT/xR25OWo80bSM/8siNGv79eg0/0vaMNQf/jq/q2AbF3yZ/0jEkVctOI4SEWMjgKYpFMwI60mhYkG3qVXazvnK3QfikQvA+ccGRAUDbqk4LLC1st3ROAsn4w+wQtKn3G7d2KYQYCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734431536; c=relaxed/simple; bh=KRWuV+7E/3KybVq5XW1jobusOoz2pUyaX+cePKeSY9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N/6UmN/1Ru1iG6i48i+Tcy7RLz4Wjx/aW2TToLnm7kQMeLipm7Jof3xRYgak7vyLOliY1dUxenugw5wbYeEpaaNZ9gqesCaaA1AW/6gnz/PpPOc9ZfEySTTyzUOMJTVDIJMnhSJIXPFU33zhiZ7IcT9giwnH6XIzqk9eFU4421s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=enNiTm1w; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="enNiTm1w" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-801c8164ef9so2704029a12.1 for ; Tue, 17 Dec 2024 02:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1734431534; x=1735036334; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jOkf+XviTiiQRaR+pwjwyVk5ZQwIRP0N3RQkTVTzEhs=; b=enNiTm1wDtoiSdGOmWLhLFfVtBKjBgTgCYh6N8fKXOTmnaNgqbN0VipG1mO3RtlR9E K/xZ2H5Y1ewhYZBpw3HcS4EqHK/GBG1FpxhJUF5w2Hi0cdzTp0ZeENKpCt0QwHsNlcR5 4YKiVrLi0PFAZep0/edtgK8gdjtSdAdoANIuo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734431534; x=1735036334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jOkf+XviTiiQRaR+pwjwyVk5ZQwIRP0N3RQkTVTzEhs=; b=sp+1AjzE5eL8J1ypbeKUJaxb/qzjTnuZGvgXwf0PnXwssQcMp1wkJZyxsNZ0iHBGb1 CzsMQkxCHOGvGqiYU3K/X+XoHuqdoBx9EdDujkJa2EgfEMshTTE3NIlJ0SYokP9Acv/Y tiv2XYFWMSKQsLB7TfiLyvcU0fjSmFbtTyzqM3DQBmnoLMhX6rPsxGru1imxZUBBk0fv ff3x4GvH4hMZPbSQ8hRxCDan9EgIzN4yuR8xXQKrxSu7DoiM5hWWBSb6crDjfsugutyx ODUPi1GaTWpgYxmw5KOZK41bW74qVStokr98dFH4MeNdI6JlHlJfqn2s5vj/kBpVzvsm Q+jQ== X-Gm-Message-State: AOJu0YwSrp9HYLBG0bJ7ZvQora0ngPvRRGdWoFfJ0o9rgyKt3SxgJLE3 L3XlM3cmfk3dF6VLnveEdGAPrt+zSDB3df0hqKesFKADtLUxPAMnYbDsToGZAQ== X-Gm-Gg: ASbGncuBUegIR9GrsBWaty4HYKWpFLu/5IUz1mmqvjlf9wzuVnbNRZt9tKjjnt6F5VT YefiPa51LhF9nBjF7qH20AELYdXjMB1V/GjqkyOqNgwlkJMKhepEn6Z8OndPkuZ32WkGQP+1272 PCnE+UlgYJ/98AcF9yVo1RZ57z9Przmc56maC4iqk697uFGAKRvw8H/8zPqxuVhKaE81Kwp9Cad EkPrZ01ZVEj/2uqoFjZ8RQZ6/ga7Y0O948ywQargUfgtyhXKN1jqzZVLnJpKOpQLntxN19BM809 yDBGnQGRCicVbfJyLW/fMn2g06eTsbTLC8NQaoNqXuI5ZwppRdpN9Y5/Of4= X-Google-Smtp-Source: AGHT+IErra2Z+2cuyS72mKRbVd0b1SIJdg1FdPlOT0SXMM+JYn7ftJMAQlprCzj7qfezg8guV34IOQ== X-Received: by 2002:a17:90b:3b85:b0:2ee:8253:9a9f with SMTP id 98e67ed59e1d1-2f2d8861341mr3978808a91.11.1734431534227; Tue, 17 Dec 2024 02:32:14 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142d90bd8sm10764596a91.10.2024.12.17.02.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 02:32:13 -0800 (PST) From: Kalesh AP To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com Subject: [PATCH for-rc 5/5] RDMA/bnxt_re: Fix the locking while accessing the QP table Date: Tue, 17 Dec 2024 15:56:49 +0530 Message-ID: <20241217102649.1377704-6-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> References: <20241217102649.1377704-1-kalesh-anakkur.purayil@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Selvin Xavier QP table handling is synchronized with destroy QP and Async event from the HW. The same needs to be synchronized during create_qp also. Use the same lock in create_qp also. Fixes: 76d3ddff7153 ("RDMA/bnxt_re: synchronize the qp-handle table array") Fixes: f218d67ef004 ("RDMA/bnxt_re: Allow posting when QPs are in error") Fixes: 84cf229f4001 ("RDMA/bnxt_re: Fix the qp table indexing") Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 951ad90f5aa9..5336f74297f8 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -1181,9 +1181,11 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) rq->dbinfo.db = qp->dpi->dbr; rq->dbinfo.max_slot = bnxt_qplib_set_rq_max_slot(rq->wqe_size); } + spin_lock_bh(&rcfw->tbl_lock); tbl_indx = map_qp_id_to_tbl_indx(qp->id, rcfw); rcfw->qp_tbl[tbl_indx].qp_id = qp->id; rcfw->qp_tbl[tbl_indx].qp_handle = (void *)qp; + spin_unlock_bh(&rcfw->tbl_lock); return 0; fail: