From: "Krzysztof Wilczyński" <kw@linux.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alistair Francis <alistair23@gmail.com>,
bhelgaas@google.com, linux-pci@vger.kernel.org, lukas@wunner.de,
alex.williamson@redhat.com, christian.koenig@amd.com,
kch@nvidia.com, gregkh@linuxfoundation.org, logang@deltatee.com,
linux-kernel@vger.kernel.org, chaitanyak@nvidia.com,
rdunlap@infradead.org,
Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH v13 3/4] PCI/DOE: Expose the DOE features via sysfs
Date: Mon, 8 Jul 2024 09:55:33 +0900 [thread overview]
Message-ID: <20240708005533.GC586698@rocinante> (raw)
In-Reply-To: <20240705112953.00007303@Huawei.com>
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
next prev parent reply other threads:[~2024-07-08 0:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 6:04 [PATCH v13 1/4] PCI/DOE: Rename DOE protocol to feature Alistair Francis
2024-07-02 6:04 ` [PATCH v13 2/4] PCI/DOE: Rename Discovery Response Data Object Contents to type Alistair Francis
2024-07-02 6:04 ` [PATCH v13 3/4] PCI/DOE: Expose the DOE features via sysfs Alistair Francis
2024-07-02 11:57 ` Chaitanya Kulkarni
2024-07-02 13:58 ` Jonathan Cameron
2024-07-05 1:24 ` Alistair Francis
2024-07-05 10:29 ` Jonathan Cameron
2024-07-08 0:55 ` Krzysztof Wilczyński [this message]
2024-07-09 0:50 ` Alistair Francis
2024-07-02 6:04 ` [PATCH v13 4/4] PCI/DOE: Allow enabling DOE without CXL Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240708005533.GC586698@rocinante \
--to=kw@linux.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=bhelgaas@google.com \
--cc=chaitanyak@nvidia.com \
--cc=christian.koenig@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=lukas@wunner.de \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.