From patchwork Mon Jul 17 16:06:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13315980 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D729BE4E; Mon, 17 Jul 2023 16:18:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A37C433C8; Mon, 17 Jul 2023 16:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689610688; bh=a6VvoUZg7dS9d45AqM82cR3nCmR30DVYkJaln28I4NM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILJWogfVZOXt3Ptyiyx+8hCIm+4MqkfoHnIQvxkiWMqPGODwq/9ztksKu/ES0B6Mb nJVRUUTiIsoHpOrSKXkwYvymoCFvEnMVcoQCgxLhesSFX0xlpeuLFB30TQq/v7sKSY ycHbZc72SFYLhRleIRfn7fmGl4Rp0STzTP8zk7GFavYZfbriE/Ykqa/TSEEBseNSZk gH4lCmLcSqP92x0BVxt4RtWaIepCy+pZ4jcxfJPpGp7WEY7Hux35CpCcKuxbZ05QCP MlfHOsvLRPVXRl+lXZzJrHdUT/TZfhUA1C6TYRZdaGobc4QKw+2fHbZX9o4MHafhtM Au72dxvHRp9hw== From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH net-next v5 1/2] net: stmmac: don't clear network statistics in .ndo_open() Date: Tue, 18 Jul 2023 00:06:29 +0800 Message-Id: <20230717160630.1892-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230717160630.1892-1-jszhang@kernel.org> References: <20230717160630.1892-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org FWICT, the common style in other network drivers: the network statistics are not cleared since initialization, follow the common style for stmmac. Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index efe85b086abe..a29a9619b48e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3829,10 +3829,6 @@ static int __stmmac_open(struct net_device *dev, } } - /* Extra statistics */ - memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats)); - priv->xstats.threshold = tc; - priv->rx_copybreak = STMMAC_RX_COPYBREAK; buf_sz = dma_conf->dma_buf_sz; @@ -7322,6 +7318,8 @@ int stmmac_dvr_probe(struct device *device, #endif priv->msg_enable = netif_msg_init(debug, default_msg_level); + priv->xstats.threshold = tc; + /* Initialize RSS */ rxq = priv->plat->rx_queues_to_use; netdev_rss_key_fill(priv->rss.key, sizeof(priv->rss.key));