From patchwork Mon Aug 17 15:13:44 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: 266105 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=unavailable 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 03E48C433DF for ; Mon, 17 Aug 2020 18:59:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5614204EC for ; Mon, 17 Aug 2020 18:59:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597690767; bh=2IZYQD92cPiTOuXoG75NAiSh0ekfURptFl303Tli+nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iX42S8JCzXjrpzjfptholeRYmfy3EKlRN47PFBPVVoWOqLn7XnCM6C13A5GMOyESN OTvDF5BNsMTPiljae62zAmmiyDtQBRKILcskMt81OFLa49Y2sqISHNMCWqhWZyB5gO 26KjAVbczKc7PsPAHaOcYiUYx7PftMeqPeGZa5oA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391821AbgHQS7I (ORCPT ); Mon, 17 Aug 2020 14:59:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:32864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387612AbgHQPsv (ORCPT ); Mon, 17 Aug 2020 11:48:51 -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 387CA2075B; Mon, 17 Aug 2020 15:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679330; bh=2IZYQD92cPiTOuXoG75NAiSh0ekfURptFl303Tli+nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGeMuL1Vwg1Y6lL+Li2TDPIK1eN1RNflH7QSL9SjqRjAnF095kF6L+j+CaMECD+UW hYaULUuOWvBiGlcIk9DCq9QhLhy7/JG6Ka+ikxVYK8b7zYUCQR4kdPfpyxscdWBMn9 ZNVXUHqqAVdqpt5lDLr1J9HETD61K+2q0kUW60zw= 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.7 174/393] iavf: Fix updating statistics Date: Mon, 17 Aug 2020 17:13:44 +0200 Message-Id: <20200817143828.061096784@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 8deff711cc02c..a4b2ad29e132a 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); }