Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1883614pxk; Tue, 1 Sep 2020 09:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbji/6My4TxhTkSaIqtBDtFGH4LyqtgF2ESl1CkOXg4/mV3D5VMnmUF3ZTAOsPhd7Mw+V0 X-Received: by 2002:a17:906:9356:: with SMTP id p22mr2299697ejw.119.1598979569403; Tue, 01 Sep 2020 09:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598979569; cv=none; d=google.com; s=arc-20160816; b=N91afNETe2B0wTNk/lFDyvz0nrSh8ilw7kpN+FrLBnZi3LIixqxaBfBa6Criy0Vg8C 1Tw02LOK0DBv+oCtzpxbU/SaWS9TJdK6cQfbd+/YdxxA4bFlmgrf3lzE0Whb4WSHTLQb gHijqY1x6gfCRU13c+o/8tMk6w+kw0FaOSXxbKqAlcF7yIlZN/DcrqmBr+j9PVtf+/JW 3EfZg9adpv+xBN3aMqPc77xuAlE1snRLbJJE39PCsBvOJqHgfvRNgzaTTV/FCJo3Rl7K wug4F92ufRUrEJDrxphsG9LDCMpMEgb4ccQa3CAyi6JhN9EgYCOM88c9599OkME6gV1f 6YQA== 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=3edW/zwSzB7k9YOs2i7OL8iOKthWUiaifZbsq7yMCh8=; b=Uwuo7WqfIa1Vxy6U5wcQTnuDkKaJ97We8EUd9Yu+Dyn3jB9YbsprLmlewMiBLDB2MG ifHjinsBUgGsK8N3Qx6RQnaJN+DbJsLPTnaXuhsPdLFu/Tr2HSk/3pdMKyeq72fCypox VVvov9iMMe46RTUZQuiEMAlFqBykIGRldzK7jBS0BOttKfXNrDBJWNor84k7c9uKx2jr wAS3sMenQaKd8g8GlBSKOP8VZ4XGhMcoDecrIeHZCJzVcIcS7TlyeZE9c+yLAJQm81VS 5ayYkjZoDF2PuI7nucmSkOhypNFKyCyuBDiTrkovqslWM+LCRiQXMAM/eWkBoCylOHsm /pQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fl6HcZGR; 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 k30si844881edk.76.2020.09.01.09.59.05; Tue, 01 Sep 2020 09:59:29 -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=fl6HcZGR; 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 S1732457AbgIAQ6b (ORCPT + 99 others); Tue, 1 Sep 2020 12:58:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:44254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729566AbgIAPWd (ORCPT ); Tue, 1 Sep 2020 11:22:33 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 AF248206FA; Tue, 1 Sep 2020 15:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598973753; bh=Rt0xE89x9whGsdU3+Kog2t5CBCq2HWb2QWVTPNjdFGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fl6HcZGR+5KeGZIJG8PC+NLCOSfoNs9m2XOVNEn87uL2Kxg8Wowojogl8k5uArf3R KeGxobiWm9uz9VwJCHDjcmRqGIy2Z05A7CN2Z8XA6kN0NpW6EaelP4vplY1gb91pji g3J4jVALbiN2/8fUEnS7tno8PThXMVZob9JcrXkM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shay Agroskin , "David S. Miller" Subject: [PATCH 4.19 007/125] net: ena: Make missed_tx stat incremental Date: Tue, 1 Sep 2020 17:09:22 +0200 Message-Id: <20200901150934.954808692@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150934.576210879@linuxfoundation.org> References: <20200901150934.576210879@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: Shay Agroskin [ Upstream commit ccd143e5150f24b9ba15145c7221b61dd9e41021 ] Most statistics in ena driver are incremented, meaning that a stat's value is a sum of all increases done to it since driver/queue initialization. This patch makes all statistics this way, effectively making missed_tx statistic incremental. Also added a comment regarding rx_drops and tx_drops to make it clearer how these counters are calculated. Fixes: 11095fdb712b ("net: ena: add statistics for missed tx packets") Signed-off-by: Shay Agroskin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2736,7 +2736,7 @@ static int check_missing_comp_in_tx_queu } u64_stats_update_begin(&tx_ring->syncp); - tx_ring->tx_stats.missed_tx = missed_tx; + tx_ring->tx_stats.missed_tx += missed_tx; u64_stats_update_end(&tx_ring->syncp); return rc; @@ -3544,6 +3544,9 @@ static void ena_keep_alive_wd(void *adap rx_drops = ((u64)desc->rx_drops_high << 32) | desc->rx_drops_low; u64_stats_update_begin(&adapter->syncp); + /* These stats are accumulated by the device, so the counters indicate + * all drops since last reset. + */ adapter->dev_stats.rx_drops = rx_drops; u64_stats_update_end(&adapter->syncp); }