FWIW, here's the difference between a root and non-root run on a system with a
Cisco VIC:
Root XML contains additional PCI data:
<info name="DMIProductSerial" value="FCH1623V1W4"/>
<info name="DMIProductUUID" value="2BF24625-07B1-4990-B642-1F4C70056CC7"/>
<info name="DMIBoardSerial" value="FCH16207CF1"/>
<info name="DMIChassisSerial" value="FCH1623V1W4"/>
And the usNIC VFs have a link speed:
<object type="Bridge" os_index="17" name="Intel Corporation Xeon
E5/Core i7 IIO PCI Express Root Port 1b" bridge_type="1-1" depth="0"
bridge_pci="0000:[02-03]" pci_busid="0000:00:01.1" pci_type="0604 [8086:3c03]
[0000:0000] 07" pci_link_speed="2.000000">
(the non-root run has "0.0" for the link speed:
<object type="Bridge" os_index="17" name="Intel Corporation Xeon
E5/Core i7 IIO PCI Express Root Port 1b" bridge_type="1-1" depth="0"
bridge_pci="0000:[02-03]" pci_busid="0000:00:01.1" pci_type="0604 [8086:3c03]
[0000:0000] 07" pci_link_speed="0.000000">
> On Jan 10, 2015, at 5:42 AM, [email protected] wrote:
>
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "open-mpi/hwloc".
>
> The branch, master has been updated
> via 85ea6e4acc456d398fa995d671960ccc0dff0d42 (commit)
> from d7cf79327ae6b87ac451b95be88380d0266bbc4a (commit)
>
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
>
> - Log -----------------------------------------------------------------
> https://github.com/open-mpi/hwloc/commit/85ea6e4acc456d398fa995d671960ccc0dff0d42
>
> commit 85ea6e4acc456d398fa995d671960ccc0dff0d42
> Author: Brice Goglin <[email protected]>
> Date: Sat Jan 10 10:56:25 2015 +0100
>
> pci: fix SR-IOV VF vendor/device names
>
> Commit 626129d2818693e62b83c1cfa2ba6e058e5bed66 fixed the hwloc
> device/vendor numbers obtained from libpciaccess.
> But the corresponding names are still retrieved from pciaccess numbers,
> so fix these numbers inside pciaccess structures before retrieving the
> names.
>
> diff --git a/hwloc/topology-pci.c b/hwloc/topology-pci.c
> index c069d86..3a3ad6b 100644
> --- a/hwloc/topology-pci.c
> +++ b/hwloc/topology-pci.c
> @@ -135,22 +135,7 @@ hwloc_look_pci(struct hwloc_backend *backend)
> /* try to read the device_class */
> device_class = pcidev->device_class >> 8;
>
> - /* might be useful for debugging (note that domain might be truncated) */
> - os_index = (domain << 20) + (pcidev->bus << 12) + (pcidev->dev << 4) +
> pcidev->func;
> -
> - obj = hwloc_alloc_setup_object(HWLOC_OBJ_PCI_DEVICE, os_index);
> - obj->attr->pcidev.domain = domain;
> - obj->attr->pcidev.bus = pcidev->bus;
> - obj->attr->pcidev.dev = pcidev->dev;
> - obj->attr->pcidev.func = pcidev->func;
> - obj->attr->pcidev.vendor_id = pcidev->vendor_id;
> - obj->attr->pcidev.device_id = pcidev->device_id;
> - obj->attr->pcidev.class_id = device_class;
> - obj->attr->pcidev.revision = config_space_cache[PCI_REVISION_ID];
> -
> - obj->attr->pcidev.linkspeed = 0; /* unknown */
> - offset = hwloc_pci_find_cap(config_space_cache, PCI_CAP_ID_EXP);
> -
> + /* fixup SR-IOV buggy VF device/vendor IDs */
> if (0xffff == pcidev->vendor_id && 0xffff == pcidev->device_id) {
> /* SR-IOV puts ffff:ffff in Virtual Function config space.
> * The actual VF device ID is stored at a special (dynamic) location in
> the Physical Function config space.
> @@ -158,7 +143,7 @@ hwloc_look_pci(struct hwloc_backend *backend)
> *
> * libpciaccess just returns ffff:ffff, needs to be fixed.
> * linuxpci is OK because sysfs files are already fixed the kernel.
> - * pciutils is OK when it uses those Linux sysfs files.
> + * (pciutils is OK when it uses those Linux sysfs files.)
> *
> * Reading these files is an easy way to work around the libpciaccess
> issue on Linux,
> * but we have no way to know if this is caused by SR-IOV or not.
> @@ -185,7 +170,8 @@ hwloc_look_pci(struct hwloc_backend *backend)
> read = fread(value, 1, sizeof(value), file);
> fclose(file);
> if (read)
> - obj->attr->pcidev.vendor_id = strtoul(value, NULL, 16);
> + /* fixup the pciaccess struct so that pci_device_get_vendor_name() is
> correct later. */
> + pcidev->vendor_id = strtoul(value, NULL, 16);
> }
>
> snprintf(path, sizeof(path),
> "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/device",
> @@ -195,11 +181,28 @@ hwloc_look_pci(struct hwloc_backend *backend)
> read = fread(value, 1, sizeof(value), file);
> fclose(file);
> if (read)
> - obj->attr->pcidev.device_id = strtoul(value, NULL, 16);
> + /* fixup the pciaccess struct so that pci_device_get_device_name() is
> correct later. */
> + pcidev->device_id = strtoul(value, NULL, 16);
> }
> #endif
> }
>
> + /* might be useful for debugging (note that domain might be truncated) */
> + os_index = (domain << 20) + (pcidev->bus << 12) + (pcidev->dev << 4) +
> pcidev->func;
> +
> + obj = hwloc_alloc_setup_object(HWLOC_OBJ_PCI_DEVICE, os_index);
> + obj->attr->pcidev.domain = domain;
> + obj->attr->pcidev.bus = pcidev->bus;
> + obj->attr->pcidev.dev = pcidev->dev;
> + obj->attr->pcidev.func = pcidev->func;
> + obj->attr->pcidev.vendor_id = pcidev->vendor_id;
> + obj->attr->pcidev.device_id = pcidev->device_id;
> + obj->attr->pcidev.class_id = device_class;
> + obj->attr->pcidev.revision = config_space_cache[PCI_REVISION_ID];
> +
> + obj->attr->pcidev.linkspeed = 0; /* unknown */
> + offset = hwloc_pci_find_cap(config_space_cache, PCI_CAP_ID_EXP);
> +
> if (offset > 0 && offset + 20 /* size of PCI express block up to link
> status */ <= CONFIG_SPACE_CACHESIZE)
> hwloc_pci_find_linkspeed(config_space_cache, offset,
> &obj->attr->pcidev.linkspeed);
>
>
>
> -----------------------------------------------------------------------
>
> Summary of changes:
> hwloc/topology-pci.c | 41 ++++++++++++++++++++++-------------------
> 1 file changed, 22 insertions(+), 19 deletions(-)
>
>
> hooks/post-receive
> --
> open-mpi/hwloc
> _______________________________________________
> hwloc-commits mailing list
> [email protected]
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-commits
--
Jeff Squyres
[email protected]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/