From patchwork Fri Nov 15 08:47:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13875998 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) (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 57A2F188A3A for ; Fri, 15 Nov 2024 09:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731661715; cv=none; b=TmMKN87ucztUaLZEG+r9u1ha3dEUNNnkLOYBavagDym1J3n8qpa2BjkFOqBkyIUArjXZz1C9eU/zIsdxfwvK8j2+THrYiascd6v1A5OnKCFLHrUHWJZMoM+jPoy6cek0ugVxkVY96lE0qj0PezEwXc6tufiHt6ufC3r2oF/sQko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731661715; c=relaxed/simple; bh=jO+6wrlHF7JEkrR57DxrmHttnb9NFFYqU2jKUtuEMdA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=E3brQxjVggBkYea0nSU255OOM5jCalasCQ1U8XZ8d23w/pu7XuUQ3KhRtMpZc7RFso74iwjrt/KOdue/kKjupXHMtIr//IUiCfWVVCep+tQylGKrEkE9nI/4XjmZTE9QsRih2mnQmYQsFaPZdr991vRf9ev2qWifIAMaOuKsDpM= 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=PJATuAiM; arc=none smtp.client-ip=209.85.210.193 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="PJATuAiM" Received: by mail-pf1-f193.google.com with SMTP id d2e1a72fcca58-720c286bcd6so1398757b3a.3 for ; Fri, 15 Nov 2024 01:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1731661713; x=1732266513; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=dg/hdqJktBcdJNz2xR56FmxvAVyE+yddqh0hutwjZ44=; b=PJATuAiM9YHaKjsuPn1WTDtapWvuJ07V/rVn0Ho8S5Z5E8qga2A+JVPbuFybCwO8gh gCs9M3abr7zVJcKmBDVhlPtnw2iNnsyd/jZR1nDqTEnJRWUbZvUfHtvciyTebKyuZxn8 rxyYHWDFvJGVB1xuM6hiUIJBQWF8SPutSelrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731661713; x=1732266513; h=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=dg/hdqJktBcdJNz2xR56FmxvAVyE+yddqh0hutwjZ44=; b=VwaBblkoYajm1h1UPWlqBkCMVgPHL5GgqG9G8z+FUPFjKodYHsAVPDoU3PyAQi4j1q q24n0/SOZ0HZcI3dKBV5kj/aWgrTMvBmHC/kiLFEa1U4ztC8Bssg1oUY2t2KU3Vxnypd T9JZeD94QRAR85uz2xPPFqCMeHesPg0Fnhmo6FvgJVvIs25wpvv1o/uPNHmBF/X8COQB p8KyXcVKecWIT8KeH17GKuJBEM+Hm3asFgiz0EMARPHLDASbjn4eCIgKQCLJoI/ijnwh IYd12WrfDD9cW56i8si5rpWnH0zl8SXgfhWehw6IPDt1QIdJ8l0/+FUDzQTDf5jaEYj2 xgFg== X-Gm-Message-State: AOJu0Yys8llooFfxcY2X7iRjTy+aV8oQoI1hq7vRaFejGRHR1vzg3vP0 uzLNG9gsWS0nLrF8ayR2AQZQIaQa00nkbeDsgmCG7P+dp1APoL8YOFEh75JD6Q== X-Google-Smtp-Source: AGHT+IE+rx3zQYPKHhNBRB++8EY3MtAPuEYRkh34QwWxbGH3KEgdDyHCqtiJYJypZ2UuJKLtoN+UyA== X-Received: by 2002:a05:6a00:1393:b0:71e:7b8a:5953 with SMTP id d2e1a72fcca58-72476cb4154mr2298431b3a.24.1731661713529; Fri, 15 Nov 2024 01:08:33 -0800 (PST) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7247711de6fsm927926b3a.61.2024.11.15.01.08.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2024 01:08:32 -0800 (PST) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Chandramohan Akula , Selvin Xavier Subject: [PATCH rdma-next 1/3] RDMA/bnxt_re: Support different traffic class Date: Fri, 15 Nov 2024 00:47:42 -0800 Message-Id: <1731660464-27838-2-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1731660464-27838-1-git-send-email-selvin.xavier@broadcom.com> References: <1731660464-27838-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Chandramohan Akula Adding support for different traffic class passed to driver. Fix the traffic class setting in modify_qp by skipping the ECN bits. Pass the service level received from applications to the firmware. Signed-off-by: Chandramohan Akula Reviewed-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index f6e9eef..481261f 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -2136,7 +2136,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, qp->qplib_qp.ah.sgid_index = ctx->idx; qp->qplib_qp.ah.host_sgid_index = grh->sgid_index; qp->qplib_qp.ah.hop_limit = grh->hop_limit; - qp->qplib_qp.ah.traffic_class = grh->traffic_class; + qp->qplib_qp.ah.traffic_class = grh->traffic_class >> 2; qp->qplib_qp.ah.sl = rdma_ah_get_sl(&qp_attr->ah_attr); ether_addr_copy(qp->qplib_qp.ah.dmac, qp_attr->ah_attr.roce.dmac); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index e56f42f..256c437 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -1318,6 +1318,7 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) struct creq_modify_qp_resp resp = {}; struct bnxt_qplib_cmdqmsg msg = {}; struct cmdq_modify_qp req = {}; + u16 vlan_pcp_vlan_dei_vlan_id; u32 temp32[4]; u32 bmask; int rc; @@ -1414,7 +1415,16 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) if (bmask & CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID) req.dest_qp_id = cpu_to_le32(qp->dest_qpn); - req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(qp->vlan_id); + if (bmask & CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID) { + vlan_pcp_vlan_dei_vlan_id = + ((res->sgid_tbl.tbl[qp->ah.sgid_index].vlan_id << + CMDQ_MODIFY_QP_VLAN_ID_SFT) & + CMDQ_MODIFY_QP_VLAN_ID_MASK); + vlan_pcp_vlan_dei_vlan_id |= + ((qp->ah.sl << CMDQ_MODIFY_QP_VLAN_PCP_SFT) & + CMDQ_MODIFY_QP_VLAN_PCP_MASK); + req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(vlan_pcp_vlan_dei_vlan_id); + } bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), sizeof(resp), 0); rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); From patchwork Fri Nov 15 08:47:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13875999 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 1972018A921 for ; Fri, 15 Nov 2024 09:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731661719; cv=none; b=mA57CtihXN8fJeff+QsUT0qnEsAz0VuEEmItamMjr9ZmJYdeRnqsk1H26dJtP5dA0qfKTLDlAoKepaOHZh3i43xIkv03jQewaX32D8+HuutHHuQIwETY/OCfyVJVzH+gTUn84DnVvASJ2L1xUVTSYdbNpsTIFcN/c65ANO4f0no= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731661719; c=relaxed/simple; bh=1E4Npxr/tCCfKchje+vXHKVdPoyh5tkpa/IeXb4tFGQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=o9jD3+Xs+TTDiwozlbMBH9SDf0b5PcuFEj791tGM51T0K6okF9KHsO7m9UJGt2bVltebAl4dpyl0sX4ylwYJW/NckCSMDezCM0FiUZvEFDXQ0XxwgPBlZJiWNj+rT04GfKYJM7vFqvILnjRA9xz3WhtPUVRfGyGraT9GgTIQqkI= 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=SQ+vTZ85; arc=none smtp.client-ip=209.85.210.176 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="SQ+vTZ85" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-71e49ad46b1so1232153b3a.1 for ; Fri, 15 Nov 2024 01:08:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1731661716; x=1732266516; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=23uSOGq4VRiGNcux5BW7xUZZAjH/eVPIOTZBgGxxPk8=; b=SQ+vTZ85dog336MYUYXg2zsg+0JH4FUSK31SAi05YildItoLHD6gYeCSG6XJWByLU+ DBqD6J9trBDio9I0SY0DNyFMyyzGOxVfUBvmLflvBY61xRexRIb2E3Iwrx1yZODD5vq+ O3WVxYG2dgyFbrxTH4y5Y9hlNjVb3+Fc9CRGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731661716; x=1732266516; h=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=23uSOGq4VRiGNcux5BW7xUZZAjH/eVPIOTZBgGxxPk8=; b=mwL5YJ/4F7kmk+F+CiPAbfnsUODDgIO4ewS/ZuKCScoJs02IssgpvFDVy1RmDBfDnF q3MdqshHG+umbUi37RIyz9gJr4gpDW6aTKY40pr872G8/JRvZumpUVZSzg2qFZeqghUU cqYOad/WdPIf5F23AGTSUB9jr4mbrN4tbVEp4375pjaMPzXVKA1EXwPr9L9NVEBgAlPc uSc3KcPQF/jwXXzCLKVathiQNVq5P4H500qXc9G3zv14g5yxUUsGJpPi1gbfIrpYEDBp X+akWQmUs4Gp02Q6oaFwJq4c2qrZNWZpujY9BfHWL55eHIVRSjcMH9RE5H+GWHd/ZMpF hE1Q== X-Gm-Message-State: AOJu0YyjeWc/S6X0iOb1T11d+GP6Q2Af5qCIjsMEYVfam8LelTlxO1GP dImUFRuWrfth0ietD7LJ5gax9IDoKaeUWVX57rTKZJH2GrgRykdMQ7ddQRkGMQ== X-Google-Smtp-Source: AGHT+IGi9+TIoLJwXUQ7W89ohz1IOKUMOw/U71Sthro7CxppLGLX+VuEyAZ4xq8cEVyhEyr2CTEOTw== X-Received: by 2002:a05:6a00:4b54:b0:71e:7046:c0f8 with SMTP id d2e1a72fcca58-72476f7c766mr2179185b3a.26.1731661716322; Fri, 15 Nov 2024 01:08:36 -0800 (PST) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7247711de6fsm927926b3a.61.2024.11.15.01.08.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2024 01:08:35 -0800 (PST) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Selvin Xavier Subject: [PATCH rdma-next 2/3] RDMA/bnxt_re: Use the default mode of congestion control Date: Fri, 15 Nov 2024 00:47:43 -0800 Message-Id: <1731660464-27838-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1731660464-27838-1-git-send-email-selvin.xavier@broadcom.com> References: <1731660464-27838-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Kalesh AP Instead of driver setting the congestion mode, use the default values setup by Firmware. Enable the tos_ecn field in FW. Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 533b9f1..ac475a5 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -2204,11 +2204,10 @@ static void bnxt_re_setup_cc(struct bnxt_re_dev *rdev, bool enable) if (enable) { cc_param.enable = 1; - cc_param.cc_mode = CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE; + cc_param.tos_ecn = 1; } - cc_param.mask = (CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE | - CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC | + cc_param.mask = (CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC | CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN); if (bnxt_qplib_modify_cc(&rdev->qplib_res, &cc_param)) From patchwork Fri Nov 15 08:47:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13876000 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 E92BD18A921 for ; Fri, 15 Nov 2024 09:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731661721; cv=none; b=cI39w14YAP1q9+9YN80VH8JH2N5vTgvWFlvGw9bO7bgUOrAQri4E3QoZ/Foq22eWQa18i/TAj3vs/dKUxKntO0/SFDJorShO7fk7lY43fkDKY98q2ODub18nhW9/CxKnZ79gI3/MA+r73qhGs9/BoIHLsCxR6E1Y6EYigJIe2xM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731661721; c=relaxed/simple; bh=9YWyQijakN6yxlNi7fIXw+zKYwmYWEeVNC+DN8hOGCw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=CYkFUr/bR+bn9i3TJgCWzrK0vOaFRBVmO7sHaa2CT9Zc8rL0KTnJndq5nVb8Ap0nPzsMkasWCW8UrPLAuYwKHLrsiESnxk82tXWDnVqCAthx4jDMyL/1BaiK0S/KbXoNH5oDoLOobvgR1hfeERr7oqeOIZ9oAn7uJiSlZ3uIdVI= 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=VWFwuY+G; arc=none smtp.client-ip=209.85.214.177 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="VWFwuY+G" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20cbcd71012so17905895ad.3 for ; Fri, 15 Nov 2024 01:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1731661719; x=1732266519; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=nwwn07WZtHcYYP9qzKrphGOfuAzqu4Qi0nlfBqS8iBs=; b=VWFwuY+Gwg7SuBIbplKdrmHt9UQOd+tvXjtk8S/e6Z/F2WAg3SEJgTcFvKLAbkahgJ oXM/lCpT6tdzzEESS56BwrCxbhJH7Ny2OEpkUPXHonvt87k1djPX7OSwJ96ybs81EV+Y N/yN4TYJm7oo8ub/f0G9SEOxghrxdlfr+Aa60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731661719; x=1732266519; h=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=nwwn07WZtHcYYP9qzKrphGOfuAzqu4Qi0nlfBqS8iBs=; b=n68g3FWoLUWQOGlPlamGriBSu4G9eXrOQCcak2nRCQiHY3M61UlgSJ1jPi+yj/01+b d4DCLKxryLFeWudPVTikH3K/lPeEzLPdkzCcurigX9y4JNvmm2o1/vZUaQVW7q7frfpt a7lPYHK94c1xtrLM8U/EOxsIhD6b5MuKk8twVolhRDXzWO8ij+Q2jLjrQwfYq1M8+A9M ug9BFkXsgbY3uutPxvjoP9GvkVhHA6x36Tn5hwm2oljzDUvgO5s6qb3lPLMI/C5h5qi+ o+A+aJ5ReXGen1krcUv+fTnv+MroLsWg9C9a33fhdEJZMMtHAwz2UpsI/F0SThhT0js8 8wog== X-Gm-Message-State: AOJu0YyIJeUfXeR+MFd7g3vIpCGV1F2NcCtxgOPtLmmeI9Q/B0ub7gld yjEo46ukodCWj2KTgq2+60inlEivnP5cewD+fwHSFCbRCwQrF4+B+uZqPDpPPQ== X-Google-Smtp-Source: AGHT+IHTdZjF+hItL1G7U9Ar8syZdFnRE58qw3HjEjZ/ts1naE12MYE6EJi5Oo9Gzx74JUd8pUBNyg== X-Received: by 2002:a05:6a20:2593:b0:1db:ec07:3436 with SMTP id adf61e73a8af0-1dc90afc6f5mr2557268637.9.1731661719054; Fri, 15 Nov 2024 01:08:39 -0800 (PST) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7247711de6fsm927926b3a.61.2024.11.15.01.08.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2024 01:08:38 -0800 (PST) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Selvin Xavier Subject: [PATCH rdma-next 3/3] RDMA/bnxt_re: Correct the sequence of device suspend Date: Fri, 15 Nov 2024 00:47:44 -0800 Message-Id: <1731660464-27838-4-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1731660464-27838-1-git-send-email-selvin.xavier@broadcom.com> References: <1731660464-27838-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Kalesh AP When in fatal error condition, mark device as detached first and then complete all pending HWRM commands as firmware is not going to process them and eventually time out. Move the device to error only if suspend is called when device is in Fatal state. Also, remove some outdated comments. Remove the stop_irq call which is no longer required. Fixes: cc5b9b48d447 ("RDMA/bnxt_re: Recover the device when FW error is detected") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index ac475a5..298c848 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -2347,12 +2347,6 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state) rdev = en_info->rdev; en_dev = en_info->en_dev; mutex_lock(&bnxt_re_mutex); - /* L2 driver may invoke this callback during device error/crash or device - * reset. Current RoCE driver doesn't recover the device in case of - * error. Handle the error by dispatching fatal events to all qps - * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as - * L2 driver want to modify the MSIx table. - */ ibdev_info(&rdev->ibdev, "Handle device suspend call"); /* Check the current device state from bnxt_en_dev and move the @@ -2360,17 +2354,12 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state) * This prevents more commands to HW during clean-up, * in case the device is already in error. */ - if (test_bit(BNXT_STATE_FW_FATAL_COND, &rdev->en_dev->en_state)) + if (test_bit(BNXT_STATE_FW_FATAL_COND, &rdev->en_dev->en_state)) { set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags); - - bnxt_re_dev_stop(rdev); - bnxt_re_stop_irq(adev); - /* Move the device states to detached and avoid sending any more - * commands to HW - */ - set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags); - set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags); - wake_up_all(&rdev->rcfw.cmdq.waitq); + set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags); + wake_up_all(&rdev->rcfw.cmdq.waitq); + bnxt_re_dev_stop(rdev); + } if (rdev->pacing.dbr_pacing) bnxt_re_set_pacing_dev_state(rdev); @@ -2392,13 +2381,6 @@ static int bnxt_re_resume(struct auxiliary_device *adev) return 0; mutex_lock(&bnxt_re_mutex); - /* L2 driver may invoke this callback during device recovery, resume. - * reset. Current RoCE driver doesn't recover the device in case of - * error. Handle the error by dispatching fatal events to all qps - * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as - * L2 driver want to modify the MSIx table. - */ - bnxt_re_add_device(adev, BNXT_RE_POST_RECOVERY_INIT); rdev = en_info->rdev; ibdev_info(&rdev->ibdev, "Device resume completed");