Received: by 10.213.65.68 with SMTP id h4csp2144029imn; Sun, 8 Apr 2018 20:51:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Caxc0G4CA/Udsfj0QvImcOtDKHAmSXDrEscybe9dredjJDqKWHEBrsEfC5Z1vatOsybU2 X-Received: by 10.98.213.9 with SMTP id d9mr27566833pfg.234.1523245879622; Sun, 08 Apr 2018 20:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523245879; cv=none; d=google.com; s=arc-20160816; b=dkPx30UTjBBLMsbHvC7h5+yG2tRY2dFVF6BvZvBDCEThsGL/TX+xki+JALPQOKKtbT iaiRJhodNtFeSdeoEVCYBa28WwCICXLF1Z+i7Mej1AynX/rNx3UvV76RUOjE4PTSWZaL v1rtBiZMAbiiVn1t4ZpUbYRsp/2mqAznxIX1YCLjihbisNnmOV43yDbwr6yWN9j7WjjE 8zN22MQvRJhk5nHkDQ9Swqpw7boQT8SzRL+1n2hu2IlWdskN308KYaIHitvVAJkTopo3 maXUL3AkKjPoUopcPnnglaP73M1XxpOWmMS/kIXwqNxdFda92oI2c8bufcCeS+wxTcYw XEog== 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=C3OkkdqEBPBYWs5SlbQmpy0LZuNM6owdElrP9QfhcLY=; b=SXJ/Y9GVGM/W+FcVqY2LadQ57KsIqgYM2M8ikrVapbAYBVgA+tWyLaoNVUQKu23GZm ccIb8CIJCc+iL2kzYqQulSj/gadnL8w5fPXC/ByV8/9+cnUh0N58WkEO9AdlpsevFuS/ RmB8kYULZ5RcrNqyQ9yXsv4MJKDxUI3Z0Fla09x1UAAi0t7rC+17a9N2gZsS1zInJcEP OFzHvhBnbFZzAhypHQyE5cqG8hT7s8BsWerm906LNKpbesbf9pfMXvuKtd3r0GMpsPr5 Sxs1f9sW+5phWalEq2MqqToTd/Csl58FXc8vNljQFvhtUSCcDZ8aes3Pnef2oTi/p2ZP 46TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=QvTStqEj; 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 y40-v6si13713725pla.367.2018.04.08.20.50.42; Sun, 08 Apr 2018 20:51:19 -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=QvTStqEj; 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 S1754088AbeDIDps (ORCPT + 99 others); Sun, 8 Apr 2018 23:45:48 -0400 Received: from mail-cys01nam02on0118.outbound.protection.outlook.com ([104.47.37.118]:44776 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754192AbeDIAUQ (ORCPT ); Sun, 8 Apr 2018 20:20: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=C3OkkdqEBPBYWs5SlbQmpy0LZuNM6owdElrP9QfhcLY=; b=QvTStqEjDxcna382y0+29eDssyZeyCQPL7yvcZ2otR7PEU7fSH9ina9OGhrqdfdKfFw1tqDawAqu4MI7N03+uStJbVTxoRTH1SGwNe2qy+2tMjzDEY0M3RVUq6fuAdQ6BaWeMQTbBe4D9/LrL3aPM4qLp5UXVJLTbtepUnda4ks= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1110.namprd21.prod.outlook.com (52.132.131.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:20:11 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:20:11 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mitko Haralanov , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 132/189] IB/hfi1: Show fault stats in both TX and RX directions Thread-Topic: [PATCH AUTOSEL for 4.15 132/189] IB/hfi1: Show fault stats in both TX and RX directions Thread-Index: AQHTz5hKSHzMkxi1NEC9czRfjZ6ysQ== Date: Mon, 9 Apr 2018 00:18:32 +0000 Message-ID: <20180409001637.162453-132-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1110;7:ZaRO/ZQVPlvmnEbLwF8GeoHl6usaHBVcBPjlvekq+ZlcjalMMc+YGB2EUpyrHGUbumPlwxdzQtPHn8olwYcm5SUMv9iySpBvbtyUNfROWX5LlxYooQj+7bUZZQQZB1NviV2l4KzOsAaVVf2hptYZ/+wtvaHAoGZX3KmWZr97LT5d7+4f1nhI0shOIuaTJyTvNz8AoU2CqWI++X6zAFHWN45PUI57bkn71ovb/k8QiytkWLOscIRpS/hw60d2dv7R;20:EXKhs/mkBmBvnh6jszXh52l6SO5tbdWHxV09BvBtn5oafbLoFXHQDuQ5sYkVvT3Hk6aatu08JDgkwYXSSZ7qmYxk81/uUuPzEiQ6jb2Q7DvEPijLbmYoqwfTfsvGF6jVK+qveDifSeOT8mQjjay77XNKA/U4qcJ6NpXR8KGoo3o= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 453371bc-dbb8-4a06-88bd-08d59dafa897 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1110; x-ms-traffictypediagnostic: DM5PR2101MB1110: 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)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1110;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1110; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(199004)(189003)(5660300001)(478600001)(86612001)(3846002)(6116002)(106356001)(6486002)(72206003)(25786009)(10290500003)(8936002)(6436002)(76176011)(2616005)(6506007)(2900100001)(97736004)(486006)(26005)(36756003)(10090500001)(81166006)(8676002)(81156014)(59450400001)(102836004)(2906002)(551984002)(99286004)(11346002)(476003)(3660700001)(66066001)(6512007)(575784001)(86362001)(53936002)(105586002)(186003)(5250100002)(14454004)(22452003)(6666003)(2501003)(446003)(7736002)(316002)(1076002)(110136005)(3280700002)(54906003)(68736007)(107886003)(4326008)(305945005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1110;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: 4nDoExNhK7LAqZs7f1Yskucbr7yYIzHXOhf5CjQdbbQL0GDWuCEnaPvVVwbggM1VLmLpmhMcdUL2vyQ6cFfCJWuYILupfG7bmUsxrZKs+gAaTGlfvpqkcXhk7nBi47TSsDPGMG8tJrpPDhrvUtmIlyQ/SniTstlYBdOs6lXJf+Mri9sZ9ocegOUcxN9LajCYzoDEFWCDWl+xs4i9BZBceeqKvS0rsH49nYjfSVdUILADEctycEx2ZecujJ7u/mAtk++WpYgvoRPN9NJNOm7/mcDcvXg4tNmM7qNrzQEbndFT04OSDlC3ESuMN/ZuEFLinaHxN4XypTbro0St8XcWXg7K8lxEm0E5R3QyT6PsrfNZoepesy5SUA21ohBuWwO4tTPnwhFOX9PiwNGNaZM7zwhWm1CKyS3DWye9EIdt9X4= 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: 453371bc-dbb8-4a06-88bd-08d59dafa897 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:32.5818 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mitko Haralanov [ Upstream commit b5de809ef6f6c32cfbbf0da14ed11b0fdc0888f8 ] The routine which shows the fault stats checks the counters to determine whether to show any stats based on the number of transmitted pkts/bytes for a particular opcode. Unfortunately, it only checked the receive counters. As a result, if any packet faults have happened for packets egressing the HFI, those stats would not be shown. In order to fix this, the routine is amended to also check the TX counters. With this change the pkt/byte counts are the sum of both TX and RX counts for the opcode. Fixes: 1b311f8931cf ("IB/hfi1: Add tx_opcode_stats like the opcode_stats") Reviewed-by: Don Hiatt Reviewed-by: Michael J. Ruhl Signed-off-by: Mitko Haralanov Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hfi1/debugfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/debugfs.c b/drivers/infiniband/hw/h= fi1/debugfs.c index 2e6e0c516041..852173bf05d0 100644 --- a/drivers/infiniband/hw/hfi1/debugfs.c +++ b/drivers/infiniband/hw/hfi1/debugfs.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2015-2017 Intel Corporation. + * Copyright(c) 2015-2018 Intel Corporation. * * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. @@ -1201,6 +1201,13 @@ static int _fault_stats_seq_show(struct seq_file *s,= void *v) } hfi1_rcd_put(rcd); } + for_each_possible_cpu(j) { + struct hfi1_opcode_stats_perctx *sp =3D + per_cpu_ptr(dd->tx_opstats, j); + + n_packets +=3D sp->stats[i].n_packets; + n_bytes +=3D sp->stats[i].n_bytes; + } if (!n_packets && !n_bytes) return SEQ_SKIP; if (!ibd->fault_opcode->n_rxfaults[i] && --=20 2.15.1