Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp165866pxa; Wed, 26 Aug 2020 07:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4F0axYEgjAM8l2xzkcEl5U7Vk8FAcQv0szAr+vaCsD5xrh9d5p3bo5OKlFsz+z6o6BjgP X-Received: by 2002:a17:906:b210:: with SMTP id p16mr12240244ejz.312.1598452339808; Wed, 26 Aug 2020 07:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598452339; cv=none; d=google.com; s=arc-20160816; b=q8XjmzfE57yccBjiiZzPuj3mpKM07GBpqJ5KZiCfPArVnEHItbxuXQdgXf6Yzdo2VG oHmhykU8UeYMLKYjgOM6XHzT/g+Rs8oWIJBgLE+js4veP/a2o9zc+D7E55/30mwDirCL Y8G8AFjKv/bcICeOlj7rjKAwDbT+3wQIxShvMPF3C72V439xkgdNth9cFU6IrYpglmRN wlcyfNdRsj4hQh6z4ab3YVrAE4HhLhn2x6hdl6P8+9t+6JqbErqUxGvF/QdZEXH9reME qKosKW/PPk1A1kL0lGGX6TQM8ZCqam05ZSAAjMLOPmCA4p6KG0OhYHFR1NB3a9tFg6Iy 4iIA== 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=Dd5a22EiA1pVV/a906qWk23xNrXy3uG7vXWAnEurzls=; b=gkkXXCfrghlqPdSg2d/Bokg3+uWFFAZN87xfox5DA6RVUL3fE7IoYES87s/jEeXwdG J7HsziNTAgd06dBvCogC5cl8hpmH7h+lMt5gT7ACoIIo9Wb6napQnin9NNSm8IV99UN/ cWeTpQzZcIhhqay8yMIDZHCbzDeaT/Yqoh33QrDJyAbjU4vcq3OXg7WFDNBWiqJyeahl UyuXnFTG2Wy0dNm3cwj0Z24/DwpqM2qaHiXlfEhUwQ5eFnJ7Y3hSxph+h42jSPrzZdap e3cNhITzV0/u7YIX42rjDJDnivoWBa5B7RD0Qpr2u/hH5YB00xr60Ts1OSfqKhr9jPzM xg4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Dzcq7B6W; 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 g64si1528104ede.153.2020.08.26.07.31.56; Wed, 26 Aug 2020 07:32:19 -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=Dzcq7B6W; 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 S1729583AbgHZMHl (ORCPT + 99 others); Wed, 26 Aug 2020 08:07:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:36684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729455AbgHZMCi (ORCPT ); Wed, 26 Aug 2020 08:02:38 -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 EBF682087C; Wed, 26 Aug 2020 12:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598443357; bh=RhiLupqRQVXojRdaOn/M2DAmZX/fy/Bizh/vLiZGe4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dzcq7B6WabdzpAOqsUcs6YA5jVEy+50jE1gZ77AdTdxIW84SRkb5szrXV86V/wLLI ghwsreY+mh6xwr1CGdx9Cij4ZpFuGpqYtNmDQTXiEuhG/nl3f4HA0H+wWixKSnAG+Q NOxZG0f9y/UTuZ88M1oedS394wQYccz9X0iJFlzA= 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 5.7 10/15] net: ena: Make missed_tx stat incremental Date: Wed, 26 Aug 2020 14:02:38 +0200 Message-Id: <20200826114849.800823726@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200826114849.295321031@linuxfoundation.org> References: <20200826114849.295321031@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 @@ -3594,7 +3594,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; @@ -4519,6 +4519,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); }