[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240708005533.GC586698@rocinante>
Date: Mon, 8 Jul 2024 09:55:33 +0900
From: Krzysztof WilczyĆski <kw@...ux.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: Alistair Francis <alistair23@...il.com>, bhelgaas@...gle.com,
linux-pci@...r.kernel.org, lukas@...ner.de,
alex.williamson@...hat.com, christian.koenig@....com,
kch@...dia.com, gregkh@...uxfoundation.org, logang@...tatee.com,
linux-kernel@...r.kernel.org, chaitanyak@...dia.com,
rdunlap@...radead.org, Alistair Francis <alistair.francis@....com>
Subject: Re: [PATCH v13 3/4] PCI/DOE: Expose the DOE features via sysfs
Hello,
> > Any input from a PCI maintainer here?
Something that I am curious about: can we make this a single file with a
bitmask inside that denotes what DOE features are enabled? Would this be
approach be even feasible here?
Thoughts? Or is it too late to think about this now?
> > There are basically two approaches.
> >
> > 1. We can have a pci_doe_sysfs_init() function that is called where
> > we dynamically add the entries, like in v12
> > 2. We can go down the dev->groups and device_add() path, like this
> > patch and discussed at
> > https://lore.kernel.org/all/20231019165829.GA1381099@bhelgaas/
> >
> > For the second we will have to create a global pci_doe_sysfs_group
> > that contains all possible DOE entries on the system and then have the
> > show functions determine if they should be displayed for that device.
> >
> > Everytime we call pci_doe_init() we can check for any missing entries
> > in pci_doe_sysfs_group.attrs and then realloc
> > pci_doe_sysfs_group.attrs to add them.
> > Untested, but that should work
> > even for hot-plugged devices. pci_doe_sysfs_group.attrs would just
> > grow forever though as I don't think we have an easy way to deallocate
> > anything as we aren't sure if we are the only entry.
>
> I think this needs to be per device, not global and you'll have to manually
> do the group visibility magic rather than using the macros.
Lukas proposes a very interesting feature of kernfs recently per:
https://lore.kernel.org/linux-pci/16490618cbde91b5aac04873c39c8fb7666ff686.1719771133.git.lukas@wunner.de
Would this help with DOE features?
Krzysztof
Powered by blists - more mailing lists