Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9928821ybi; Wed, 24 Jul 2019 12:30:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxojKKJzMZE13KxrDK82r23SiPXq/9TC/HdubMeo3D23arsFwdmt6gRIWZQ0g/ReYGg0Wa3 X-Received: by 2002:a17:902:925:: with SMTP id 34mr86566465plm.334.1563996620179; Wed, 24 Jul 2019 12:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996620; cv=none; d=google.com; s=arc-20160816; b=Nb8CUYJS9k0l0sdKcUnLzO3YWn9SMk7CWZ6J8JGHfeCrBoEBFkJsEPvF9svzbKuBqm 154GSkP+Rksjudk+s4NE8n5pAeoTmm59yn2U7ZBnQ7ba95Xj5MQrH+h/Xyp7hypXS7CX CarbX5gcr2zN5n8aS0q0uz2e7DTLYyLBGFKwsjtdQy2H523AI4hQu6XVGau0mHGtsNGW UFvNRW5G6cQrZwsf0gh8ZIFKG5e8JHZtvSSaJht6Uj/ZHVXD+hGM2q5/jj7zqQPi3S0R ZzOCctP/Rr5Gf7tNZ5KSD2a5yDtVVDKVFwS525o0RQTlJ2zmU7WmoMTEkpFzDYqRrIeZ CQ4A== 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=syfgH7t3+CrEYw/to++tVR9F2ES9YMKddpyj3E41FvI=; b=oZ2ii62c306YHSdEVDg5GqR6uvC0X62sPGe+GbLlwXsr7Yro7oo8AJd3u86ajl1WfR 29Yle0D+GLiY2LQgLSir1rSHO7ZEo1uq9ehn90VHO9mot2qA579I9QivARuXCbZ3MV6P f2KIcdnS01zpq1FuipVWpzWCL4MmkXJtzgXE8zE1ZItyJMIgia36+3YxaZ0IPAxdLOml LehV47NL10DfbkdWssT4SkmaS7mPG4Ejy6mnc0h3pbN8G90Nu7bEWNKfYFGp/UQpTmY0 1E3V4nXVcJpDxaxPWq7y30yDVQabPlwdzb4w7GBZnqPHd3t6q5HeF4LkrWI3G88ZtJug MWDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vxUC7px+; 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 6si15543425pgt.13.2019.07.24.12.30.05; Wed, 24 Jul 2019 12:30:20 -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=vxUC7px+; 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 S2388007AbfGXTYy (ORCPT + 99 others); Wed, 24 Jul 2019 15:24:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387984AbfGXTYt (ORCPT ); Wed, 24 Jul 2019 15:24:49 -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 C9C8721951; Wed, 24 Jul 2019 19:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996288; bh=ZlQrevqVxc84cddOpeGoAobSvayuwpStagSYQwjfh9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vxUC7px+OtzwcTVvYdenGXR4JGd7IGXQSlDxZvnBdwXPTBmi896HyG1q5U14RAkAC 5Jy3Ry0ClO+n7Ve9RntxAtbWIP5uD2+wJhs7vhtBWhlA7fwEdWj4fyNMjPxqGu8XgR NqO6KqG5r/z976MKs5hBNlG7pq5VGOTeMcEZjXpw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mitch Williams , Anirudh Venkataramanan , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 5.2 046/413] ice: Check all VFs for MDD activity, dont disable Date: Wed, 24 Jul 2019 21:15:37 +0200 Message-Id: <20190724191738.846144340@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 23c0112246b454e408fb0579b3f9089353d4d327 ] Don't use the mdd_detected variable as an exit condition for this loop; the first VF to NOT have an MDD event will cause the loop to terminate. Instead just look at all of the VFs, but don't disable them. This prevents proper release of resources if the VFs are rebooted or the VF driver reloaded. Instead, just log a message and call out repeat offenders. To make it clear what we are doing, use a differently-named variable in the loop. Signed-off-by: Mitch Williams Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_main.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index dbf3d39ad8b1..1c803106e301 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -1161,16 +1161,16 @@ static void ice_handle_mdd_event(struct ice_pf *pf) } } - /* see if one of the VFs needs to be reset */ - for (i = 0; i < pf->num_alloc_vfs && mdd_detected; i++) { + /* check to see if one of the VFs caused the MDD */ + for (i = 0; i < pf->num_alloc_vfs; i++) { struct ice_vf *vf = &pf->vf[i]; - mdd_detected = false; + bool vf_mdd_detected = false; reg = rd32(hw, VP_MDET_TX_PQM(i)); if (reg & VP_MDET_TX_PQM_VALID_M) { wr32(hw, VP_MDET_TX_PQM(i), 0xFFFF); - mdd_detected = true; + vf_mdd_detected = true; dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n", i); } @@ -1178,7 +1178,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf) reg = rd32(hw, VP_MDET_TX_TCLAN(i)); if (reg & VP_MDET_TX_TCLAN_VALID_M) { wr32(hw, VP_MDET_TX_TCLAN(i), 0xFFFF); - mdd_detected = true; + vf_mdd_detected = true; dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n", i); } @@ -1186,7 +1186,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf) reg = rd32(hw, VP_MDET_TX_TDPU(i)); if (reg & VP_MDET_TX_TDPU_VALID_M) { wr32(hw, VP_MDET_TX_TDPU(i), 0xFFFF); - mdd_detected = true; + vf_mdd_detected = true; dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n", i); } @@ -1194,19 +1194,18 @@ static void ice_handle_mdd_event(struct ice_pf *pf) reg = rd32(hw, VP_MDET_RX(i)); if (reg & VP_MDET_RX_VALID_M) { wr32(hw, VP_MDET_RX(i), 0xFFFF); - mdd_detected = true; + vf_mdd_detected = true; dev_info(&pf->pdev->dev, "RX driver issue detected on VF %d\n", i); } - if (mdd_detected) { + if (vf_mdd_detected) { vf->num_mdd_events++; - dev_info(&pf->pdev->dev, - "Use PF Control I/F to re-enable the VF\n"); - set_bit(ICE_VF_STATE_DIS, vf->vf_states); + if (vf->num_mdd_events > 1) + dev_info(&pf->pdev->dev, "VF %d has had %llu MDD events since last boot\n", + i, vf->num_mdd_events); } } - } /** -- 2.20.1