Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1289865lqg; Sun, 3 Mar 2024 03:42:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXTmbJW0zoq3i7mLgQaMp9IPB3Y8vcbC0R7ZEyzL/W6akTnw09eb4u4L9re2N6N6qpsjmk4bvl7uhlCn7TRP92gi5bZ7YD6n0xiv4mLtQ== X-Google-Smtp-Source: AGHT+IFPZTJHSMiQb7Q0wYPCy3J+wuVchrYCLsZb5bMkk13Df9I2233PAzI44XU37EnQTZzdQRC8 X-Received: by 2002:a05:6a00:cc5:b0:6e1:482b:8c8e with SMTP id b5-20020a056a000cc500b006e1482b8c8emr6642754pfv.17.1709466128356; Sun, 03 Mar 2024 03:42:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709466128; cv=pass; d=google.com; s=arc-20160816; b=0MX2uoft+RE6rj3kleDRpfOdkuNyE9u3G8F+xcZMGFHgauwW425jAXjhxvEjV8e1Qh 2sXlZO5XhhN+eHsISmz77C7WklXGjpjzV3rzitm8vw/4DKS3yy+uL3Xhar8nW3itvkL4 2rCPQNKFNhdZLcr/097Ddq5VVS3Zr1oDIzSVr8vufHyhCUBwEaurEMn333m2beu0wUHL aMKyCk+maQWCXiwJ3LYYreMD3fpydze3OUEAg8yUQz+JRvfYL/HRBz4/BjjSGlLf6jqI YQLIBleM/g5D2+rdUfDTXkxGYdCkrP6xpJ354rNeR5rjC2y32kuW+NkkZMNT/uLSqL4+ 2ixg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:mail-followup-to:message-id :subject:cc:to:from:date; bh=QH3nMGKuWwPCO40pMpMfnlA1e9mY38uhTRzinqGdle0=; fh=r6OXzUJWosj6Vsa/uU0mCYWt0wLq9tDfGIZJTEPRJl8=; b=izaJhNKKWneNuyoLpGx/CW1nUuThdfe4A89PjH48QyLKum2nG8Tbk2RymsezQVjNGw G8Ctp7L/iOKpfDbZlp5iWp4P7hZLfsxQOP1Li3tRn9Q84SlstxTko09zOadVKJW1jTQg Y6PD7NttsbR2wYYXPhrV0k4rI/jFyzlZdHFGfc7xvcK4x8enaXPPaVdtVLu/0HgxPWiE 9SJ5QrOhjDiDCYyLbYJYLED7PFnQ0v5KCqNLU6zInjbytdGyj4n2NhtejNBtBoQIQkn1 0C5gwDLvvna8KaCw6mnFTgeN12MsGIs6SAkp2F0X0QrpvhNY4L9Cahe1vh1DNz0OcCDN aUAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=didiglobal.com dmarc=pass fromdomain=didiglobal.com); spf=pass (google.com: domain of linux-kernel+bounces-89715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=didiglobal.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c2-20020a056a000ac200b006e61aa762c1si674994pfl.361.2024.03.03.03.42.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 03:42:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=didiglobal.com dmarc=pass fromdomain=didiglobal.com); spf=pass (google.com: domain of linux-kernel+bounces-89715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=didiglobal.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3BA00B21677 for ; Sun, 3 Mar 2024 11:42:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59E40BE68; Sun, 3 Mar 2024 11:41:57 +0000 (UTC) Received: from mx10.didiglobal.com (mx10.didiglobal.com [111.202.70.125]) by smtp.subspace.kernel.org (Postfix) with SMTP id A90C8947B; Sun, 3 Mar 2024 11:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.202.70.125 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709466116; cv=none; b=SBogJzuMU0g3R7MjkO4gLswiMab7se7kgVWbN4QqGzzW2pjlLdM4MuUiYg6+46TUgzBb2Owwjr/jVJa47HhOOkjFmQlyE9Q7WmFMxZFe85wJat37KlduVeoXPlTR3FdmUJr4vlxUoLp5BnYCdGpHyjPCAA1U9zaeVU2aOSvtydw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709466116; c=relaxed/simple; bh=C/+o4R/chXHt1BeBmz9g4eN1rRdlLEMe/HGROgdm+KY=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=RnTtpEEXtJkvc8MCTlildvr8+i4OggMNiJlzOqir+Cf1MD3T03VbWCWj5wecn1cITd/mDBavLR+j4oBmyB9MkDbNjL4oktikl3KPPpDWrk8jl5bhczTqddDC7Q4H//ikfeW3XaexNgx2MrBM4mLd/0YvogYKaOzEs9sWg8gov7U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=didiglobal.com; spf=pass smtp.mailfrom=didiglobal.com; arc=none smtp.client-ip=111.202.70.125 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=didiglobal.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=didiglobal.com Received: from mail.didiglobal.com (unknown [10.79.65.12]) by mx10.didiglobal.com (MailData Gateway V2.8.8) with ESMTPS id 8D86818B346E49; Sun, 3 Mar 2024 19:41:45 +0800 (CST) Received: from didi-ThinkCentre-M920t-N000 (10.79.64.101) by ZJY02-ACTMBX-02.didichuxing.com (10.79.65.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 3 Mar 2024 19:41:44 +0800 Date: Sun, 3 Mar 2024 19:41:39 +0800 X-MD-Sfrom: fuyuanli@didiglobal.com X-MD-SrcIP: 10.79.65.12 From: fuyuanli To: , , , CC: , , Subject: [PATCH net-next v2] net/nlmon: Cancel setting the fields of statistics to zero. Message-ID: <20240303114139.GA11018@didi-ThinkCentre-M920t-N000> Mail-Followup-To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, fuyuanli@didiglobal.com Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: ZJY02-PUBMBX-01.didichuxing.com (10.79.65.31) To ZJY02-ACTMBX-02.didichuxing.com (10.79.65.12) Since fields of rtnl_link_stats64 have been set to zero in the previous dev_get_stats function, there is no need to set them again in the ndo_get_stats64 function. Signed-off-by: fuyuanli Link: https://lore.kernel.org/netdev/20240302105224.GA7223@didi-ThinkCentre-M920t-N000/ --- v2: 1) check and fix error of spelling and grammar in the commit message. --- drivers/net/nlmon.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/nlmon.c b/drivers/net/nlmon.c index 5e19a6839dea..9b205b152734 100644 --- a/drivers/net/nlmon.c +++ b/drivers/net/nlmon.c @@ -56,10 +56,8 @@ nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) dev_lstats_read(dev, &packets, &bytes); stats->rx_packets = packets; - stats->tx_packets = 0; stats->rx_bytes = bytes; - stats->tx_bytes = 0; } static u32 always_on(struct net_device *dev) -- 2.17.1