From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC94CC3A5A6 for ; Thu, 29 Aug 2019 23:18:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E4BC21874 for ; Thu, 29 Aug 2019 23:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567120721; bh=AH5ObS311XGO7RKzoWI2/U/YlNrE6TQMsHRmMBUDIv8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=wB9r1zk3Krrxc3eUV4nmleoTmyehzWb7pjx3z9j/iR4KPFNwJ9q99cZBfonG2J9yn 1jvDRqQh0x2UGBHkJ99QiqU8Usfc1Y6wHR2UPe7lug1ZxfER1+BHuxfCQw7HJK7Rdt iSqaEtHdvQUfl8C57DQS64MqI0SZ4tDoFcI2abhk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728232AbfH2XSk (ORCPT ); Thu, 29 Aug 2019 19:18:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:37478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727907AbfH2XSk (ORCPT ); Thu, 29 Aug 2019 19:18:40 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 11C2721670; Thu, 29 Aug 2019 23:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567120719; bh=AH5ObS311XGO7RKzoWI2/U/YlNrE6TQMsHRmMBUDIv8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jIOpA2Oa8YGYXtDJ4MbC2lmRCETIDlVUrQYTE3YiuS9ERORcq9MNpe1b9m6oT3m1w 26n+KmbiYTb/sVRa4ZMpnyXpimlWXP2KM7xmNON91E6HOb8yclGyrzgbU1Dx1cgV35 zYn8Ee727w3B2X9VxuzmVMU6dM8aEYYyHGM525LY= Date: Thu, 29 Aug 2019 18:18:37 -0500 From: Bjorn Helgaas To: Rajat Jain Cc: gregkh@linuxfoundation.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, rajatxjain@gmail.com Subject: Re: [PATCH v3 2/2] PCI/AER: Split the AER stats into multiple sysfs attributes Message-ID: <20190829231837.GA18204@google.com> References: <20190827062309.GA30987@kroah.com> <20190827222145.32642-1-rajatja@google.com> <20190827222145.32642-2-rajatja@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827222145.32642-2-rajatja@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rajat, On Tue, Aug 27, 2019 at 03:21:45PM -0700, Rajat Jain wrote: > Split the AER stats into multiple sysfs atributes. Note that > this changes the ABI of the AER stats, but hopefully, there > aren't active users that need to change. This is how the AERs > are being exposed now: > > localhost /sys/devices/pci0000:00/0000:00:1c.0/aer_stats # ls -l Possible s/aer_stats/aer/ to make the path shorter? > -r--r--r--. 1 root root 4096 Aug 20 16:35 correctable_bit0_RxErr > -r--r--r--. 1 root root 4096 Aug 20 16:35 correctable_bit12_Timeout > -r--r--r--. 1 root root 4096 Aug 20 16:35 correctable_bit13_NonFatalErr > ... > -r--r--r--. 1 root root 4096 Aug 20 16:35 fatal_bit0_Undefined > -r--r--r--. 1 root root 4096 Aug 20 16:35 fatal_bit12_TLP > -r--r--r--. 1 root root 4096 Aug 20 16:35 fatal_bit13_FCP > ... > -r--r--r--. 1 root root 4096 Aug 20 16:35 nonfatal_bit0_Undefined > -r--r--r--. 1 root root 4096 Aug 20 16:35 nonfatal_bit12_TLP > -r--r--r--. 1 root root 4096 Aug 20 16:35 nonfatal_bit13_FCP > ... The AER registers are named "Correctable Error Status" and "Uncorrectable Error Status". Fatal & nonfatal errors are both reported in the Uncorrectable Error Status register; the distinction comes from the Uncorrectable Error Severity register. E.g., there's only one bit in the Uncorrectable Error Status register for "Poisoned TLB Received" ("bit12_TLP" above), and it's fatal or nonfatal depending on the Error Severity setting. So I propose that you expose "correctable" files and "uncorrectable" files instead of "correctable", "fatal", and "nonfatal". Then if you need the severity information you could add a new file for "uncorrectable severity". IIUC these files are counts of how many errors have been logged. Maybe add "_count" at the end? I think that would be more informative than the "bitN" part, although it's not completely obvious how to map some of these (TLP, FCP, DLP, SDES) to the spec; maybe they could be expanded? > -r--r--r--. 1 root root 4096 Aug 20 16:35 total_device_err_cor > -r--r--r--. 1 root root 4096 Aug 20 16:35 total_device_err_fatal > -r--r--r--. 1 root root 4096 Aug 20 16:35 total_device_err_nonfatal > -r--r--r--. 1 root root 4096 Aug 20 16:35 total_rootport_err_cor > -r--r--r--. 1 root root 4096 Aug 20 16:35 total_rootport_err_fatal > -r--r--r--. 1 root root 4096 Aug 20 16:35 total_rootport_err_nonfatal > localhost /sys/devices/pci0000:00/0000:00:1c.0/aer_stats # > > Each file is has a single counter value. Single file containing all s/is has/contains/ Bjorn