Well, I tend to not backport new stuff to stable branches before I am sure they work fine on trunk :) We haven't even tested this on many Linux kernels and OFED hardware yet.
The risk is very low here. So if you need it, I can certainly backport it. Brice Le 27/03/2012 22:27, Jeffrey Squyres a écrit : > Brice -- > > Is there a reason to not bring this to v1.4? > > > On Mar 21, 2012, at 3:29 AM, bgog...@osl.iu.edu wrote: > >> Author: bgoglin >> Date: 2012-03-21 03:29:17 EDT (Wed, 21 Mar 2012) >> New Revision: 4417 >> URL: https://svn.open-mpi.org/trac/hwloc/changeset/4417 >> >> Log: >> Add Port info attribute to network OS devices inside OpenFabrics PCI >> devices so as to identify which interface corresponds to which port. >> >> Don't do it for all network OS devices because the dev_id sysfs >> attribute for OFED (dev_id = port-1) is not strictly equivalent >> to its generic meaning (shared nic id, 0 is most cases). >> >> >> Text files modified: >> trunk/NEWS | 2 ++ >> >> trunk/src/topology-libpci.c | 21 +++++++++++++++++++++ >> >> 2 files changed, 23 insertions(+), 0 deletions(-) >> >> Modified: trunk/NEWS >> ============================================================================== >> --- trunk/NEWS (original) >> +++ trunk/NEWS 2012-03-21 03:29:17 EDT (Wed, 21 Mar 2012) >> @@ -47,6 +47,8 @@ >> + Instruction caches are enabled in lstopo by default. User --no-icaches >> to disable them. >> * Misc >> + + Add Port info attribute to network OS devices inside OpenFabrics PCI >> + devices so as to identify which interface corresponds to which port. >> + Remove support for "Proc" type name, it was superseded by "PU" in v1.0. >> >> >> >> Modified: trunk/src/topology-libpci.c >> ============================================================================== >> --- trunk/src/topology-libpci.c (original) >> +++ trunk/src/topology-libpci.c 2012-03-21 03:29:17 EDT (Wed, 21 Mar >> 2012) >> @@ -25,6 +25,7 @@ >> #include <hwloc/linux.h> >> #include <dirent.h> >> #include <sys/types.h> >> +#include <sys/stat.h> >> #endif >> >> #define CONFIG_SPACE_CACHESIZE 256 >> @@ -123,6 +124,7 @@ >> hwloc_linux_net_class_fillinfos(struct hwloc_topology *topology >> __hwloc_attribute_unused, struct hwloc_obj *obj, const char *osdevpath) >> { >> FILE *fd; >> + struct stat st; >> char path[256]; >> snprintf(path, sizeof(path), "%s/address", osdevpath); >> fd = fopen(path, "r"); >> @@ -136,6 +138,25 @@ >> } >> fclose(fd); >> } >> + snprintf(path, sizeof(path), "%s/device/infiniband", osdevpath); >> + if (!stat(path, &st)) { >> + snprintf(path, sizeof(path), "%s/dev_id", osdevpath); >> + fd = fopen(path, "r"); >> + if (fd) { >> + char hexid[16]; >> + if (fgets(hexid, sizeof(hexid), fd)) { >> + char *eoid; >> + unsigned long port; >> + port = strtoul(hexid, &eoid, 0); >> + if (eoid != hexid) { >> + char portstr[16]; >> + snprintf(portstr, sizeof(portstr), "%ld", port+1); >> + hwloc_obj_add_info(obj, "Port", portstr); >> + } >> + } >> + fclose(fd); >> + } >> + } >> } >> static void >> hwloc_linux_lookup_net_class(struct hwloc_topology *topology, struct >> hwloc_obj *pcidev, const char *pcidevpath) >> _______________________________________________ >> hwloc-svn mailing list >> hwloc-...@open-mpi.org >> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-svn >