From patchwork Sun Mar 3 11:41:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fuyuanli X-Patchwork-Id: 209300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp877037dyc; Sun, 3 Mar 2024 03:42:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVb9xbOUly4JnfQamTWa2nHXUYMWQQGvp5WagT/oLzP4/od29QIwgT6maiWFJDj+OkGCT+JS8rWHoxuffbVyiih7td4Iw== X-Google-Smtp-Source: AGHT+IH2Q0y9FnU8apMcUYd87QDMkTcmg8KggRW5TD/bwUrMrQPXKRjF1YysAP9qwltanYkusRP/ X-Received: by 2002:a9d:6215:0:b0:6e2:baa2:42c8 with SMTP id g21-20020a9d6215000000b006e2baa242c8mr7053397otj.28.1709466140933; Sun, 03 Mar 2024 03:42:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709466140; cv=pass; d=google.com; s=arc-20160816; b=HE9j9pUjZWZcZ5TZb6tsXOU0c3JbIMZJO1W5xN6L8kT9XOfa0U9HOBj67qXk3uO582 /BLhVdRt9KUNh+1F9/NdBqClKXc7neMbsMeb51sYqcM8WkMdmKy97ZXNy4sQhWjvCCgA 9VfN8WJ6gqkBF4NOmMHDexYR8nYwnEwte8oj8C6PpUvFKRGi9hUOZbUTvih+8i5JlZQl mEjintsiQGRtxXn2Ge4Xpgb/hkOG9rSRPt+s4ykO5kaDBTIa/05knWp1Zo1/0ok2WX2g 1VHMLgxMo9kA64qy3jNzC3El0wlImg+sOGMnBkf98V2KKWqkAhiE6CAalXT+l8kvUYHk oveA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89715-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=didiglobal.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y13-20020a63180d000000b005ce016cce21si6718796pgl.191.2024.03.03.03.42.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 03:42:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89715-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89715-ouuuleilei=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 40557B224CD for ; Sun, 3 Mar 2024 11:42:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50121C8DD; Sun, 3 Mar 2024 11:41:58 +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-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) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792505167931296259 X-GMAIL-MSGID: 1792505167931296259 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/ Reviewed-by: Eric Dumazet Reviewed-by: Jason Xing --- 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)