Message ID | 20240303114139.GA11018@didi-ThinkCentre-M920t-N000 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-89715-ouuuleilei=gmail.com@vger.kernel.org> 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 <ouuuleilei@gmail.com> (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 <ouuuleilei@gmail.com>; 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 <fuyuanli@didiglobal.com> To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com> CC: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <fuyuanli@didiglobal.com> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792505167931296259 X-GMAIL-MSGID: 1792505167931296259 |
Series |
[net-next,v2] net/nlmon: Cancel setting the fields of statistics to zero.
|
|
Commit Message
fuyuanli
March 3, 2024, 11:41 a.m. UTC
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 <fuyuanli@didiglobal.com>
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(-)
Comments
On Sun, Mar 3, 2024 at 12:42 PM fuyuanli <fuyuanli@didiglobal.com> wrote: > > 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 <fuyuanli@didiglobal.com> > Link: https://lore.kernel.org/netdev/20240302105224.GA7223@didi-ThinkCentre-M920t-N000/ > Reviewed-by: Eric Dumazet <edumazet@google.com>
On Sun, Mar 3, 2024 at 7:43 PM fuyuanli <fuyuanli@didiglobal.com> wrote: > > 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 <fuyuanli@didiglobal.com> > Link: https://lore.kernel.org/netdev/20240302105224.GA7223@didi-ThinkCentre-M920t-N000/ Suggested-by: Jason Xing <kerneljasonxing@gmail.com> See https://lore.kernel.org/all/CAL+tcoA=FVBJi2eJgAELhWG_f+N-kwmrHc+XRfKXhYk2RJcPKg@mail.gmail.com/ Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Jason Xing <kerneljasonxing@gmail.com> 于2024年3月4日周一 15:05写道: > > On Sun, Mar 3, 2024 at 7:43 PM fuyuanli <fuyuanli@didiglobal.com> wrote: > > > > 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 <fuyuanli@didiglobal.com> > > Link: https://lore.kernel.org/netdev/20240302105224.GA7223@didi-ThinkCentre-M920t-N000/ > > Suggested-by: Jason Xing <kerneljasonxing@gmail.com> > See https://lore.kernel.org/all/CAL+tcoA=FVBJi2eJgAELhWG_f+N-kwmrHc+XRfKXhYk2RJcPKg@mail.gmail.com/ OK, I will submit a v3 patch which updating commit message, thanks. > > Reviewed-by: Jason Xing <kerneljasonxing@gmail.com> >
On Mon, Mar 4, 2024 at 7:14 PM yuanli fu <fuyuanli0722@gmail.com> wrote: > > Jason Xing <kerneljasonxing@gmail.com> 于2024年3月4日周一 15:05写道: > > > > On Sun, Mar 3, 2024 at 7:43 PM fuyuanli <fuyuanli@didiglobal.com> wrote: > > > > > > 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 <fuyuanli@didiglobal.com> > > > Link: https://lore.kernel.org/netdev/20240302105224.GA7223@didi-ThinkCentre-M920t-N000/ > > > > Suggested-by: Jason Xing <kerneljasonxing@gmail.com> > > See https://lore.kernel.org/all/CAL+tcoA=FVBJi2eJgAELhWG_f+N-kwmrHc+XRfKXhYk2RJcPKg@mail.gmail.com/ > OK, I will submit a v3 patch which updating commit message, thanks. I don't think you need to send a new version of the patch unless someone points out other changes that should be made. Thanks, Jason > > > > Reviewed-by: Jason Xing <kerneljasonxing@gmail.com> > >
On 3/4/24 2:25 PM, Jason Xing wrote: > On Mon, Mar 4, 2024 at 7:14 PM yuanli fu <fuyuanli0722@gmail.com> wrote: >> Jason Xing <kerneljasonxing@gmail.com> 于2024年3月4日周一 15:05写道: >>> On Sun, Mar 3, 2024 at 7:43 PM fuyuanli <fuyuanli@didiglobal.com> wrote: >>>> >>>> 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 <fuyuanli@didiglobal.com> >>>> Link: https://lore.kernel.org/netdev/20240302105224.GA7223@didi-ThinkCentre-M920t-N000/ >>> >>> Suggested-by: Jason Xing <kerneljasonxing@gmail.com> >>> See https://lore.kernel.org/all/CAL+tcoA=FVBJi2eJgAELhWG_f+N-kwmrHc+XRfKXhYk2RJcPKg@mail.gmail.com/ >> OK, I will submit a v3 patch which updating commit message, thanks. > > I don't think you need to send a new version of the patch unless > someone points out other changes that should be made. I think this patch is not needed anymore, see net-next : 4f41ce81a919 ("net: nlmon: Remove init and uninit functions") 26b5df99bf60 ("net: nlmon: Simplify nlmon_get_stats64") Thanks, Daniel
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)