From patchwork Mon Aug 17 15:12:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FF4DC433DF for ; Mon, 17 Aug 2020 15:27:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AF2123A9A for ; Mon, 17 Aug 2020 15:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678045; bh=Csng0A6LeL/hjBrrThmxVvQ6iJFty4yTRjf2Pxy9sJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PWqMYyTWRCYLliSdTqOXNkUQDvLzxZ3yJvIHtVcg6OWUz+E7lh5rvox7+ik8dCfsO jVzzxPUo0ZcX0lUBYsCsUztI+5q3PWCsuL+uhqEoHFq3xvITxbdfiPwPx3efPvzrWu cnSg0sC9jHqa0qrQH/aQRS8ypxclhYjykirNLsZY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729880AbgHQP1V (ORCPT ); Mon, 17 Aug 2020 11:27:21 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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); }