Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2143266pxb; Mon, 12 Apr 2021 15:55:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl+113EQoepmRj18nxQaAt1+oa5sic9yBDWJKRs4ju+NtWmpQcIOO/NojLNf1MbJDMovkT X-Received: by 2002:a17:902:ff11:b029:eb:2a0b:fe4 with SMTP id f17-20020a170902ff11b02900eb2a0b0fe4mr251332plj.8.1618268149500; Mon, 12 Apr 2021 15:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618268149; cv=none; d=google.com; s=arc-20160816; b=g8j5mr0dnX5MPs/FHEhAhMEr2RdOcWyWaNQeY/YWZ3mU4agQi7aW9gR6KWu9CosO9J 7eFfvwWn9Eqz9s2cd7MvJwoVerSDkKagLtyJzfWAdJiCXx9XNj4S1VI3SxfNw0B9Re4Y hDCoy85oNq8dRWYHzcZ27B81gWnqB35ZCQ09Jk00lycLrMICpqleVFGJQTjFPO8R03M9 +UZBMWnnapKrRXwbhnKs+wmwCimpRh5kc/0C2yOseCnqJ0AyL7gg1qDF34Kbcw2fnd1x LxoG8ffWUFBf4g05thtjVXA8Bydy77EWgfHctw6xJxDkgyzcI7j+W83gpPsxSG+8M7kY jKFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=82VhWVUOAmVHBhU/Tha55L+RnJFk24zzeMWclSN/dTY=; b=vkYgeSJlP3uN2XgguuH8vSF8siSz1sKSU9MTeiVRwzW5MdBh91CZXCllNkntqSlr9C wvUBhezUOHO0UANlfoZtjGLGCvA2N1Lle137NtWXLJ4rG5hcNY3MS5SKXPHg/eZ52hNn bM/uovjG8vntv9eeM7h02GLgVFxP+RwAINtlWbo9H/wLF+91d+JaimYmiTXWaK35B62g w84+P4gUhwzKOadO4B69PD+z0nYLQtMcOguluocaDIz8zUKsUX9xFYQi3p4bfcLe1Diw TkSzVfyStGW7PN3a158qzxwHtLvIO+6tgXOuyHqAH2jIep3W19oYc02r1zBU3o8gVwsZ wy2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m70vEvQ2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay5si14947156plb.120.2021.04.12.15.55.36; Mon, 12 Apr 2021 15:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m70vEvQ2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243541AbhDLJmY (ORCPT + 99 others); Mon, 12 Apr 2021 05:42:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:35900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240629AbhDLJKs (ORCPT ); Mon, 12 Apr 2021 05:10:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C62BD61392; Mon, 12 Apr 2021 09:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618218363; bh=FUqgFfApoGjRxHq/MukDYLovoyFVuuo1SNIBrRck7qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m70vEvQ2nwddM9fijYFnuag5tywtZFmNyFcTehN2tDBdP35fc1J9CX7KHjqCPk/CP GUtFUP5aF5iaGxkVqsbSOAslPZOX41y0MkNF5ePK9iJRwhtRPvcjW/LkkqdXIXdYiB +t8z98t5LckrMP1GLctgz6IaRt7OONdJWthdJG4k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rahul Lakkireddy , "David S. Miller" , Sasha Levin Subject: [PATCH 5.11 134/210] cxgb4: avoid collecting SGE_QBASE regs during traffic Date: Mon, 12 Apr 2021 10:40:39 +0200 Message-Id: <20210412084020.472781383@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084016.009884719@linuxfoundation.org> References: <20210412084016.009884719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rahul Lakkireddy [ Upstream commit 1bfb3dea965ff9f6226fd1709338f227363b6061 ] Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX registers can lead to SGE missing doorbells under heavy traffic. So, only collect them when adapter is idle. Also update the regdump range to skip collecting these registers. Fixes: 80a95a80d358 ("cxgb4: collect SGE PF/VF queue map") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../net/ethernet/chelsio/cxgb4/cudbg_lib.c | 23 +++++++++++++++---- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 ++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c index 75474f810249..c5b0e725b238 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c @@ -1794,11 +1794,25 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, struct cudbg_buffer temp_buff = { 0 }; struct sge_qbase_reg_field *sge_qbase; struct ireg_buf *ch_sge_dbg; + u8 padap_running = 0; int i, rc; + u32 size; - rc = cudbg_get_buff(pdbg_init, dbg_buff, - sizeof(*ch_sge_dbg) * 2 + sizeof(*sge_qbase), - &temp_buff); + /* Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX regs can + * lead to SGE missing doorbells under heavy traffic. So, only + * collect them when adapter is idle. + */ + for_each_port(padap, i) { + padap_running = netif_running(padap->port[i]); + if (padap_running) + break; + } + + size = sizeof(*ch_sge_dbg) * 2; + if (!padap_running) + size += sizeof(*sge_qbase); + + rc = cudbg_get_buff(pdbg_init, dbg_buff, size, &temp_buff); if (rc) return rc; @@ -1820,7 +1834,8 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, ch_sge_dbg++; } - if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5) { + if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5 && + !padap_running) { sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg; /* 1 addr reg SGE_QBASE_INDEX and 4 data reg * SGE_QBASE_MAP[0-3] diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index 98d01a7497ec..581670dced6e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -2090,7 +2090,8 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size) 0x1190, 0x1194, 0x11a0, 0x11a4, 0x11b0, 0x11b4, - 0x11fc, 0x1274, + 0x11fc, 0x123c, + 0x1254, 0x1274, 0x1280, 0x133c, 0x1800, 0x18fc, 0x3000, 0x302c, -- 2.30.2