From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:46041 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753074AbbC3HPf (ORCPT ); Mon, 30 Mar 2015 03:15:35 -0400 Date: Mon, 30 Mar 2015 09:15:26 +0200 From: "Michael S. Tsirkin" To: Greg KH Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas , Jonathan Corbet , "David S. Miller" , Hans Verkuil , Mauro Carvalho Chehab , Alexei Starovoitov , stephen hemminger , Masahiro Yamada , Andy Shevchenko , Andy Lutomirski , Rasmus Villemoes , Stephane Eranian , Huang Rui , Peter Neubauer , 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 Message-ID: <20150330085617-mutt-send-email-mst@redhat.com> References: <1427635734-24786-1-git-send-email-mst@redhat.com> <1427635734-24786-2-git-send-email-mst@redhat.com> <20150329204047.GA5902@kroah.com> <20150330083707-mutt-send-email-mst@redhat.com> <20150330065522.GA10105@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20150330065522.GA10105@kroah.com> Sender: linux-pci-owner@vger.kernel.org List-ID: 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 > > > > --- > > > > 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. > > Bjorn, what do you think of this? > > > > > and pulling > > > them out of drivers isn't ok. > > > > This patchset is not pulling any files out of drivers fwiw. > > It did for the USB gadget driver patch that I commented on. > > > > Userspace shouldn't need to know any of these, use libpci. > > > > Unless I'm mistaken, libpci does not export a header with defines. It > > has a text file pci.ids, but parsing that when all I want is e.g. locate > > all intel devices is just too much overhead. No one wants that, so > > people just duplicate headers. > > 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". > 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. > 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. > > 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? -- MST