On Fri, Jan 31, 2025 at 6:33 AM Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> wrote: > > On Tue, 14 Jan 2025 23:42:58 -0800 > Jon Pan-Doh <pandoh@xxxxxxxxxx> wrote: > > + > > +These attributes show up under all the devices that are AER capable. Provides > > +configurable ratelimits of logs/irq per error type. Writing a nonzero value > > +changes the number of errors (burst) allowed per 5 second window before > > +ratelimiting. Reading gets the current ratelimits. > > + > > +What: /sys/bus/pci/devices/<dev>/aer/ratelimit_cor_irq > > +Date: Jan 2025 > > +KernelVersion: 6.14.0 > > +Contact: linux-pci@xxxxxxxxxxxxxxx, pandoh@xxxxxxxxxx > > +Description: IRQ ratelimit for correctable errors. > > I would add enough info that we can understand what values to write and what > to read to each description. This doc didn't lead me to the comment below > and it should have done... Since there's a lot of commonality in the descriptions, I opted for putting the bulk of info at the top of "PCIe AER ratelimits" section. I believe I already wrote what should be written/read. Is there extra specificity you are looking for? How does this look? PCIe AER ratelimits ------------------- These attributes show up under all the devices that are AER capable. They represent configurable ratelimits of logs per error type. Writing a value changes the number of errors (burst) allowed per interval (5 second window) before ratelimiting. Reading gets the current ratelimit burst. See Documentation/PCI/pcieaer-howto.rst for more info on ratelimits. What: /sys/bus/pci/devices/<dev>/aer/ratelimit_in_5secs_cor_log Date: March 2025 KernelVersion: 6.15.0 Contact: linux-pci@xxxxxxxxxxxxxxx, pandoh@xxxxxxxxxx Description: Ratelimit burst for correctable error logs. > > +#define aer_ratelimit_attr(name, ratelimit) \ > > + static ssize_t \ > > + name##_show(struct device *dev, struct device_attribute *attr, \ > > + char *buf) \ > > +{ \ > > + struct pci_dev *pdev = to_pci_dev(dev); \ > > + return sysfs_emit(buf, "%u errors every %u seconds\n", \ > > + pdev->aer_info->ratelimit.burst, \ > > + pdev->aer_info->ratelimit.interval / HZ); \ > > Usual rule of thumb is you need a very strong reason to read something > different from what was written to a sysfs file. Ack. Will make read/write symmetric in v3. > I think your interval is fixed? If so name the files so that is apparent > and just have a count returned here. Or if you want to future proof > add a read only ratelimit_period_secs file that prints 5 > > ratelimit_in_5secs_uncor_log etc. Yes, the interval is fixed. Will update sysfs entry names to be more specific in v3. Thanks, Jon