From: Bjorn Helgaas <helgaas@kernel.org>
To: Jordan Hargrave <jharg93@gmail.com>
Cc: Hannes Reinecke <hare@suse.de>,
Jordan Hargrave <Jordan_Hargrave@dell.com>,
Bjorn Helgaas <bhelgaas@google.com>,
alexander.duyck@gmail.com, linux-pci@vger.kernel.org,
babu.moger@oracle.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Create sysfs entries for PCI VPDI and VPDR tags
Date: Sun, 10 Apr 2016 16:26:32 -0500 [thread overview]
Message-ID: <20160410212632.GA5852@localhost> (raw)
In-Reply-To: <CAC1AzddUqEScGgUqPxa8CgLSH3gynVcj71vMNn6b-Roi2YTRUQ@mail.gmail.com>
On Fri, Feb 19, 2016 at 08:07:13AM -0600, Jordan Hargrave wrote:
> On Fri, Feb 19, 2016 at 4:00 AM, Hannes Reinecke <hare@suse.de> wrote:
> >
> > On 02/18/2016 09:04 PM, Jordan Hargrave wrote:
> > > The VPD-R is a readonly area of the PCI Vital Product Data region.
> > > There are some standard keywords for serial number, manufacturer,
> > > and vendor-specific values. Dell Servers use a vendor-specific
> > > tag to store number of ports and port mapping of partitioned NICs.
> > >
> > > info = VPD-Info string
> > > PN = Part Number
> > > SN = Serial Number
> > > MN = Manufacturer ID
> > > Vx = Vendor-specific (x=0..9 A..Z)
> > >
> > > This creates a sysfs subdirectory in the pci device: vpdattr with
> > > 'info', 'EC', 'SN', 'V0', etc. files containing the tag values.
> > >
> > > Signed-off-by: Jordan Hargrave <Jordan_Hargrave@dell.com>
> > Hmm. Can we first get an agreement on the PCI VPD parsing patches
> > I've posted earlier?
> > VPD parsing is really tricky, and we should aim on making the
> > read_vpd function robust enough before we begin putting things into
> > sysfs.
> >
> > Also, I'm not utterly keen on this patchset.
> > The sysfs space is blown up with tiny pieces of information, which
> > can easily gotten via lspci, too.
> >
> > Also, to my knowledge it's perfectly valid to _write_ to the VPD, in
> > which case the entire sysfs attribute setup would be invalided.
> > How do you propose to handle that?
> >
>
> This patch only reads the attributes from VPD-I and VPD-R areas, not
> the VPD-W (read write) area.
> The VPD-W data is located after the VPD-I and VPD-R area So nothing
> in these attributes should change.
>
> The main reason I want this is for replacing biosdevname (ethernet
> naming) functionality and getting
> the same functionality into the kernel and systemd. Systemd doesn't
> want to do vpd parsing, and
> reading the vpd can take a very long time on some devices, causing
> systemd to timeout.
Your patch really does two things: (1) caches the VPDI and VPD-R data
data, and (2) adds sysfs entries to parse items out of that cached
data. The speedup is from the caching, not the kernel parsing.
Maybe we should consider exporting the raw cached VPDI and VPD-R data
via sysfs and having user-space parse it.
> Another
> disadvantage of it being in userspace is for devices using SR-IOV. In
> those devices the vpd only
> exists for the physfn devices but not the virtual devices. A
> userspace program device will have to
> read the entire VPD for each physical and virtual PCI device.
What's the SR-IOV connection? Is there something in the SR-IOV spec
that says VFs can't have VPD?
> Logic is something like this:
> if (open("/sys/bus/pci/devices/X/physfn/vpd", O_RDONLY) < 0)
> if (open("/sys/bus/pci/devices/X/vpd", O_RDONLY) < 0)
> return;
> }
> parsevpd(fd);
>
> Specifically it is parsing one of the Vx attributes for a 'DCM' or
> 'DC2' string that contain a mapping from
> NIC ports and partitions to PCI device
>
> > Cheers,
> >
> > Hannes
> >
> > --
> > Dr. Hannes Reinecke Teamlead Storage & Networking
> > hare@suse.de +49 911 74053 688
> > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> > GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
> > HRB 21284 (AG Nürnberg)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-04-10 21:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 20:04 [PATCH] Create sysfs entries for PCI VPDI and VPDR tags Jordan Hargrave
2016-02-19 10:00 ` Hannes Reinecke
2016-02-19 14:07 ` Jordan Hargrave
2016-02-19 14:18 ` Hannes Reinecke
2016-02-19 19:44 ` Jordan_Hargrave
2016-04-10 21:26 ` Bjorn Helgaas [this message]
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=20160410212632.GA5852@localhost \
--to=helgaas@kernel.org \
--cc=Jordan_Hargrave@dell.com \
--cc=alexander.duyck@gmail.com \
--cc=babu.moger@oracle.com \
--cc=bhelgaas@google.com \
--cc=hare@suse.de \
--cc=jharg93@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.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 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).