Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp460288yba; Wed, 15 May 2019 04:30:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlide8bESjFKWP/jRg1PQ+2uTUYG5SZNTBnTyG8UCd1vecJcfiTi0xsb/MRtLigoLrR0J3 X-Received: by 2002:a65:5302:: with SMTP id m2mr31637064pgq.369.1557919825526; Wed, 15 May 2019 04:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557919825; cv=none; d=google.com; s=arc-20160816; b=iWtn6/fPB3RsTQsMI36vX4+t7+gqgfNYrzYFjrV1VpTLOHYquHDz2V+gIY302Q5V+I FUG6QHezfZiTtNk4/AIXaoziYPfoJ1x4/yxu3hsoNUKd+sz1DQSag6A+4o/zS9JYL/YF OSbjHOL1MpPTykLclChtZkrBUtnNfKMIphE1Hhnr4BKGQmhyF/H+rkHQ/ExF411uHAMP r/dTx6LTbLCrblNNlZA32bOmF79BueBX52aZ4DA3E6vnniuS02CZJxTgZoKtXfqAhFv3 1Pi6AtHUUAECPPW/gTZcqT6ugoQeYUapo+/59EVrHQPjhtQ+H3f3PgiX5EaonFV/OobQ W0Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uXh36zIkeaDGA7codJSYEupZvaUJBEXCvAHmwqaPiNE=; b=1JaAczOBYvFNVhmbLTGkGGjC0HwZ4XLvWMuhoyVh5YXaulZI3a5dLk6YD+2Blwgeqw F6ACz3TKtb5/WGYJD9JP9d70oCz9Uk8rns2B8GzgQ5A/AMlfY7hJEFFi6Ebw3P5tFlxv 5IcYGLclrj3/oMKCwsVZeN8d58IXT2VqZq+BqP2tTvDpAuIlne/aTQPjN3+G9vTN70m1 5HUVK0P0jCluYX2EBDpYQcmERaDjLdlNyME77fIgQlm3AIbCQ2P47fgrN53J78hhdg8Z +kTR6MyAH/I8KlXpzDJabpsuUjrxEm/uXEU/7Gbi8ZfsilNFPbLtF94FBUvLK9U/5nVx M+/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dNFxM264; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si1613282pgg.96.2019.05.15.04.30.10; Wed, 15 May 2019 04:30:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dNFxM264; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731906AbfEOL1g (ORCPT + 99 others); Wed, 15 May 2019 07:27:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731887AbfEOL1d (ORCPT ); Wed, 15 May 2019 07:27:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 55CA920862; Wed, 15 May 2019 11:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919651; bh=CXB5IUkU623dBOmRC9Olz3+gVAQ0n96HHidPJsfDQUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dNFxM264PC4ZqgZvtXbzMgdrTVFpuC5PS3Z+yXnWedNyiUulDQvfy5aI4ZERoAskx 1oI++MxPVbQ3TvFJ/ni9Hv5DalVgNMddghm72QGVW43s9luijSPAwwhWmXLt7zF7V1 NjJeOx/gHLCG/6jqt7Kg5BGD0CXcCQH33BqffbkU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Bolotin , Michal Kalderon , Ariel Elior , "David S. Miller" , Sasha Levin Subject: [PATCH 5.0 043/137] qed: Fix missing DORQ attentions Date: Wed, 15 May 2019 12:55:24 +0200 Message-Id: <20190515090656.559697485@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit d4476b8a6151b2dd86c09b5acec64f66430db55d ] When the DORQ (doorbell block) is overflowed, all PFs get attentions at the same time. If one PF finished handling the attention before another PF even started, the second PF might miss the DORQ's attention bit and not handle the attention at all. If the DORQ attention is missed and the issue is not resolved, another attention will not be sent, therefore each attention is treated as a potential DORQ attention. As a result, the attention callback is called more frequently so the debug print was moved to reduce its quantity. The number of periodic doorbell recovery handler schedules was reduced because it was the previous way to mitigating the missed attention issue. Signed-off-by: Denis Bolotin Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed.h | 1 + drivers/net/ethernet/qlogic/qed/qed_int.c | 20 ++++++++++++++++++-- drivers/net/ethernet/qlogic/qed/qed_main.c | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed.h b/drivers/net/ethernet/qlogic/qed/qed.h index d5fece7eb1698..07ae600d0f357 100644 --- a/drivers/net/ethernet/qlogic/qed/qed.h +++ b/drivers/net/ethernet/qlogic/qed/qed.h @@ -436,6 +436,7 @@ struct qed_db_recovery_info { /* Lock to protect the doorbell recovery mechanism list */ spinlock_t lock; + bool dorq_attn; u32 db_recovery_counter; }; diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c index b994f81eb51c3..00688f4c04645 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_int.c +++ b/drivers/net/ethernet/qlogic/qed/qed_int.c @@ -436,17 +436,19 @@ static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn) struct qed_ptt *p_ptt = p_hwfn->p_dpc_ptt; int rc; - int_sts = qed_rd(p_hwfn, p_ptt, DORQ_REG_INT_STS); - DP_NOTICE(p_hwfn->cdev, "DORQ attention. int_sts was %x\n", int_sts); + p_hwfn->db_recovery_info.dorq_attn = true; /* int_sts may be zero since all PFs were interrupted for doorbell * overflow but another one already handled it. Can abort here. If * This PF also requires overflow recovery we will be interrupted again. * The masked almost full indication may also be set. Ignoring. */ + int_sts = qed_rd(p_hwfn, p_ptt, DORQ_REG_INT_STS); if (!(int_sts & ~DORQ_REG_INT_STS_DORQ_FIFO_AFULL)) return 0; + DP_NOTICE(p_hwfn->cdev, "DORQ attention. int_sts was %x\n", int_sts); + /* check if db_drop or overflow happened */ if (int_sts & (DORQ_REG_INT_STS_DB_DROP | DORQ_REG_INT_STS_DORQ_FIFO_OVFL_ERR)) { @@ -503,6 +505,17 @@ static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn) return -EINVAL; } +static void qed_dorq_attn_handler(struct qed_hwfn *p_hwfn) +{ + if (p_hwfn->db_recovery_info.dorq_attn) + goto out; + + /* Call DORQ callback if the attention was missed */ + qed_dorq_attn_cb(p_hwfn); +out: + p_hwfn->db_recovery_info.dorq_attn = false; +} + /* Instead of major changes to the data-structure, we have a some 'special' * identifiers for sources that changed meaning between adapters. */ @@ -1076,6 +1089,9 @@ static int qed_int_deassertion(struct qed_hwfn *p_hwfn, } } + /* Handle missed DORQ attention */ + qed_dorq_attn_handler(p_hwfn); + /* Clear IGU indication for the deasserted bits */ DIRECT_REG_WR((u8 __iomem *)p_hwfn->regview + GTT_BAR0_MAP_REG_IGU_CMD + diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 6adf5bda9811e..26bfcbeebc4ca 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -966,7 +966,7 @@ static void qed_update_pf_params(struct qed_dev *cdev, } } -#define QED_PERIODIC_DB_REC_COUNT 100 +#define QED_PERIODIC_DB_REC_COUNT 10 #define QED_PERIODIC_DB_REC_INTERVAL_MS 100 #define QED_PERIODIC_DB_REC_INTERVAL \ msecs_to_jiffies(QED_PERIODIC_DB_REC_INTERVAL_MS) -- 2.20.1