Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp811956lqg; Sat, 2 Mar 2024 02:55:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV9YllOQOZFZnnADvFNDAhGKVwqHokmBNtN4S5XdgINYm1DWesB3n9shtiobhX2ZQ3C7dm8C+v+pmv54qzms9JzaKL3ZVaTA3jZAgserQ== X-Google-Smtp-Source: AGHT+IE4Unt5k7ds0Lhna+rbIzwjzjl7n3pcgpvOq2oafIfEyrUkjiIaSueEuhsLulgXGEeexTqe X-Received: by 2002:ac8:57c4:0:b0:42e:dd8b:ff58 with SMTP id w4-20020ac857c4000000b0042edd8bff58mr1095514qta.47.1709376953345; Sat, 02 Mar 2024 02:55:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709376953; cv=pass; d=google.com; s=arc-20160816; b=fibrnDlKY8OKwRVQC7sSPOF5PAzzyJInP/mN0I5cqhEagBupWPp6UimXSoBv6RQGuK VlOwU7DUrS8Gt7WYEbmtkFJzKAI1n/NOzF7V8L4CIhAQj+OfXMZPt3AJ34j2wKe/5YQa WiXmlMwfZTSd8hIsFQJtsqAAuDgSk7bNaTyz7zXAKFQnElYSOLoM+Wg7+ACw8mXtvi0X IL87tDISKqbOV+twct+C5P3NxJzSGqVSSlfNmnjxfg+lzU+CGJRspCK+KpCEV0M30/S4 f8ytFpRg4XxQESrZvWIqiicRrcMKCqEvRVCee5YYsE/dRxUB334mWLVqlvE/VaXH2rl4 O4hw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=didiglobal.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y9-20020ac85f49000000b0042eb8dd7ff4si5787271qta.680.2024.03.02.02.55.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 02:55:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89422-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0A8E61C2121F for ; Sat, 2 Mar 2024 10:55:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E81617548; Sat, 2 Mar 2024 10:55:45 +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-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 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) -- 2.17.1