From patchwork Sat Mar 2 10:52:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fuyuanli X-Patchwork-Id: 209212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp419388dyc; Sat, 2 Mar 2024 03:01:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX8JN4A0tjzxlQkwTy2i5+HYWo+dKuADAWlCBR27uIZ4HrYDSm8pd9C5GRCftiN1eDV6pUboHyInLUDC8/FG2ZjLN+21Q== X-Google-Smtp-Source: AGHT+IFOxKCVSV/obqDZjISJ/sEFoNOZx66LMhU+ZeNrzVhafVtlpd6lt0JgjNlIF9H1xut+qxvh X-Received: by 2002:a17:906:3846:b0:a3d:ed30:11c8 with SMTP id w6-20020a170906384600b00a3ded3011c8mr3232686ejc.15.1709377297582; Sat, 02 Mar 2024 03:01:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709377297; cv=pass; d=google.com; s=arc-20160816; b=ixVNUfhDKKFU9baPO690SU7RUFqs5Qb0ZPCVng2uX60sTaODqdvFMpQn9zyDJMgoGi zCoFopXyOMFxBluHucboyPn+mVD2Spr5fJDN64kCVbI2k8KenlNg6IfXJOiMKzwxBG4Y LXlTlo1Z98WbEzJpWKz6JvCsQEDPw9JVJicP1ZGMew3atqplkLU1sUTRWchQ55dMPaJj 0aXt4I7fpHjkvD0U8LVAggki6GId0fDD4tu0lhc5hYZP1W+f1HPzA1GnagXMLqdmidhC LS6RQrCctPrWk9TmaaAS+GKB6GD3s/T8f7oUwxwdwtgv2xpaQfK6WhbwzyGOyzp1iC+5 j/5Q== 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=N6hIyfLW+dhSufTd2lqeGlldn5YcoR1eTmynvFsvwT4=; fh=r6OXzUJWosj6Vsa/uU0mCYWt0wLq9tDfGIZJTEPRJl8=; b=N126hvn4Ns7GqGvVeSxEK42ClLKBs6XSSzPnjt0G76ydYhUb2H47MlmwEmQWaYSkOV BOM7PIXiBHnesGkkK8Fle3tHivWAkI3v5DJbH3rpYGlStb5t/G6/VYXdh65bewTWm2fa LACaJK80+acmWBVMhJbuTNfcnm9QCMHtQxxn5jH8qXAB9GFUZYTjS8F/IMrFa64OLsTp mWD3VHHrr3d0rb0hUNP22aY5FKs80ZLemwIIicCkEjeao8mU3SIG913iCAHJ2mY1aXNz 6+IVOwZH0ZJ8p07KQwizxHjbVCe9PfzYXSlnttnghRochNIK3RHSJKyv+/ZzCMstys3x 1ktw==; 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-89422-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89422-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=didiglobal.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sh10-20020a1709076e8a00b00a44f4a9ea37si92529ejc.55.2024.03.02.03.01.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 03:01:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89422-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-89422-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89422-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AE9D21F23F02 for ; Sat, 2 Mar 2024 10:56:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4978217576; Sat, 2 Mar 2024 10:55:46 +0000 (UTC) Received: from mx10.didiglobal.com (mx10.didiglobal.com [111.202.70.125]) by smtp.subspace.kernel.org (Postfix) with SMTP id D84A56AD6; Sat, 2 Mar 2024 10:55:42 +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=1709376944; cv=none; b=dk8ZzPzVQ9PW9R3EzqJYMRGpO6wzOSs9EQuY0YEUro88RoCeVmH5efsuekkoUIEJb4RN7Tg7oVkYJvnDZ9ivcqnQJfLlfD9YbOX9T4Nnlp50yx5EMk5RL62r3XcByhMk66SDI3MYuzU8MMTmkEX8ErvUNIDP4pGDFiSnXauHnpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709376944; c=relaxed/simple; bh=3XioTpY8UndFIGe5+xld28+YcpEE3AwYivnNJ176usg=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Ql455zOUIxmYB479Er+jiemCHw4HuZ5tMlzIZJx+Ui/+jxyTDi6Lk856FWk8pn1TbMWkG3GunoiSFYkM3QSTXpiGmaJqJ2mBP3IW2L4JUlfsasIZtG4b9mjvTP6WwRo2KeAvX4M+bDLU+MYijsL/6Q9315/LqOD4dA8PLZTYsYk= 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 9CBCC18B4B6941; Sat, 2 Mar 2024 18:52:30 +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; Sat, 2 Mar 2024 18:52:29 +0800 Date: Sat, 2 Mar 2024 18:52:24 +0800 X-MD-Sfrom: fuyuanli@didiglobal.com X-MD-SrcIP: 10.79.65.12 From: fuyuanli To: , , , CC: , , Subject: [PATCH net-next] net/nlmon: Cancel setting filelds of statistics to zero. Message-ID: <20240302105224.GA7223@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: 1792412009196851586 X-GMAIL-MSGID: 1792412009196851586 Since filelds of rtnl_link_stats64 have been set to zero in previous dev_get_stats function, there is no need to set again in ndo_get_stats64 function. Signed-off-by: fuyuanli --- 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)