Received: by 10.213.65.68 with SMTP id h4csp1856921imn; Mon, 19 Mar 2018 15:23:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELv2KiraiLhNwAgSEs33ekXNlTVF6AV0anwLcXvkd0s+4pTOSaB0eJHbdh/j587tcbnEOFsz X-Received: by 10.98.64.146 with SMTP id f18mr11666210pfd.30.1521498217863; Mon, 19 Mar 2018 15:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521498217; cv=none; d=google.com; s=arc-20160816; b=iEodNAEMCyk+RirKCEwaiEVCJGmI+jYkUPy90paUu2MPbXeEIvjzwQDLKZdvMOibuB C8EHgxZKYzh4LKYUuU4cVzoTFP8NHUWKzZWfWugpgQN8KCUBnqcQWnn+1UqpNxkYNy2J sjXZkk/2fYbbNHeVpgfpOQa0xU8Meqhz4kFBaf6OdfxgYQZwrFdC8LfgVVnKKskSmiDY maYSCJG9NoDafL7xctPXQk8j2WSc0G4ttM7K9+G8QswDUWslDdUGqlyexDsgKDAHMXTE CbzUCM+FpjeGsTBCFNO8Z1TbtcCIGmA9RswWSWS1ZSDV4ZziTj6PED+gPQc7XNR7bdfy NpjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=6kLx05Wj8Hsdqoo1ofGkrE0zsYJ0PNRVcXSBYh4Q31I=; b=awd5vhlXFTIbB7vGGKMOqltLwwvphSJZPa783zTe7DAkwJJq4E45bejknX0VkoMwWI MalqrSsuR3Rs7Vc37vOC8G5EIlqwaTdUHNsbHBNVHlYr/KqXHBKUvvSCnxJCrpxNTlGY vmba9gfRlN8Q0T5KW3u3uS0e/niLQqQcvCwxcjMwUoqWvt2GXu4ByZu6QUrtSYOEnsCJ vYfDzVKCYBfUxI35rVuSJXc9D0tXbRvHa19ixSiEs8OpQT6z3qWX4+DXeBIRpzOWVe3y +jUDTwYHqWWMaNGaaYWdQYdHP+aRxH9JRSQQKwPP91S5iYSCRd6RX5KgPAaBOn26KAjg clmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Qvnc1mB1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si146120pgp.16.2018.03.19.15.23.23; Mon, 19 Mar 2018 15:23:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Qvnc1mB1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032520AbeCSWVm (ORCPT + 99 others); Mon, 19 Mar 2018 18:21:42 -0400 Received: from mail-cys01nam02on0096.outbound.protection.outlook.com ([104.47.37.96]:43108 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933841AbeCSPtQ (ORCPT ); Mon, 19 Mar 2018 11:49:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6kLx05Wj8Hsdqoo1ofGkrE0zsYJ0PNRVcXSBYh4Q31I=; b=Qvnc1mB1BbrLvk6/maRuZPdlXhty4T9K7tCn/bkjzSQOlmalic0n2oEvueFwPFL0utcY/KogHW7D+VrM8eJh6EgH1OTECTGsymGXOp5aExrElHr/s5oPI3fyYiAH6+0I6QVCAVGDLcdgGX6Dxh+8NTrLMf+/qlm2Td85C3G9d+g= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:48:59 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:48:59 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jian Shen , Peng Li , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 078/124] net: hns3: Fix an error of total drop packet statistics Thread-Topic: [PATCH AUTOSEL for 4.15 078/124] net: hns3: Fix an error of total drop packet statistics Thread-Index: AQHTv5m3Z7aQVszy5E+Xuc8IOVITiA== Date: Mon, 19 Mar 2018 15:48:25 +0000 Message-ID: <20180319154645.11350-78-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0919;7:6CZtIc5AjvmEGKecqH4lndkEzKRJUvuOCiFkVuIlbc0TFKPzb60Gw9m3YGa6w1damrJZY7s14KDB7LDMRGYp2k8W4I53v7mXo0uUBN9X3wtoFiUGCkvOouAT5O+kKJQE8dQgxWBG20a+TLMRAXtshnYkzbpHnb24fQCm9wNsw9uXc9ommZfNAq95zK+nrM2cQAmRHweuNzeWXgyiPlxlqOSXUHHHL0/RuATF3Y0Yw80qCaMcLAS7dxqCsC3quTLL;20:kRfDolUiWvcIyXxyELbaAloR670fH5KOdZ5v9BmNIM4koCfxOAPJTtAlP4zmo88rAl/m79NaZxWEB9S5+euujMLJhpA/KsOTczCUCqABMBlFGUz1pYPjAKV7zH1Rf0SfCJlwKg9tXtGc/tLTbR8rGYmuAgN/kq275rZAw2prTqw= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1ad86fa3-ff12-4869-9fec-08d58db0ee24 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0919; x-ms-traffictypediagnostic: DM5PR2101MB0919: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(50582790962513); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0919;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0919; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(39860400002)(396003)(39380400002)(346002)(199004)(189003)(6512007)(5250100002)(106356001)(99286004)(102836004)(2501003)(6116002)(1076002)(3846002)(186003)(10090500001)(76176011)(6486002)(25786009)(316002)(26005)(22452003)(68736007)(6436002)(2900100001)(54906003)(2950100002)(6666003)(72206003)(81156014)(3660700001)(4326008)(7736002)(110136005)(305945005)(478600001)(3280700002)(6506007)(97736004)(81166006)(8676002)(10290500003)(575784001)(66066001)(2906002)(86362001)(105586002)(8936002)(53936002)(36756003)(14454004)(86612001)(5660300001)(107886003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0919;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Heux2VQ0z+ZdJg8CN76GiRUAT91nY9VBUgDZWpygjQnDWTaR+Wxoi8mxa/AYb0lWy4uCEdpZR5W1VedPJODgbgcOR+7v1Qiw+h5LusfRCBMJtMedNCgHRnKw9GMbQ8QGqv6iY7uGWS+inzX1suKu5kItYg/7cDkKyL4J8/JG9f0nqZt5/0EOD9Ds2Jh+kRxy5M40mOZA3tm/YoYZDHOjRyXzKgWQlOLjSIrTUf3UEcwGfoGSkF+0p3r6SaExHGFTUKUjROOrFd4Ht+N5wDavwl6IgkJeFFoGvjyYcWGLdsutEaQxEnEewgg6VE78MyFALkMR9ykmu/95No+e+DsVSA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ad86fa3-ff12-4869-9fec-08d58db0ee24 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:48:25.5656 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0919 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen [ Upstream commit d2a5dca8404871be683c6bbc175ebf9c56dd2865 ] The dropped tx/rx packets number of each tqp should also be counted into the total drop tx/rx packets numbers. Fixes: 76ad4f0ee74 ("net: hns3: Add support of HNS3 Ethernet Driver for hip= 08 SoC") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drive= rs/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c index 853f273da22d..428ede16b10a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c @@ -1055,6 +1055,8 @@ hns3_nic_get_stats64(struct net_device *netdev, struc= t rtnl_link_stats64 *stats) u64 rx_bytes =3D 0; u64 tx_pkts =3D 0; u64 rx_pkts =3D 0; + u64 tx_drop =3D 0; + u64 rx_drop =3D 0; =20 for (idx =3D 0; idx < queue_num; idx++) { /* fetch the tx stats */ @@ -1063,6 +1065,8 @@ hns3_nic_get_stats64(struct net_device *netdev, struc= t rtnl_link_stats64 *stats) start =3D u64_stats_fetch_begin_irq(&ring->syncp); tx_bytes +=3D ring->stats.tx_bytes; tx_pkts +=3D ring->stats.tx_pkts; + tx_drop +=3D ring->stats.tx_busy; + tx_drop +=3D ring->stats.sw_err_cnt; } while (u64_stats_fetch_retry_irq(&ring->syncp, start)); =20 /* fetch the rx stats */ @@ -1071,6 +1075,9 @@ hns3_nic_get_stats64(struct net_device *netdev, struc= t rtnl_link_stats64 *stats) start =3D u64_stats_fetch_begin_irq(&ring->syncp); rx_bytes +=3D ring->stats.rx_bytes; rx_pkts +=3D ring->stats.rx_pkts; + rx_drop +=3D ring->stats.non_vld_descs; + rx_drop +=3D ring->stats.err_pkt_len; + rx_drop +=3D ring->stats.l2_err; } while (u64_stats_fetch_retry_irq(&ring->syncp, start)); } =20 @@ -1086,8 +1093,8 @@ hns3_nic_get_stats64(struct net_device *netdev, struc= t rtnl_link_stats64 *stats) stats->rx_missed_errors =3D netdev->stats.rx_missed_errors; =20 stats->tx_errors =3D netdev->stats.tx_errors; - stats->rx_dropped =3D netdev->stats.rx_dropped; - stats->tx_dropped =3D netdev->stats.tx_dropped; + stats->rx_dropped =3D rx_drop + netdev->stats.rx_dropped; + stats->tx_dropped =3D tx_drop + netdev->stats.tx_dropped; stats->collisions =3D netdev->stats.collisions; stats->rx_over_errors =3D netdev->stats.rx_over_errors; stats->rx_frame_errors =3D netdev->stats.rx_frame_errors; --=20 2.14.1