Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16395143rwd; Mon, 26 Jun 2023 09:23:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fIL2C98URnLcq8HGWEGxXPYkAE8b3MDhvEjINrnHqMsgQA2nD+KQY1Cs78/PLGxRngA1+ X-Received: by 2002:a17:907:928b:b0:973:71c3:8b21 with SMTP id bw11-20020a170907928b00b0097371c38b21mr26646890ejc.72.1687796631558; Mon, 26 Jun 2023 09:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687796631; cv=none; d=google.com; s=arc-20160816; b=X+Tqs0514Vlypuihj/gef5zG1d/Of1n1KKZogMulQ38fIYMgBsQB4+8sTBzsmknb9T 8ywyunE4y7QDXv72/uU6Z0kkxf67JcDVfvZpgdK3d/akoypgH1dzcbnvVX/QZ+oEZfMT MOU6DYRFRAlsD1xDQhZF9GZjD7AH6ZzZtihldEFpPvo1QPOvAXHi/5iwVvXrexlATWWR wOBtv6PrIgquAFtqzgu+m0kOo+wQkcTR0Y1c4UI1canQX9X48+OcU0oECjwRVkpzW9Ab wk7rvgNhtK48xcNEVQy970N+MJ3LRtK4ZdIgZhXCqsY5K0bf93UGeTo236A06GHmSHXo lH5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tCGwowr6cYetpy3WmAJmrSbGAwY1jhGHnPYAGKXZ19c=; fh=FLcX+XbzkOw3QxHQPjO014/8K+Khr2r3DSj6x1yx7i0=; b=U5KtZWe4GxncjXnx+eGAQQ3GrkQRiCXPc24d3xuYnbrdTxix+3EK+JAmzv+3ZwjYhC gS/2tN9EAN5nCeLzHeCdZo563DLpI6aLFWLkzVy9kOb5CiWog21qz1zN9Ivsx2gi3xBM cn5q0AKSs+bw+oiIjB7dSWNC4D3R06s0Rkk9KyAPq4l3wsbUOqNRIo0HNyH4JygaDSkg 6KhfDLFtMipuktVMViYIPtuI6RWUenoXxTSmE4PBuZyRkZBIzdNwJbiWeAB5IC/tKs3z N0eTnG6cQStQDo8I6yp1ajWtAJnvzQSyId5otYZYLQCJw+18V/5wmriNkCZIyy+SukZB ft/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pjC538ej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a170906081100b00988788f44d2si3038705ejd.974.2023.06.26.09.23.25; Mon, 26 Jun 2023 09:23:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pjC538ej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231356AbjFZPkV (ORCPT + 99 others); Mon, 26 Jun 2023 11:40:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230345AbjFZPkT (ORCPT ); Mon, 26 Jun 2023 11:40:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0B83E73 for ; Mon, 26 Jun 2023 08:40:18 -0700 (PDT) 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 4341C60EA2 for ; Mon, 26 Jun 2023 15:40:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9542DC433C0; Mon, 26 Jun 2023 15:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687794017; bh=kJMjOEWBubOW9yDcj4y+c7DM6eBhC1GM5K1t94VIlM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjC538ejKJF2eQqF6iIIHTI84+Kq2vWLZ8C7dPnMmb+7tEFsLzTxeqoUeitjGPmkK SOkOgn7zgCYtd7IMLE0KTMOFNV3ANmp5+cv7yII3sHOUB//cfeQYUuz4Ef5xgHTADn gZkDPX/TRggSuuQzismphdz21txnNQREx0Uiioc2TPdb+BfMTC6RzYb5Guj+zvp22e cbcXvsTwmBt4lJ5Ad2499U0oJ8pDDjoODjTclOyVnF9VdDCEeANEsZEs5Euis/nPWu TSNoQda7X4NBKGDt29xkfCsbv6xVh4UY29PRo3H3/IVnsH7TKJi9VvXKLADrWfKHqT lR68uoczfFCSg== 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 v4 1/2] net: stmmac: don't clear network statistics in .ndo_open() Date: Mon, 26 Jun 2023 23:28:43 +0800 Message-Id: <20230626152844.484-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230626152844.484-1-jszhang@kernel.org> References: <20230626152844.484-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 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)); -- 2.40.1