Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2630738pxa; Mon, 17 Aug 2020 14:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNdHig3yO+rMkvhBEYTnUgr2+sO7IeZwjTtxMDLEhYE1O6J5/LO8cxLhYJQneAUVZUZiEb X-Received: by 2002:a17:906:a8f:: with SMTP id y15mr16829489ejf.140.1597701376940; Mon, 17 Aug 2020 14:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597701376; cv=none; d=google.com; s=arc-20160816; b=E9ariX66MmH/UYbQG0Sadx/QpHZ5mMW9qYHUbTo+jeO6kPmU4dObRXO2z944U38GM2 xpkXQUslSaUTjDhlFWxHiSixO2P4eNvsvaQVDkufQ+0fkXDKEBXhaYSzfp+XoTe2Qmba wckxbKtYe2h2VLAdQio/sSeVV5cMrZtYndZ+OoOeLzWlU5znhjOLucMEUmkakIuZl0ju YoWdIV8Vva/4lDfkydcW8QpnyW/OeTNExk3VP5OURqVspoAWhvHtsARnRlkedteY+NLL 9gnNfNX4gCRObhsKWIAdLSfWBgrPGUSGasVPg2F4NWygtOTtjkY5it0kiKr/Bs3RcTjS lmUw== 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=q/jPcZ0FwmOBMrHOin2gVvQAIdKgWXiApEdJuS48PHA=; b=c88GjE3OJ5ZPPHmnzPfRSH37Oob2V7NQ76vM5jy5wAjcZRDCe3Ruv5kE4f42uP1MFn 9UwxrH/LnP1rWg3ct87KEnQStlbxqYRSGx6ypnB1WZQ80QL5vgiDqYYKvlfT0UHAb1Rv UD6i2RViLWI6bhDcR0FyWm73P4nED0bvvqGM75JQvl7ZOQ1a8N/OicDP1xucbVI6WtQP 0JA/173cFXIwkPznEXjJx1oravBwqK+eGEFM8kcp+TSG8CywhQiKQXb4RdiRq1hZWvdq Chy7AfZU/I45WR1AxJm6EMCFRFcKYHlGeRAznQfgoYOY8qc0vp2OLaBu/bewAfRCRgqt JyAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tJGi2jmP; 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=fail (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 r21si14145275edc.313.2020.08.17.14.55.51; Mon, 17 Aug 2020 14:56:16 -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=@kernel.org header.s=default header.b=tJGi2jmP; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730080AbgHQP3U (ORCPT + 99 others); Mon, 17 Aug 2020 11:29:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:38532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729876AbgHQP1T (ORCPT ); Mon, 17 Aug 2020 11:27:19 -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 2F50F23110; Mon, 17 Aug 2020 15:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678038; bh=Csng0A6LeL/hjBrrThmxVvQ6iJFty4yTRjf2Pxy9sJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tJGi2jmPmNmwA+UegkONLJ63dPHSvhW9BM9JmJSb2mfUZVS1sJqriAsCCLYnmsEdL cGDeQwNEO/aaOw5MsYuUsSdIvCSU9lbBxNDP4+hero5ww/bOluY2MpPHuHCKTIdO27 u0iYKv/9MtRic9leP18qpUF9L3cLXo1KEwBNd5Ck= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Nguyen , Andrew Bowers , Sasha Levin Subject: [PATCH 5.8 198/464] iavf: Fix updating statistics Date: Mon, 17 Aug 2020 17:12:31 +0200 Message-Id: <20200817143843.306266537@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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 From: Tony Nguyen [ Upstream commit 9358076642f14cec8c414850d5a909cafca3a9d6 ] Commit bac8486116b0 ("iavf: Refactor the watchdog state machine") inverted the logic for when to update statistics. Statistics should be updated when no other commands are pending, instead they were only requested when a command was processed. iavf_request_stats() would see a pending request and not request statistics to be updated. This caused statistics to never be updated; fix the logic. Fixes: bac8486116b0 ("iavf: Refactor the watchdog state machine") Signed-off-by: Tony Nguyen Tested-by: Andrew Bowers Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/iavf/iavf_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index bc83e2d999442..d338efe5f3f55 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -1948,7 +1948,10 @@ static void iavf_watchdog_task(struct work_struct *work) iavf_send_api_ver(adapter); } } else { - if (!iavf_process_aq_command(adapter) && + /* An error will be returned if no commands were + * processed; use this opportunity to update stats + */ + if (iavf_process_aq_command(adapter) && adapter->state == __IAVF_RUNNING) iavf_request_stats(adapter); } -- 2.25.1