Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2771207imj; Mon, 11 Feb 2019 08:13:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IYr6FPtdE0+BImbk3y04g+t5tCYi2lHcR5WudhObJAvYH1+Qm25EKV+Fr8dNV5Qp+6KKaf/ X-Received: by 2002:a17:902:758f:: with SMTP id j15mr3346426pll.170.1549901595673; Mon, 11 Feb 2019 08:13:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901595; cv=none; d=google.com; s=arc-20160816; b=wVocZCGsVum9Hnsz+Y2PpNsG3dhKHWpiBClniIMTTkY3lcSJqtyyFqtmhVan9cnP4Q Z5Ww7WRttN1pfI4i5pz5kYkG+YrJiOTyWxECBufxOf2fb+a/POWaamJehrRdbVXkXXo0 jwRJqcML4jARErxEVQoYpuAeNZjgPVr2D/5Y6mvKnYua8l9jsVbdIpBfb5kqKjwSLql2 XbqCInGJHYI1nnUrGX514tUUfK/Orza7jd1pMTTL6y0Gfnamjoqgked3GGsiarVfywrJ 88VBf6SMd2HaxdiZ55Vqa0bWozP2QaRie4Py1at40PXzl4NkJOmQgqfQkxb9G2VZEaqi Cpiw== 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=tIsbodWou0Ulc0Ez+6FUY/H52QDfpfoWTkEIk9xfD5c=; b=TTBXn3OuRI6WlhwdWHkwS9yuXzLiKiZD6FvgqhfAE7RRLuwd3sUQr7o/m6zCdGTNhw qwYVdDW2ml4o+z0NDR82lDujI2lov+814Mo7gUvNURHbEqnr+NoBSL+xGdw05ERkHSfA F7Nw30/YfWcJbCjvgNaDFU7cdycNxEBvVa8mWjBhAaxBwF2wpTXDLrL+RevA18lUMmSw FOvK3heQIVbiD3KEdyQB7ZXcdtvCHpkEQYzyDFi8k5NXY2OMTkRxaptxqq65dpK/5mEA IF5J3LJfRdV7Yi9JyaMzFbxI1BFxerVZT3W8uCortNoweJvwX/QWHDvokwGwZPXsshNs A81w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qbmzW50+; 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 r27si9637447pgl.494.2019.02.11.08.12.52; Mon, 11 Feb 2019 08:13:15 -0800 (PST) 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=qbmzW50+; 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 S1729239AbfBKOYi (ORCPT + 99 others); Mon, 11 Feb 2019 09:24:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:57862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729201AbfBKOYg (ORCPT ); Mon, 11 Feb 2019 09:24:36 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 9D1E021855; Mon, 11 Feb 2019 14:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895075; bh=KDH9ysj78g3a2OJr1MilKo0lpoH5ONg5rbfm5JSGo9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbmzW50+V+GNTc00DylPQFNYzgkAvBxQ8d6bihvEYD63/whMVpepRtAibLUWZWWf6 vCkGgfdqSthBGsC1XuGHheCmhS1pATjOj8mo82AWVruqnlqHiCNKx4o2dp+Bl6U0f/ r91mQ3e1HFAw6EJRGyP7ahG2z9Ebkq4Jm474+9vk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Brady , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.20 043/352] i40e: prevent overlapping tx_timeout recover Date: Mon, 11 Feb 2019 15:14:30 +0100 Message-Id: <20190211141849.050937911@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d5585b7b6846a6d0f9517afe57be3843150719da ] If a TX hang occurs, we attempt to recover by incrementally resetting. If we're starved for CPU time, it's possible the reset doesn't actually complete (or even fire) before another tx_timeout fires causing us to fly through the different resets without actually doing them. This adds a bit to set and check if a timeout recovery is already pending and, if so, bail out of tx_timeout. The bit will get cleared at the end of i40e_rebuild when reset is complete. Signed-off-by: Alan Brady Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 876cac317e79..8245ff12fd64 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -122,6 +122,7 @@ enum i40e_state_t { __I40E_MDD_EVENT_PENDING, __I40E_VFLR_EVENT_PENDING, __I40E_RESET_RECOVERY_PENDING, + __I40E_TIMEOUT_RECOVERY_PENDING, __I40E_MISC_IRQ_REQUESTED, __I40E_RESET_INTR_RECEIVED, __I40E_REINIT_REQUESTED, diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 0e5dc74b4ef2..419cf3faada6 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -338,6 +338,10 @@ static void i40e_tx_timeout(struct net_device *netdev) (pf->tx_timeout_last_recovery + netdev->watchdog_timeo))) return; /* don't do any new action before the next timeout */ + /* don't kick off another recovery if one is already pending */ + if (test_and_set_bit(__I40E_TIMEOUT_RECOVERY_PENDING, pf->state)) + return; + if (tx_ring) { head = i40e_get_head(tx_ring); /* Read interrupt register */ @@ -9632,6 +9636,7 @@ end_core_reset: clear_bit(__I40E_RESET_FAILED, pf->state); clear_recovery: clear_bit(__I40E_RESET_RECOVERY_PENDING, pf->state); + clear_bit(__I40E_TIMEOUT_RECOVERY_PENDING, pf->state); } /** -- 2.19.1