From patchwork Sat Jun 17 13:09:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13283603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7E9CEB64DA for ; Sat, 17 Jun 2023 13:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q85HSVSzRjNbqH0fNmLkF6Mnbo+P9QDwlZSCrvQC4mY=; b=gfDaNYOjAEMUi7 dK1uK1d4Cw3s9OVdgcWwM0ty6L1hAvXlJsSbrnWG/OG0rna41Cxhj1bGU/6iBcncsGXE1+HT6GIvB 5w24RIjumbGg2i7YtGoQCkxIcDRbUARv9vLGHp6JIu1K8gkGZuaBZnK18xcQiKNMZa5tWB5Yl3YKt nam25sCVE6fUGJnz0jUx43NsxjzSMaxIl+CbfQLjafV5CAGNtOqXvGSq7U95WvbmW7+EJuYprKUHk Lv/12sE//orfGv0aJvjxzTRu5X/8UtZDhVBJJgoPCX4Ldu9bEC8zAbQngDhHaTKJCdA7olxUhbloX DxzsVfK1ukqNf71MtfOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qAVrq-003elA-2g; Sat, 17 Jun 2023 13:21:26 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qAVri-003ejT-1t for linux-arm-kernel@lists.infradead.org; Sat, 17 Jun 2023 13:21:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E255161055; Sat, 17 Jun 2023 13:21:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCBBBC433CA; Sat, 17 Jun 2023 13:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687008077; bh=kJMjOEWBubOW9yDcj4y+c7DM6eBhC1GM5K1t94VIlM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVIGbaSXkCFPPbMeKeLQgW7doJX/6W8mJHsWjog5hvpr/BkfpxQo6u1zSxX7ft3/I omdaQxRHy9zEHE3w7eB5aZnljK3pv5KcFtEqILinO4tQECr0rNu/C+2kCF3GfJM6a0 wpG026GCBZyhjaviLFMTUvhbLpRrTXwrLJkXyKxRbQZ+/xlW3PD/gaRms1LeLsgWB5 XXuNGVD4ruo1Nodwoi91zsEx+PLDpL3Y+mYmDMVnPaorHBqzUHxuwByJdzcmQiAZjf LVORniVAZRfsMiO0OWiV7Z0nxeL+jXkZqmwSDkxgcs91noWGJtqifn0ErXVMipPXjJ MYmbyphde0xhg== 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-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Simon Horman Subject: [PATCH net-next v2 1/2] net: stmmac: don't clear network statistics in .ndo_open() Date: Sat, 17 Jun 2023 21:09:42 +0800 Message-Id: <20230617130943.2776-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230617130943.2776-1-jszhang@kernel.org> References: <20230617130943.2776-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230617_062118_665672_CEDDDD5A X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 5c645b6d5660..eb83396d6971 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3827,10 +3827,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; @@ -7315,6 +7311,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));