From patchwork Wed Dec 4 07:54:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13893366 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 C8171192D86 for ; Wed, 4 Dec 2024 07:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299097; cv=none; b=HhOtXmnpBQI1SW02zzKD1PGkOyLkJod/GQXL3w97Rad1URO/vWr/z4yeYyDfkBupPmoTHqDAs/19z6TqX6wYCSH7DeBcibDJu6867e3SzaRDeOMrLydQmMpRryHiT1qWygGXdMvyyKgpr8JFsDDeRT9mEIcrhrtnp1iTXm72A1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299097; c=relaxed/simple; bh=N/U60O4Ck0Nm6kaetMC4A7sNcfgISQ4eA1+dej1Ae8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dbBR7k/B6JafQvTImeHKCTwkpuh6DuGE6SBJorm4i14R4GiNMaSV9Kb4T+MO9uUg6o6ZTNalTTYJEcB2m8ur6bzT69bdaEP2Gs3J3XAA3SswLvjBwPLuN2CJbXpBuKoixAIgf36Fktq30VjAVfXDHGJ9Er8tzP3+te2fHI/nPFw= 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=eGZA4DIz; arc=none smtp.client-ip=209.85.214.173 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="eGZA4DIz" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2154e3af730so39722115ad.3 for ; Tue, 03 Dec 2024 23:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1733299094; x=1733903894; 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=bMwFjqYRs5rLhlVUhm9tYS8e6al8EfCryfrjNlOEgLM=; b=eGZA4DIzmN1VelDrRnUbkridjO//0i0h6KQBPJmXiE0Gd/B63KAijEjWwoxtdIoSpz mRAH38mQkf06iU9GXFRIPTDuUYU+F8XHzA7B+g/E7+kB/+4czcjHGRGfCp/IPDOilGBo iLlyFGrliO0POJmOKS1yXxhb4SBxR/SMXPYDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733299094; x=1733903894; 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=bMwFjqYRs5rLhlVUhm9tYS8e6al8EfCryfrjNlOEgLM=; b=uxzdqEU7aZ+CbFAedPOw1RAP7VZg8ytag+pn9EqnH7ejhSl/uNgi+ijUlgKYN0cS53 t0gKsQK7HQef0FqLktw4HQnyrpoezLVxJ/Yea5FCjb4BYu8L4paORJQxTndaZZtiNNBs o7EnoLtgVVItT2iXJRBSr5ZaF+mtO0wxdj9ZRBK47ZPb42qwCa1mOMUHQyOqIFX3evcv N8aqxOr2udsFZh/MEAoY8K1LnUeekYu4qG9w9UUK5gXH6Y3db6/aF20JQp8ImOKN9t6D n/gZl/0S/yqVmfIjfz1pIOFqweoHjwXW5M9y4MjfcpyioHL2tJs5d2GzLsbP8jyGLu35 7f/w== X-Gm-Message-State: AOJu0YzBOydCh9K5ctsLuYK7iW5vNAFJev6N/e81fin3dvw0IVD0FkGz +p+rR8fFlO5V+Pkalg5pTZrZXrIrvHvjWlNYcNXc+Q9hZ4xvbMAc5iI8pyFt/Q== X-Gm-Gg: ASbGnctcb9j8XEJWj3guCfbFi5K5O3Tu25LexSGDj2VkkYdn1MebSBcde1EzGEMUgC0 r6QoDKGMb1jTEJUVTQhiC4DhOWIUaNEbc8FA6c+Ff/cJQRp7RZUKSIzXnBp3yM7MGzvaXfc2VQ/ HNl/sTUd1Tp49i9D8O60+UQKTNfOQPRGkn1MaQFfceVeGESmywNZ8plA/IvNjInZExyqD+PS3Pb gFltiEoQxnX9fNsfxmZpry6ZQB0GXE7ssEoVbg1N9I+ZiJ8X/SWD4R3uTzeMnplwl4QnoFwgXWd f5dOEQTFvQekf5F5aMS7TFLdl+jjQDsfcGMP4g/8d+jrzQ+5xyPn X-Google-Smtp-Source: AGHT+IHgilz1ch7ILFLhcQan9NEElCaD5AJUXagnVy67K2DQGxswA5uR365qu9FiJI2FRoWRid9reQ== X-Received: by 2002:a17:902:d4ca:b0:215:b6f1:78df with SMTP id d9443c01a7336-215d003e862mr56650895ad.19.1733299094130; Tue, 03 Dec 2024 23:58:14 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21536d67e95sm95462235ad.76.2024.12.03.23.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 23:58: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, Kashyap Desai Subject: [PATCH for-rc 1/5] RDMA/bnxt_re: Fix max SGEs for the Work Request Date: Wed, 4 Dec 2024 13:24:12 +0530 Message-ID: <20241204075416.478431-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241204075416.478431-1-kalesh-anakkur.purayil@broadcom.com> References: <20241204075416.478431-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: Kashyap Desai Gen P7 supports up to 13 SGEs for now. WQE software structure can hold only 6 now. Since the max send sge is reported as 13, the stack can give requests up to 13 SGEs. This is causing traffic failures and system crashes. Use the define for max SGE supported for variable size. This will work for both static and variable WQEs. Fixes: 227f51743b61 ("RDMA/bnxt_re: Fix the max WQE size for static WQE support") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h index ef3424c81345..19e279871f10 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h @@ -114,7 +114,6 @@ struct bnxt_qplib_sge { u32 size; }; -#define BNXT_QPLIB_QP_MAX_SGL 6 struct bnxt_qplib_swq { u64 wr_id; int next_idx; @@ -154,7 +153,7 @@ struct bnxt_qplib_swqe { #define BNXT_QPLIB_SWQE_FLAGS_UC_FENCE BIT(2) #define BNXT_QPLIB_SWQE_FLAGS_SOLICIT_EVENT BIT(3) #define BNXT_QPLIB_SWQE_FLAGS_INLINE BIT(4) - struct bnxt_qplib_sge sg_list[BNXT_QPLIB_QP_MAX_SGL]; + struct bnxt_qplib_sge sg_list[BNXT_VAR_MAX_SGE]; int num_sge; /* Max inline data is 96 bytes */ u32 inline_len; From patchwork Wed Dec 4 07:54:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13893367 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 6999E1AB501 for ; Wed, 4 Dec 2024 07:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299101; cv=none; b=FxshPVsPsi0zeP32X9ilTLgEoibbSrTJXqF0tua39Usdzu3y5ZERroeF9Zlfm/vrmv0eYNnnYxw2e08c/Us5Z6ojqGGPnThDt1zmNVSfykhPlxB9US414bg+Wo6mmwB6C9cvrtkGoRdFnV1qiU6BrqLDZ+LeIpit5356Gd1QLVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299101; c=relaxed/simple; bh=2OS2zUTgtvDoh1fvmb2LNQUqY839JigLMxipLoSRvSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QLQYMqbKDsuzHxqXjep8P8CHzXd4gR9DJfc1mo5WjX0yE7F+pOWqxGnZL3ReQOV8Gu+ykTMowHx/T6ikFacLhPG1H9U2Dq75kQjMbiFVMyHmKtNHvRd7DCnwUODx1DKbUsRTwfjtgbNQgKt+mTZmX6HwCfuS3bbgsqkaIHZ+MN0= 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=fQEqtm6j; arc=none smtp.client-ip=209.85.214.179 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="fQEqtm6j" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-215513ea198so4625645ad.1 for ; Tue, 03 Dec 2024 23:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1733299098; x=1733903898; 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=L0GrmD7fuDxexIQTSHtiuTT8aeBAoifZAomwRb9faCw=; b=fQEqtm6jTsRAfw2i+bt+FZreIGgFMP3Otzv8Tf/BG4PplyF2vpNVWaI8OHhWspBOVf EOtIkzGZIGkPBcDzNYMqAkawNe9cga/qcH0O6/FoKBkHIw8+8hUY8drxCQeJaUOuMFlF W4ZhK1RcF50CnZlosrAN3cRrQPATs4HZosffE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733299098; x=1733903898; 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=L0GrmD7fuDxexIQTSHtiuTT8aeBAoifZAomwRb9faCw=; b=OI18VBf77HygkzzWay9FooIf3wb6ibTIQ89tN9ZcZYL2wrgkuO5M+B6LJ+QMZKFJLb I0atidGs8T+GMXDmRzjUCtXtOCFFOegXFyfeGHYqJQDUtRXGawBcQAvXRmjIomALLYGk y5HCSC8f+fDHLTr0L+dnq8wT1Nle4nJK66MAIEI+2KzvUn8od/qxthjKuIch70i3ZlVN LbTOSCGHDvzNlr6SNMMduL9YbwvN0SUme3FpK8bPUbI7cnbGuZ4JZj4rnJQMLfByXQ5E Vdx81jShPASoO46ZM5ztxCdGqsCguklx4Eik9RrTdzki0K93WM0Fb1gHzMPW/QOUgTiN OKuw== X-Gm-Message-State: AOJu0YyiHGMX6km8LvkDcIb1Fc5YSKXzGQd9lC6PKJs6XPZlu6ZDIiMH VDwKYsUqcOdBehRh+0zbUb5gQgHzg9ju5tVWiljYwmxySpe5ntOuKCdslkyoaw== X-Gm-Gg: ASbGncsVwXtcuocApjqfhwN3edECTDWadReeZFddsE/kfy0k22Mrf5MYYxa3y5c5wdI 8kNLkthkMjWEpUDm1YKLqqYmG99phdXmR/91cdFmTxSCuI+L1Rw/VhkITAg7lCR4pXWsXXV4avo OCo6dCy7urSOYZXD4M1epu7pr8pUPrcHwFhSV6XvcdSPY/0j8oyrcKTxf9VIE2KtYPdmr7G0csL Wu4tERhcIh3lpKAGUxgDcYOXtV7nHdXVqCxvR3Q20ayVxT0l6uK3zZ+up0iNt0TS/eH1syYCoFo zditPJeNmYL/mZ+RePneohy6lrV60saqI6EQ5Tqe40/1b7PTpCyl X-Google-Smtp-Source: AGHT+IHKJ/5Vd2rZ5QXxYn4QLV5HBX4GVpfCu74LlfVq1FUgP4TsIZo3xny6KqziGjPTaeED9TTZ7Q== X-Received: by 2002:a17:902:d4c9:b0:215:86c2:3ff4 with SMTP id d9443c01a7336-21586c243e0mr155713095ad.28.1733299097722; Tue, 03 Dec 2024 23:58:17 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21536d67e95sm95462235ad.76.2024.12.03.23.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 23:58:16 -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 2/5] RDMA/bnxt_re: Avoid initializing the software queue for user queues Date: Wed, 4 Dec 2024 13:24:13 +0530 Message-ID: <20241204075416.478431-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241204075416.478431-1-kalesh-anakkur.purayil@broadcom.com> References: <20241204075416.478431-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 Software Queues to hold the WRs needs to be created for only kernel queues. Avoid allocating the unnecessary memory for user Queues. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Fixes: 159fb4ceacd7 ("RDMA/bnxt_re: introduce a function to allocate swq") Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 42 +++++++++++++----------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index e42abf5be6c0..8c6a09ac14ef 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -659,13 +659,6 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, rc = bnxt_qplib_alloc_init_hwq(&srq->hwq, &hwq_attr); if (rc) return rc; - - srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), - GFP_KERNEL); - if (!srq->swq) { - rc = -ENOMEM; - goto fail; - } srq->dbinfo.flags = 0; bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req, CMDQ_BASE_OPCODE_CREATE_SRQ, @@ -694,9 +687,17 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, spin_lock_init(&srq->lock); srq->start_idx = 0; srq->last_idx = srq->hwq.max_elements - 1; - for (idx = 0; idx < srq->hwq.max_elements; idx++) - srq->swq[idx].next_idx = idx + 1; - srq->swq[srq->last_idx].next_idx = -1; + if (!srq->hwq.is_user) { + srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), + GFP_KERNEL); + if (!srq->swq) { + rc = -ENOMEM; + goto fail; + } + for (idx = 0; idx < srq->hwq.max_elements; idx++) + srq->swq[idx].next_idx = idx + 1; + srq->swq[srq->last_idx].next_idx = -1; + } srq->id = le32_to_cpu(resp.xid); srq->dbinfo.hwq = &srq->hwq; @@ -1044,13 +1045,14 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) if (rc) return rc; - rc = bnxt_qplib_alloc_init_swq(sq); - if (rc) - goto fail_sq; - - if (psn_sz) - bnxt_qplib_init_psn_ptr(qp, psn_sz); + if (!sq->hwq.is_user) { + rc = bnxt_qplib_alloc_init_swq(sq); + if (rc) + goto fail_sq; + if (psn_sz) + bnxt_qplib_init_psn_ptr(qp, psn_sz); + } req.sq_size = cpu_to_le32(bnxt_qplib_set_sq_size(sq, qp->wqe_mode)); pbl = &sq->hwq.pbl[PBL_LVL_0]; req.sq_pbl = cpu_to_le64(pbl->pg_map_arr[0]); @@ -1076,9 +1078,11 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) rc = bnxt_qplib_alloc_init_hwq(&rq->hwq, &hwq_attr); if (rc) goto sq_swq; - rc = bnxt_qplib_alloc_init_swq(rq); - if (rc) - goto fail_rq; + if (!rq->hwq.is_user) { + rc = bnxt_qplib_alloc_init_swq(rq); + if (rc) + goto fail_rq; + } req.rq_size = cpu_to_le32(rq->max_wqe); pbl = &rq->hwq.pbl[PBL_LVL_0]; From patchwork Wed Dec 4 07:54:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13893368 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (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 4B6B9192D86 for ; Wed, 4 Dec 2024 07:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299103; cv=none; b=hWiQMYwE4iqgTbDiybS9Y67f3waGys4ptSZXj+D1Vb+98TauN8AlPYODN7nDcGqxc0zMdvw0vYysUyVf9cmK9bbccTQcwFiItjzhmkxH9QoCS+ksdECziYpxlDRqsf5H0cEvkgW5sT9cjUAp41pMtceFEzMtAGvWsjzpamQZa/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299103; c=relaxed/simple; bh=OZ4wyRzHBU5rqcqF7W/lQKMHAgbC4+ZvqLu4lTxdGzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YFTWELiSXzudqJKlHd2hMuCYhkf002KnDT2R+zDOyMg2gdvR9SZNiYaOjsI0okgG1V5eGreYteV8Ae3Gg7rVCyUZ5MDZndoYEr54t498hVG+5y7DH37hbB3LKCTcocFTiUfwdXjDK/VYf0nC0vAA6smLjGJplGenRIQzzVcVHzs= 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=JO/73Rsf; arc=none smtp.client-ip=209.85.215.182 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="JO/73Rsf" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7fbc65f6c72so6083005a12.1 for ; Tue, 03 Dec 2024 23:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1733299101; x=1733903901; 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=hKecRt25vJsTpHaL0ZeHZfAhYJqkh6lLNdCQ7xdxmeg=; b=JO/73RsfUAIza4LEAGHc5iUNB7GJMJJWh1FSLIIlakN4KsQOx0JYCvZ23zUazc4eWF Ox79XtZwPhPCYtW2sG27hsW2f1iETx3vwiG1r+t5xammc7tvpFxLF+qVhYh4v1jezbXS AI5SadXqRNzgSnMDF5qGQS427mgpV8zbSur5k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733299101; x=1733903901; 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=hKecRt25vJsTpHaL0ZeHZfAhYJqkh6lLNdCQ7xdxmeg=; b=fHhGQDDg7A6IyFoU4bpqnYenTI0lMvYpClkGH+zCT6V3VtvoN5cprMS+WG6SL5lyeg wCUSS8VMtIp9WxVFcXSixAcTwf87t2hRRf1uibc5Gn5VXxTjGpWp038ssjDw20xxR7NN +xDDPOohvYhif26JqHGp9SPD1x7zb+8/WhYAHP7C0H34bPxFarySmFOUgn1+QL2C2WLQ M2hcWbb/GJlI+PPCrhTaZGdNIMWw9q5hm6Umx+kpRGV2Wu9pDFIOCgomXbhm6PwdcZ6o K/CZUdeIdLN1G0UWGwt+fwSAnavRNS947qaQSDzB44Rxnx3AXvqF6JUyPsixrZWDbPMi LIPA== X-Gm-Message-State: AOJu0Yx16yEuqnC7EO/i2VNIy9IaZL18p8vsMWcshumFx8vg0jJiBkiZ ISkGjkQNuUbNSuPkMbDwNCn6fJFg5mjVbbvlsgGYS1gQDm854wZjKKMrxv/zQQ== X-Gm-Gg: ASbGnctBQu94cYGZDXby5TxrTjUC3WY2Jgo2JSt5W5rc5ZIHjmFdqSfKCdQ48ou43lg 8gp/nFs6iXaxIeYdCLQhWRA6syVTvbyAPsdM3wBvHOjuVNf3ILj8JsoVm4s8lMf2qpzzuIV9hfr sgnT2HbDalXpYNVRKCDidezckCxGMqusVn9yb88X/GyrovlcMY7dl8McfvWN9YbURtqDOON0WeP M/gdfjTZxoXWtNh5FfURRXXuvt67bgHGnmyKKHuXXljyMbMQP19RgkulsSKP+V3k2mHfibgdK3P 0LlaDXuD6xdKlH53v6513U0ukWuUd+1JQakkT7Une+bvfHVNoLBW X-Google-Smtp-Source: AGHT+IHYJ1ZI23dyeyUS9wlX0ia4NwPLoK+Av3FGLpFPGLPi4reUSdkkwYq1V8f4bAjzW8LGiJ4Q/g== X-Received: by 2002:a05:6a20:9188:b0:1db:f057:151d with SMTP id adf61e73a8af0-1e1653f2632mr7389513637.35.1733299101575; Tue, 03 Dec 2024 23:58:21 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21536d67e95sm95462235ad.76.2024.12.03.23.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 23:58:19 -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, Kashyap Desai Subject: [PATCH for-rc 3/5] RDMA/bnxt_re: Avoid sending the modify QP workaround for latest adapters Date: Wed, 4 Dec 2024 13:24:14 +0530 Message-ID: <20241204075416.478431-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241204075416.478431-1-kalesh-anakkur.purayil@broadcom.com> References: <20241204075416.478431-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: Kashyap Desai The workaround to modify the UD QP from RTS to RTS is required only for older adapters. Issuing this for latest adapters can caus some unexpected behavior. Fix it Fixes: 1801d87b3598 ("RDMA/bnxt_re: Support new 5760X P7 devices") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 82023394e330..5428a1408cee 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -2824,7 +2824,8 @@ static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev, wr = wr->next; } bnxt_qplib_post_send_db(&qp->qplib_qp); - bnxt_ud_qp_hw_stall_workaround(qp); + if (!bnxt_qplib_is_chip_gen_p5_p7(qp->rdev->chip_ctx)) + bnxt_ud_qp_hw_stall_workaround(qp); spin_unlock_irqrestore(&qp->sq_lock, flags); return rc; } @@ -2936,7 +2937,8 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr, wr = wr->next; } bnxt_qplib_post_send_db(&qp->qplib_qp); - bnxt_ud_qp_hw_stall_workaround(qp); + if (!bnxt_qplib_is_chip_gen_p5_p7(qp->rdev->chip_ctx)) + bnxt_ud_qp_hw_stall_workaround(qp); spin_unlock_irqrestore(&qp->sq_lock, flags); return rc; From patchwork Wed Dec 4 07:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13893369 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 2459A1AB507 for ; Wed, 4 Dec 2024 07:58:24 +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=1733299106; cv=none; b=h/cAuz+AegtG3j7tWkU1mzGS2FBI+QvkDHyHDmKLZZ1nAV4M1vAM8RPR3OUCySnJ93y05DxcLP+FFc1D40AXJULpPs1HwYEZvr4n25CatAF2Exr8gwazhMGHZXUi9u8pKr81UGGVGK/pZICDx6wyRnqKgB12AOqUUSAZ3D6gAe0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299106; c=relaxed/simple; bh=0AUgE1XLpNSRrWqknjC6w8a9mTjMITV/m04kpyO7nUU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X4pf/CDJ+GfTi774i2RhZhU030C88C/ON/WsJWlcNgQKceUusxVVaKDeDstkGtp11XLs5s1QysDQpMB6bDFEzayovbr9vZj16y3P8I7tOezblmG2yE+SXXHFSeCM+hp87HgXpgdmh8FI7vkWsr2B3nVMnJzyMrottwE13hlAboM= 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=XHr9cZAM; 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="XHr9cZAM" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-7fcc8533607so2502795a12.0 for ; Tue, 03 Dec 2024 23:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1733299104; x=1733903904; 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=y28z4x12nd1yE+fAapxIoTKDGpVRUmQlIwTCyRc3HSc=; b=XHr9cZAM9K2z3Yq6texLLRrjRn5E/VcyCsPCracG1es1sq6gKbNaTRs154tXqFD5/A /Ujd3SOr+PYW52LtGH9yP1Bqd8dpDKvTP6iv4Mt6MsGzdbE418wtz92keGNzVU0PX8SO LOduA2YdlhXmQ0tOQaBwYWyB688sKZ3WL0IpI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733299104; x=1733903904; 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=y28z4x12nd1yE+fAapxIoTKDGpVRUmQlIwTCyRc3HSc=; b=Q0By+k5karq6KGt+GEYuHVNLoP/kT8kDJSGDyVjEyjSPqzU5DNcaM28Oavs75G0Kc9 n7FltlecWBgnJWRB6ua2O59ZQUb2dXZsEkrSPjtnJWH0WrmX8Gdk4GKRN6h3mhAJbPnx gz43x/7Epv3Bd/y9OHJRZIfRhFliagfiU4ttsL1HEDF8S1ImEJW5P4m30vKegJ4lmDKF irYEKa1QK2ezW4B5lsXezH+fsJpCnpgcaBQH54g/SpdTIsFq9UPLEOr+XgNhMfGeBqVS zW/71XetVn+AxLo5TCLlg0+4J9wP45y+HHv95cbV4A7vhDnrOq0J77L98wiMz6T7Wnfs k08Q== X-Gm-Message-State: AOJu0Yy5P89wzbU8HhZkFjzxTzIJoMQvIkJHNVNs3wmyltPRJHNkkdR9 xMDHl1eogIra4VPRTeLhf9QoZgfQj28pF1FFTht3JElnt43b41GlhD5wu/h1yg== X-Gm-Gg: ASbGncufeHcnJRH7DZGs+vsTzq9Vg+mZF2ROvppYIAta6zPxgSbyIhhW4fRVvyg9F9T krQElTinGsHyJ3SWTJWm6xNnq0wdaqioKhlQA3LgRlV9nGON2rJuGaPfqsCn6nVe5wf5ykhHDgr eqt/CO0BEmJPQbogA9WSzScO4hM71vc/1wHYyVAK6BTglQb7fYnnLEtChgBUtOup7LD1ZKzkmZD 9BgkibIP+q9oXYFD/SSdx1vlbKyseFPQw4gA7CpZ0oBAdK3qc2uo/KbJ8fce9SrVrJAOr0P19XO mK12rqw7RzEFynSZ8nlvLLK2B1qAKttd8qK/TPKR6gCnXnHUQ9WO X-Google-Smtp-Source: AGHT+IHnjob4t2N5tj4QPhw9+p76RUrHIwZtktWajJ9bi/2FI1t6qVv8bMrbdAMUVRtyR/xrmUVrLQ== X-Received: by 2002:a05:6a20:8421:b0:1e0:d618:1fba with SMTP id adf61e73a8af0-1e165337768mr6932356637.0.1733299104405; Tue, 03 Dec 2024 23:58:24 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21536d67e95sm95462235ad.76.2024.12.03.23.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 23:58:23 -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 , Kashyap Desai Subject: [PATCH for-rc 4/5] RDMA/bnxt_re: Fix error recovery sequence Date: Wed, 4 Dec 2024 13:24:15 +0530 Message-ID: <20241204075416.478431-5-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241204075416.478431-1-kalesh-anakkur.purayil@broadcom.com> References: <20241204075416.478431-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 Fixed to return ENXIO from __send_message_basic_sanity() to indicate that device is in error state. In the case of ERR_DEVICE_DETACHED state, the driver should not post the commands to the firmware as it will time out eventually. Removed bnxt_re_modify_qp() call from bnxt_re_dev_stop() as it is a no-op. Fixes: cc5b9b48d447 ("RDMA/bnxt_re: Recover the device when FW error is detected") Reviewed-by: Kashyap Desai Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 8 +------- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 7 ++++--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 3 +++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index b7af0d5ff3b6..c143f273b759 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1715,11 +1715,8 @@ static bool bnxt_re_is_qp1_or_shadow_qp(struct bnxt_re_dev *rdev, static void bnxt_re_dev_stop(struct bnxt_re_dev *rdev) { - int mask = IB_QP_STATE; - struct ib_qp_attr qp_attr; struct bnxt_re_qp *qp; - qp_attr.qp_state = IB_QPS_ERR; mutex_lock(&rdev->qp_lock); list_for_each_entry(qp, &rdev->qp_list, list) { /* Modify the state of all QPs except QP1/Shadow QP */ @@ -1727,12 +1724,9 @@ static void bnxt_re_dev_stop(struct bnxt_re_dev *rdev) if (qp->qplib_qp.state != CMDQ_MODIFY_QP_NEW_STATE_RESET && qp->qplib_qp.state != - CMDQ_MODIFY_QP_NEW_STATE_ERR) { + CMDQ_MODIFY_QP_NEW_STATE_ERR) bnxt_re_dispatch_event(&rdev->ibdev, &qp->ib_qp, 1, IB_EVENT_QP_FATAL); - bnxt_re_modify_qp(&qp->ib_qp, &qp_attr, mask, - NULL); - } } } mutex_unlock(&rdev->qp_lock); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index 5e90ea232de8..c8e65169f58a 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -423,8 +423,9 @@ static int __send_message_basic_sanity(struct bnxt_qplib_rcfw *rcfw, cmdq = &rcfw->cmdq; /* Prevent posting if f/w is not in a state to process */ - if (test_bit(ERR_DEVICE_DETACHED, &rcfw->cmdq.flags)) - return bnxt_qplib_map_rc(opcode); + if (RCFW_NO_FW_ACCESS(rcfw)) + return -ENXIO; + if (test_bit(FIRMWARE_STALL_DETECTED, &cmdq->flags)) return -ETIMEDOUT; @@ -493,7 +494,7 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw, rc = __send_message_basic_sanity(rcfw, msg, opcode); if (rc) - return rc; + return rc == -ENXIO ? bnxt_qplib_map_rc(opcode) : rc; rc = __send_message(rcfw, msg, opcode); if (rc) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h index 88814cb3aa74..4f7d800e35c3 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h @@ -129,6 +129,9 @@ static inline u32 bnxt_qplib_set_cmd_slots(struct cmdq_base *req) #define RCFW_MAX_COOKIE_VALUE (BNXT_QPLIB_CMDQE_MAX_CNT - 1) #define RCFW_CMD_IS_BLOCKING 0x8000 +#define RCFW_NO_FW_ACCESS(rcfw) \ + (test_bit(ERR_DEVICE_DETACHED, &(rcfw)->cmdq.flags) || \ + pci_channel_offline((rcfw)->pdev)) #define HWRM_VERSION_DEV_ATTR_MAX_DPI 0x1000A0000000DULL /* HWRM version 1.10.3.18 */ From patchwork Wed Dec 4 07:54:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh AP X-Patchwork-Id: 13893370 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 2833D1AB530 for ; Wed, 4 Dec 2024 07:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299109; cv=none; b=kaiX1HMudIakj1XO1reJrfDG+uOI1EWfvhRxpZY7MFMg8W+taDrw/S1d2msPVRzkS4aj9OkIL0tDGHewsJYrAEXoyZ4dT0oaUP/cN7aXz4QZsQt6d5FGqBv71TYM8h/o2xBgBehkTyxDe+fP+KiljJgS39iC7h6RnMOpGwYuexA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733299109; c=relaxed/simple; bh=AXGTuJTqZOAIQI/HKQLVnb/MAJepzGSCrEd0wGlSDaM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lwUtNrNZGOvI27ExAJLbUb3Pm8QTupsmkx3RHz0hRGGA+xpcTgrP5XZ6Hl/zSxLes+x3J0EKuJtiCNOQWJR31sD8T9rq+uUEtx6R/UbzMu43PmJCScUX6d2jShtgpozrI4vgvPOw3uL/gIKABXH56l/TtKqIjBvA9u5k5rqx95Q= 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=MeagM2nd; arc=none smtp.client-ip=209.85.210.172 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="MeagM2nd" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-724e7d5d5b2so6147726b3a.2 for ; Tue, 03 Dec 2024 23:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1733299107; x=1733903907; 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=1bAcPRtGaQrVg6bRpvOXOISCpRJ+uX1CF4h9ob/a/Ws=; b=MeagM2ndEKdtSvdWf9sE+RajJCI7pU15piRBYxwRPfthsPO2T3pSjtN8iOwUhQ8dvW MkRC/97Xm5ONTtzFqsohsUtig3X0oxtuMB6TuTbh/eUfNup5s21UbGZN0OITJ2n92z2m b4J4E7YDAlBLFiW9BueliK9khSmO8LQKlSMzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733299107; x=1733903907; 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=1bAcPRtGaQrVg6bRpvOXOISCpRJ+uX1CF4h9ob/a/Ws=; b=enmH31chKs3vuwilGPAYz0lxrNWoHDOoeZtkxBenLlwbcUvxM4efFvIt4bhWSfitGz 6OV/TzYSoF/CBC/MFNLmfocXZp9N1crOOJkzWZftPEtyTqIhb8zSGUTb+ylQ/cipbPHZ CzqmMZoHUNggKOtSLMf1gYqxArp6lWGq5Lce6sxc4b5XvUXTV+LaQ1D+OLnA3ztfT0SS H6K15mnO8GIZCc7OwDJImCGwuSckQsOylzQ/35nCqDF/GADH3QxEJpgprHdoLkH4cKWA 4mHTOI2kBFBpD+LV43ihN/wK/DZEguINAbEpFmyIgKTzwiSANIaxoMXFE0eJSZlXVig7 Uevg== X-Gm-Message-State: AOJu0Yz+e7ILn1bNpiWZox3ouedkZZypmzI7LJGrxJBaAI3TAjVSLnmH KhTEBUFMC7dRc7at9UnA0EYXWUCTdPFIGm08c/oFlWsCKNtia9kqmRdTZLCeqg== X-Gm-Gg: ASbGncvnknVUDOVc/nk0pjtde7l7vMlKYAZd8usdbnbvp8UOwMTLcYs9uS/1lAtS0BU /BKPyoqrNIgFJuYuiRFItkQ9RIktB5TPAj2Q2kj0LngiQwY7E3YuwlIys/YzWJT0BlSoE65H2Dl bgNYFzaR4GK3ye4SK5KMcEe8cD2jl//IjsISUSLAMr3SS6XiV5Xz6FD0OTUnvGKdwvv/OKL69eY TqS5TUk5LVOW7w8NmLnoohe8HN3w/zZSZFF6WfWJn2Q6UoDMYum0DJq/d3XFEtd9mKL6CzPrhsd il0NdXBZ/HLAz5NssNKp0ICvX/uHFcBD7owSLwWzBWz3IwZ9aGrL X-Google-Smtp-Source: AGHT+IFTqxFShNT2Gi7Y0gifp3UHHx5hp6pXTo4ZoRRmFQ+FrESZsWaJO6N7GPgYBDIHhkRbb1uyLw== X-Received: by 2002:a17:902:cecc:b0:215:a3e3:c86a with SMTP id d9443c01a7336-215bc426617mr87959035ad.0.1733299107322; Tue, 03 Dec 2024 23:58:27 -0800 (PST) Received: from dhcp-10-123-157-228.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21536d67e95sm95462235ad.76.2024.12.03.23.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 23:58:26 -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 , Kashyap Desai Subject: [PATCH for-rc 5/5] RDMA/bnxt_re: Fix bnxt_re_destroy_qp() Date: Wed, 4 Dec 2024 13:24:16 +0530 Message-ID: <20241204075416.478431-6-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241204075416.478431-1-kalesh-anakkur.purayil@broadcom.com> References: <20241204075416.478431-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 1. Fixed to return 0 always from bnxt_re_destroy_qp(). 2. Moved the code to delete QP debufgs dentries to the beginning of the function. Fixes: d7d54769c042 ("RDMA/bnxt_re: Add debugfs hook in the driver") Reviewed-by: Kashyap Desai Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 5428a1408cee..215074c0860b 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -967,13 +967,13 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata) unsigned int flags; int rc; + bnxt_re_debug_rem_qpinfo(rdev, qp); + bnxt_qplib_flush_cqn_wq(&qp->qplib_qp); rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp); - if (rc) { + if (rc) ibdev_err(&rdev->ibdev, "Failed to destroy HW QP"); - return rc; - } if (rdma_is_kernel_res(&qp->ib_qp.res)) { flags = bnxt_re_lock_cqs(qp); @@ -983,11 +983,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata) bnxt_qplib_free_qp_res(&rdev->qplib_res, &qp->qplib_qp); - if (ib_qp->qp_type == IB_QPT_GSI && rdev->gsi_ctx.gsi_sqp) { - rc = bnxt_re_destroy_gsi_sqp(qp); - if (rc) - return rc; - } + if (ib_qp->qp_type == IB_QPT_GSI && rdev->gsi_ctx.gsi_sqp) + bnxt_re_destroy_gsi_sqp(qp); mutex_lock(&rdev->qp_lock); list_del(&qp->list); @@ -998,8 +995,6 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata) else if (qp->qplib_qp.type == CMDQ_CREATE_QP_TYPE_UD) atomic_dec(&rdev->stats.res.ud_qp_count); - bnxt_re_debug_rem_qpinfo(rdev, qp); - ib_umem_release(qp->rumem); ib_umem_release(qp->sumem);