From: "Michael S. Tsirkin" <mst@redhat.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
Jonathan Corbet <corbet@lwn.net>,
"David S. Miller" <davem@davemloft.net>,
Hans Verkuil <hans.verkuil@cisco.com>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Alexei Starovoitov <ast@plumgrid.com>,
stephen hemminger <stephen@networkplumber.org>,
Masahiro Yamada <yamada.m@jp.panasonic.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Andy Lutomirski <luto@amacapital.net>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Stephane Eranian <eranian@google.com>,
Huang Rui <ray.huang@amd.com>,
Peter Neubauer <pneubauer@bluerwhite.org>,
linux-pci@vger.kernel.org, linux-doc@vger.kernel.org,
linux-api@vger.kernel.org
Subject: Re: [PATCH 01/86] pci: export pci_ids.h
Date: Mon, 30 Mar 2015 10:31:54 +0200 [thread overview]
Message-ID: <20150330101830-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <20150330075331.GA17823@kroah.com>
On Mon, Mar 30, 2015 at 09:53:31AM +0200, Greg KH wrote:
> On Mon, Mar 30, 2015 at 09:15:26AM +0200, Michael S. Tsirkin wrote:
> > On Mon, Mar 30, 2015 at 08:55:22AM +0200, Greg KH wrote:
> > > On Mon, Mar 30, 2015 at 08:48:44AM +0200, Michael S. Tsirkin wrote:
> > > > On Sun, Mar 29, 2015 at 10:40:47PM +0200, Greg KH wrote:
> > > > > On Sun, Mar 29, 2015 at 03:37:01PM +0200, Michael S. Tsirkin wrote:
> > > > > > The macros in pci_ids.h are pretty useful for userspace
> > > > > > using the pci sysfs interface.
> > > > > > At the moment userspace is forced to duplicate these macros
> > > > > > (e.g. QEMU does this), it is better to expose them in
> > > > > > /usr/include/linux/pci_ids.h so everyone can just include
> > > > > > this header.
> > > > > >
> > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > > > > ---
> > > > > > include/linux/pci_ids.h | 2998 +-----------------------------------------
> > > > > > include/uapi/linux/pci_ids.h | 2997 +++++++++++++++++++++++++++++++++++++++++
> > > > >
> > > > > No, please use the pci ids file from the upstream pci id database
> > > > > instead.
> > > >
> > > >
> > > > > We shouldn't be putting these all in one file,
> > > >
> > > > pci.txt says:
> > > > Please add PCI_VENDOR_ID_xxx for vendors
> > > > You want to change this policy, and get rid of
> > > > vendor ids in pci_ids.h completely?
> > >
> > > Please read the top of pci_ids.h. It hasn't had new ids added to it in
> > > a long time.
> >
> > OK, looks like pci.txt should be fixed then.
>
> Please send a patch. As the original PCI kernel maintainer, I don't
> think I ever noticed pci.txt. It was last "updated" in 2006...
>
> > > Why would userspace need the pci id of anything?
> >
> > Look at how they are used e.g. by QEMU, seabios, gpxe.
> > People want to say e.g. "find all network class devices".
>
> Then use libpci.
>
> > > Again, just use
> > > libpci, isn't it fast enough? Don't duplicate existing logic.
> >
> > This really depends on whether you want something else that
> > libpci provides. But if I just want e.g. standard class IDs,
> > I don't want to depend on libpci.
>
> Why not? Don't duplicate things that already are there just for this
> very use.
>
> Don't make us do kernel changes just because you don't want to depend on
> either of the two different userspace packages that provide this
> information in a standard way for userspace. Your system will have one
> of those two packages in it, depending on it isn't a "burden" at all.
>
> > > Or use the hw database that libudev exports, which is already on your
> > > machine and exports all of the pci ids from libpci directly.
> >
> > Same argument really.
>
> Because you don't want to depend on existing packages, doesn't mean we
> have to accept kernel changes and maintain them for forever, as you are
> now creating a new api that we will have to keep up to date and correct
> for all time.
>
> Again, depend on the packages that are already doing this work please.
>
Maintaining correct class IDs is more or less a requirement
for kernel to work properly, isn't it?
Wouldn't the same thing apply to pci_regs.h?
Why does it make sense to export PCI_CLASS_REVISION
so I know where to read the class value from
configuration, but not what the values are?
> > > > Standard class IDs are even sillier to duplicate.
> > >
> > > Again, why does userspace need this?
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > Mostly because it has a userspace driver, or is emulating
> > a hardware device.
> >
> > For example, the VFIO driver uses the PCI hardware formats
> > as it's userspace/kernel interface. This means I need
> > a ton of PCI constants in userspace. Most of them are
> > already in pci_regs.h, and so exported. No problem here.
> >
> > However class and prog interface IDs are not, they
> > are in pci_ids.h
> >
> > Would you support splitting pci_ids.h to
> > include/uapi/linux/pci_ids.h with standard headers
> > and include/linux/pci_ids.h with device/vendor
> > specific ones?
>
> No, again, please use the "standard" Linux apis for these, don't
> duplicate work and make people do more work over the long-term than is
> needed.
>
> thanks,
>
> greg k-h
What's the work you refer to? This is just hardware description it
can't change and doesn't need to be maintained.
--
MST
next prev parent reply other threads:[~2015-03-30 8:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-29 13:36 [PATCH 00/86] pci: export pci_ids.h and related cleanups Michael S. Tsirkin
2015-03-29 13:37 ` [PATCH 01/86] pci: export pci_ids.h Michael S. Tsirkin
2015-03-29 15:49 ` Joe Perches
2015-03-29 20:40 ` Greg KH
2015-03-30 6:48 ` Michael S. Tsirkin
2015-03-30 6:55 ` Greg KH
2015-03-30 7:15 ` Michael S. Tsirkin
2015-03-30 7:53 ` Greg KH
2015-03-30 8:31 ` Michael S. Tsirkin [this message]
2015-03-30 10:07 ` Greg KH
2015-03-30 10:46 ` Michael S. Tsirkin
2015-03-30 10:57 ` Greg KH
2015-03-30 11:19 ` Michael S. Tsirkin
2015-03-30 11:35 ` Greg KH
2015-03-30 11:41 ` Michael S. Tsirkin
2015-03-29 13:38 ` [PATCH 12/86] x86/pci/sta2x11: use uapi/linux/pci_ids.h directly Michael S. Tsirkin
2015-03-29 13:41 ` [PATCH 58/86] pci-label: " Michael S. Tsirkin
2015-03-29 13:43 ` [PATCH 77/86] linux/pci: " Michael S. Tsirkin
2015-03-29 13:43 ` [PATCH 78/86] linux/pci: drop include/linux/pci_ids.h Michael S. Tsirkin
2015-03-29 17:59 ` [PATCH 00/86] pci: export pci_ids.h and related cleanups Joe Perches
2015-03-30 6:52 ` Michael S. Tsirkin
2015-03-29 23:15 ` Stefan Richter
2015-04-02 7:44 ` Jean Delvare
2015-04-02 7:49 ` Michael S. Tsirkin
2015-04-02 8:23 ` Christoph Hellwig
2015-04-02 9:04 ` Jean Delvare
2015-04-02 10:09 ` Michael S. Tsirkin
2015-04-02 11:15 ` Jean Delvare
2015-04-02 12:05 ` Michael S. Tsirkin
2015-04-02 13:17 ` Jean Delvare
2015-04-02 12:09 ` Michael S. Tsirkin
2015-04-02 14:34 ` Alex Williamson
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=20150330101830-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ast@plumgrid.com \
--cc=bhelgaas@google.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=eranian@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hans.verkuil@cisco.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=luto@amacapital.net \
--cc=mchehab@osg.samsung.com \
--cc=pneubauer@bluerwhite.org \
--cc=ray.huang@amd.com \
--cc=stephen@networkplumber.org \
--cc=yamada.m@jp.panasonic.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).