Hello community,

here is the log from the commit of package libpsm2 for openSUSE:Factory checked 
in at 2018-03-16 10:33:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libpsm2 (Old)
 and      /work/SRC/openSUSE:Factory/.libpsm2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libpsm2"

Fri Mar 16 10:33:50 2018 rev:9 rq:587414 version:10.3.46

Changes:
--------
--- /work/SRC/openSUSE:Factory/libpsm2/libpsm2.changes  2017-12-09 
20:25:50.622248217 +0100
+++ /work/SRC/openSUSE:Factory/.libpsm2.new/libpsm2.changes     2018-03-16 
10:33:50.673007017 +0100
@@ -1,0 +2,12 @@
+Thu Mar 15 07:18:37 UTC 2018 - [email protected]
+
+- Update to version 10.3.46
+  - Enabled IPS_PROTO_FLAG_RCVTHREAD flag
+  - Fix GPU Direct Recv threshold default
+  - Resolve PSM2_CUDA runtime issues
+  - Fix bug in code to remove octal base for env vars
+  - Change direct use of HFI_CLASS_PATH and guard possible buffer overruns
+- Add libpsm2-fix-gcc8-compilation-error.patch to fix compilation
+  with gcc8 (bsc#1084634)
+
+-------------------------------------------------------------------

Old:
----
  libpsm2-10.3.37.tar.bz2

New:
----
  libpsm2-10.3.46.tar.bz2
  libpsm2-fix-gcc8-compilation-error.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libpsm2.spec ++++++
--- /var/tmp/diff_new_pack.d3yAbJ/_old  2018-03-16 10:33:51.840964963 +0100
+++ /var/tmp/diff_new_pack.d3yAbJ/_new  2018-03-16 10:33:51.848964675 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libpsm2
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 
 %define psm_so 2
 Name:           libpsm2
-Version:        10.3.37
+Version:        10.3.46
 Release:        0
 Summary:        Intel PSM Messaging API libraries
 License:        BSD-2-Clause or GPL-2.0
@@ -32,6 +32,7 @@
 Patch2:         libpsm2-use_RPM_OPT_FLAGS.patch
 Patch3:         libpsm2-use-exported-variable-for-version-and-release.patch
 Patch4:         libpsm2-include-ioctl_h.patch
+Patch5:         libpsm2-fix-gcc8-compilation-error.patch
 BuildRequires:  libnuma-devel
 BuildRequires:  libuuid-devel
 BuildRequires:  pkg-config
@@ -86,6 +87,7 @@
 %patch2
 %patch3
 %patch4
+%patch5
 
 cp %{S:1} ChangeLog
 

++++++ _service ++++++
--- /var/tmp/diff_new_pack.d3yAbJ/_old  2018-03-16 10:33:51.912962371 +0100
+++ /var/tmp/diff_new_pack.d3yAbJ/_new  2018-03-16 10:33:51.920962083 +0100
@@ -5,11 +5,11 @@
     <param name="package-meta">no</param>
     <param name="exclude">.git</param>
     <param name="filename">libpsm2</param>
-    <param name="version">10.3.37</param>
+    <param name="version">10.3.46</param>
     <param name="versionrewrite-pattern">PSM2_(.*)</param>
     <param name="versionrewrite-replacement">\1</param>
     <param name="match-tag">PSM2_*</param>
-    <param name="revision">01d12825369bfc8d9d20729b2df828921e77c516</param>
+    <param name="revision">5fabd0e699a920e74333f789923fd1c02bb7c629</param>
   </service>
   <service name="recompress" mode="disabled">
     <param name="file">libpsm2*.tar</param>

++++++ libpsm2-10.3.37.tar.bz2 -> libpsm2-10.3.46.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/COMMIT new/libpsm2-10.3.46/COMMIT
--- old/libpsm2-10.3.37/COMMIT  2017-12-06 23:24:50.000000000 +0100
+++ new/libpsm2-10.3.46/COMMIT  2018-02-26 22:57:32.000000000 +0100
@@ -1 +1 @@
-295d2ac9ced1415c309531cbb478eab943e174e8
\ No newline at end of file
+8b6ba42b45df1815a1da540ebb088b10cc8d88ea
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/include/opa_service.h 
new/libpsm2-10.3.46/include/opa_service.h
--- old/libpsm2-10.3.37/include/opa_service.h   2017-12-06 23:24:50.000000000 
+0100
+++ new/libpsm2-10.3.46/include/opa_service.h   2018-02-26 22:57:32.000000000 
+0100
@@ -194,7 +194,9 @@
 int hfi_cmd_write(int fd, struct hfi1_cmd *, size_t count);
 int hfi_cmd_writev(int fd, const struct iovec *iov, int iovcnt);
 
-int hfi_get_cc_settings_bin(int unit, int port, char *ccabuf);
+/* hfi_get_cc_settings_bin() returns less than or equal to 0 on failure,
+   returns greater than 0 on success. */
+ int hfi_get_cc_settings_bin(int unit, int port, char *ccabuf, size_t 
len_ccabuf);
 int hfi_get_cc_table_bin(int unit, int port, uint16_t **cctp);
 
 /* We use mmap64() because we compile in both 32 and 64 bit mode,
@@ -221,12 +223,7 @@
 /* sysfs helper routines (only those currently used are exported;
  * try to avoid using others) */
 
-/* Calls stat() for the given attribute, return value is unchanged
-   from stat() sbuf is populated from stat() too. */
-int hfi_sysfs_stat(const char *attr,struct stat *sbuf);
-
-/* read a signed 64-bit quantity, in some arbitrary base */
-int hfi_sysfs_read_s64(const char *attr, int64_t *valp, int base);
+const char *hfi_sysfs_path(void);
 
 /* read a string value */
 int hfi_sysfs_port_read(uint32_t unit, uint32_t port, const char *attr,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/opa/opa_service.c 
new/libpsm2-10.3.46/opa/opa_service.c
--- old/libpsm2-10.3.37/opa/opa_service.c       2017-12-06 23:24:50.000000000 
+0100
+++ new/libpsm2-10.3.46/opa/opa_service.c       2018-02-26 22:57:32.000000000 
+0100
@@ -809,26 +809,32 @@
                return i / sizeof(*c);
 }
 
-int hfi_get_cc_settings_bin(int unit, int port, char *ccabuf)
+int hfi_get_cc_settings_bin(int unit, int port, char *ccabuf, size_t 
len_ccabuf)
 {
        int fd;
-       size_t count;
+
+       /*
+        * 4 bytes for 'control map'
+        * 2 bytes 'port control'
+        * 32 (#SLs) * 6 bytes 'congestion setting' (per-SL)
+        */
+       const size_t count = 4 + 2 + (32 * 6);
+
+       if (count > len_ccabuf)
+               return -2;
 /*
  * Check qib driver CCA setting, and try to use it if available.
  * Fall to self CCA setting if errors.
  */
-       sprintf(ccabuf, HFI_CLASS_PATH "_%d/ports/%d/CCMgtA/cc_settings_bin",
-               unit, port);
+       if (snprintf(ccabuf, len_ccabuf, "%s%d/ports/%d/CCMgtA/cc_settings_bin",
+                    hfi_sysfs_path(), unit, port) >= (len_ccabuf-1))
+               return -1;
+
        fd = open(ccabuf, O_RDONLY);
        if (fd < 0) {
                return 0;
        }
-       /*
-        * 4 bytes for 'control map'
-        * 2 bytes 'port control'
-        * 32 (#SLs) * 6 bytes 'congestion setting' (per-SL)
-        */
-       count = 4 + 2 + (32 * 6);
+
        if (read(fd, ccabuf, count) != count) {
                _HFI_CCADBG("Read cc_settings_bin failed. using static CCA\n");
                close(fd);
@@ -847,10 +853,11 @@
        uint16_t *cct;
        int fd;
        char pathname[256];
-
        *cctp = NULL;
-       sprintf(pathname, HFI_CLASS_PATH "_%d/ports/%d/CCMgtA/cc_table_bin",
-               unit, port);
+
+       if (snprintf(pathname,sizeof(pathname), 
"%s%d/ports/%d/CCMgtA/cc_table_bin",
+                    hfi_sysfs_path(), unit, port) >= (sizeof(pathname)-1))
+               return -1;
        fd = open(pathname, O_RDONLY);
        if (fd < 0) {
                _HFI_CCADBG("Open cc_table_bin failed. using static CCA\n");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/opa/opa_sysfs.c 
new/libpsm2-10.3.46/opa/opa_sysfs.c
--- old/libpsm2-10.3.37/opa/opa_sysfs.c 2017-12-06 23:24:50.000000000 +0100
+++ new/libpsm2-10.3.46/opa/opa_sysfs.c 2018-02-26 22:57:32.000000000 +0100
@@ -78,18 +78,52 @@
 
 static void __attribute__ ((constructor)) sysfs_init(void)
 {
-       struct stat s;
        if (sysfs_path == NULL)
-               sysfs_path = getenv("HFI_SYSFS_PATH");
-       if (sysfs_path == NULL) {
-               static char syspath[64];
-               snprintf(syspath, sizeof(syspath), "%s_%d", HFI_CLASS_PATH, 0);
-               sysfs_path = syspath;
-       }
-       if (stat(sysfs_path, &s) || !S_ISDIR(s.st_mode))
-               _HFI_DBG("Did not find sysfs directory %s, using anyway\n",
-                        sysfs_path);
-       sysfs_path_len = strlen(sysfs_path);
+       {
+               if (NULL != (sysfs_path = getenv("HFI_SYSFS_PATH")))
+               {
+                       char *syspath = strdup(sysfs_path);
+
+                       if (!syspath)
+                               _HFI_DBG("Failed to strdup(\"%s\") for 
syspath.\n",
+                                        sysfs_path);
+                       else
+                               sysfs_path = syspath;
+               }
+               if (sysfs_path == NULL) {
+                       unsigned len = sizeof(HFI_CLASS_PATH) + 4;
+                       char *syspath = malloc(len);
+
+                       if (!syspath)
+                               _HFI_DBG("Failed to alloc %u bytes for 
syspath.\n",len);
+                       else
+                       {
+                               snprintf(syspath, len, "%s_0", HFI_CLASS_PATH);
+                               sysfs_path = syspath;
+                       }
+               }
+
+               if (sysfs_path != NULL) {
+                       struct stat s;
+
+                       if (stat(sysfs_path, &s) || !S_ISDIR(s.st_mode))
+                       {
+                               _HFI_DBG("Did not find sysfs directory %s, 
using anyway\n",
+                                        sysfs_path);
+                       }
+                       else
+                       {
+                               /* Remove the unit number from the sysfs path: 
*/
+                               char *lastUS = strrchr(sysfs_path, '_');
+
+                               if ((NULL != lastUS) && (isdigit(lastUS[1])))
+                                       lastUS[1] = 0;
+                       }
+               }
+       }
+
+       if (sysfs_path != NULL)
+               sysfs_path_len = strlen(sysfs_path);
 
        if (hfifs_path == NULL)
                hfifs_path = getenv("HFI_HFIFS_PATH");
@@ -115,36 +149,6 @@
        return hfifs_path;
 }
 
-/* Calls stat() for the given attribute, return value is unchanged
-   from stat() sbuf is populated from stat() too. */
-int hfi_sysfs_stat(const char *attr,struct stat *sbuf)
-{
-       char buf[1024];
-
-       snprintf(buf, sizeof(buf), "%s/%s", hfi_sysfs_path(), attr);
-       return stat(buf,sbuf);
-}
-
-int hfi_sysfs_open(const char *attr, int flags)
-{
-       char buf[1024];
-       int saved_errno;
-       int fd;
-
-       snprintf(buf, sizeof(buf), "%s/%s", hfi_sysfs_path(), attr);
-       fd = open(buf, flags);
-       saved_errno = errno;
-
-       if (fd == -1) {
-               _HFI_DBG("Failed to open driver attribute '%s': %s\n", attr,
-                        strerror(errno));
-               _HFI_DBG("Offending file name: %s\n", buf);
-       }
-
-       errno = saved_errno;
-       return fd;
-}
-
 int hfi_hfifs_open(const char *attr, int flags)
 {
        char buf[1024];
@@ -196,54 +200,13 @@
        return ret;
 }
 
-int hfi_sysfs_printf(const char *attr, const char *fmt, ...)
-{
-       int fd = -1;
-       va_list ap;
-       int ret = -1;
-       int saved_errno;
-
-       fd = hfi_sysfs_open(attr, O_WRONLY);
-       saved_errno = errno;
-
-       if (fd == -1) {
-               goto bail;
-       }
-
-       va_start(ap, fmt);
-       ret = sysfs_vprintf(fd, fmt, ap);
-       saved_errno = errno;
-       va_end(ap);
-
-       if (ret == -1) {
-               _HFI_DBG("Failed to write to driver attribute '%s': %s\n", attr,
-                        strerror(errno));
-       }
-
-bail:
-       if (fd != -1)
-               close(fd);
-
-       errno = saved_errno;
-       return ret;
-}
-
 int hfi_sysfs_unit_open(uint32_t unit, const char *attr, int flags)
 {
        int saved_errno;
        char buf[1024];
        int fd;
-       int len, l;
 
-       snprintf(buf, sizeof(buf), "%s", hfi_sysfs_path());
-       len = l = strlen(buf) - 1;
-       while (l > 0 && isdigit(buf[l]))
-               l--;
-       if (l)
-               buf[++l] = 0;
-       else
-               l = len;        /* assume they know what they are doing */
-       snprintf(buf + l, sizeof(buf) - l, "%u/%s", unit, attr);
+       snprintf(buf, sizeof(buf), "%s%u/%s", hfi_sysfs_path(), unit, attr);
        fd = open(buf, flags);
        saved_errno = errno;
 
@@ -262,11 +225,9 @@
        int saved_errno;
        char buf[1024];
        int fd;
-       char *path_copy = strdup(hfi_sysfs_path());
 
-       snprintf(buf, sizeof(buf), "%s/hfi1_%u/device/numa_node",
-                dirname(path_copy), unit);
-       free(path_copy);
+       snprintf(buf, sizeof(buf), "%s%u/device/numa_node",
+                hfi_sysfs_path(), unit);
        fd = open(buf, flags);
        saved_errno = errno;
 
@@ -286,17 +247,9 @@
        int saved_errno;
        char buf[1024];
        int fd;
-       int len, l;
 
-       snprintf(buf, sizeof(buf), "%s", hfi_sysfs_path());
-       len = l = strlen(buf) - 1;
-       while (l > 0 && isdigit(buf[l]))
-               l--;
-       if (l)
-               buf[++l] = 0;
-       else
-               l = len;        /* assume they know what they are doing */
-       snprintf(buf + l, sizeof(buf) - l, "%u/ports/%u/%s", unit, port, attr);
+       snprintf(buf, sizeof(buf), "%s%u/ports/%u/%s", hfi_sysfs_path(),
+                unit, port, attr);
        fd = open(buf, flags);
        saved_errno = errno;
 
@@ -431,35 +384,6 @@
 /*
  * On return, caller must free *datap.
  */
-int hfi_sysfs_read(const char *attr, char **datap)
-{
-       int fd = -1, ret = -1;
-       int saved_errno;
-
-       fd = hfi_sysfs_open(attr, O_RDONLY);
-       saved_errno = errno;
-
-       if (fd == -1)
-               goto bail;
-
-       ret = read_page(fd, datap);
-       saved_errno = errno;
-
-bail:
-       if (ret == -1)
-               *datap = NULL;
-
-       if (fd != -1) {
-               close(fd);
-       }
-
-       errno = saved_errno;
-       return ret;
-}
-
-/*
- * On return, caller must free *datap.
- */
 int hfi_sysfs_unit_read(uint32_t unit, const char *attr, char **datap)
 {
        int fd = -1, ret = -1;
@@ -708,37 +632,6 @@
        errno = saved_errno;
        return ret;
 }
-
-int hfi_sysfs_read_s64(const char *attr, int64_t *valp, int base)
-{
-       char *data, *end;
-       int ret;
-       int saved_errno;
-       long long val;
-
-       ret = hfi_sysfs_read(attr, &data);
-       saved_errno = errno;
-
-       if (ret == -1) {
-               goto bail;
-       }
-
-       val = strtoll(data, &end, base);
-       saved_errno = errno;
-
-       if (!*data || !(*end == '\0' || isspace(*end))) {
-               ret = -1;
-               goto bail;
-       }
-
-       *valp = val;
-       ret = 0;
-
-bail:
-       free(data);
-       errno = saved_errno;
-       return ret;
-}
 
 int hfi_sysfs_unit_read_s64(uint32_t unit, const char *attr,
                            int64_t *valp, int base)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/psm.c new/libpsm2-10.3.46/psm.c
--- old/libpsm2-10.3.37/psm.c   2017-12-06 23:24:50.000000000 +0100
+++ new/libpsm2-10.3.46/psm.c   2018-02-26 22:57:32.000000000 +0100
@@ -125,7 +125,6 @@
 {
        psm2_error_t err = PSM2_OK;
        int num_devices, dev;
-       struct cudaDeviceProp dev_prop;
        char *dlerr;
 
        PSM2_LOG_MSG("entering");
@@ -158,9 +157,10 @@
        PSMI_CUDA_DLSYM(psmi_cuda_lib, cuCtxSetCurrent);
        PSMI_CUDA_DLSYM(psmi_cuda_lib, cuPointerGetAttribute);
        PSMI_CUDA_DLSYM(psmi_cuda_lib, cuPointerSetAttribute);
+       PSMI_CUDA_DLSYM(psmi_cuda_lib, cuDeviceGetAttribute);
+       PSMI_CUDA_DLSYM(psmi_cuda_lib, cuDeviceGet);
 
        PSMI_CUDA_DLSYM(psmi_cudart_lib, cudaGetDeviceCount);
-       PSMI_CUDA_DLSYM(psmi_cudart_lib, cudaGetDeviceProperties);
        PSMI_CUDA_DLSYM(psmi_cudart_lib, cudaGetDevice);
        PSMI_CUDA_DLSYM(psmi_cudart_lib, cudaSetDevice);
        PSMI_CUDA_DLSYM(psmi_cudart_lib, cudaStreamCreate);
@@ -186,20 +186,31 @@
        /* Check if all devices support Unified Virtual Addressing. */
        PSMI_CUDA_CALL(cudaGetDeviceCount, &num_devices);
        for (dev = 0; dev < num_devices; dev++) {
-               PSMI_CUDA_CALL(cudaGetDeviceProperties, &dev_prop, dev);
-               if (dev_prop.unifiedAddressing != 1) {
-                       _HFI_ERROR("CUDA device %d does not support Unified 
Virtual Addressing.\n", dev);
-                       goto fail;
-               }
-               /* Only devices based on Kepler and
-                * above can support GPU Direct.
-                */
-               if (dev_prop.major >= 3 && cuda_runtime_version >= 5000)
-                       device_support_gpudirect = 1;
-               else {
-                       device_support_gpudirect = 0;
-                       _HFI_INFO("Device %d does not GPUDirect RDMA (Non-fatal 
error) \n", dev);
-               }
+               CUdevice device;
+               PSMI_CUDA_DRIVER_API_CALL(cuDeviceGet, &device, dev);
+               int unifiedAddressing;
+               PSMI_CUDA_DRIVER_API_CALL(cuDeviceGetAttribute,
+                                       &unifiedAddressing,
+                                       CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING,
+                                       device);
+
+               if (unifiedAddressing !=1){
+                       _HFI_ERROR("CUDA device %d does not support Unified 
Virtual Addressing.\n", dev);
+                       goto fail;
+               }
+
+               int major;
+               PSMI_CUDA_DRIVER_API_CALL(cuDeviceGetAttribute,
+                                       &major,
+                                       
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR,
+                                       device);
+               if (major >= 3 && cuda_runtime_version >= 5000)
+                       device_support_gpudirect = 1;
+               else {
+                       device_support_gpudirect = 0;
+                       _HFI_INFO("Device %d does not support GPUDirect RDMA 
(Non-fatal error) \n", dev);
+               }
+
        }
        PSM2_LOG_MSG("leaving");
        return err;
@@ -362,7 +373,7 @@
        if (getenv("PSM2_IDENTIFY")) {
                 Dl_info info_psm;
                char ofed_delta[100] = "";
-               strcat(strcat(ofed_delta," built for OFED DELTA 
"),psmi_hfi_IFS_version);
+               strcat(strcat(ofed_delta," built for OFA DELTA 
"),psmi_hfi_IFS_version);
                 printf("%s %s PSM2 v%d.%d%s\n"
                       "%s %s location %s\n"
                       "%s %s build date %s\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/psm_user.h 
new/libpsm2-10.3.46/psm_user.h
--- old/libpsm2-10.3.37/psm_user.h      2017-12-06 23:24:50.000000000 +0100
+++ new/libpsm2-10.3.46/psm_user.h      2018-02-26 22:57:32.000000000 +0100
@@ -347,9 +347,10 @@
 CUresult (*psmi_cuCtxSetCurrent)(CUcontext c);
 CUresult (*psmi_cuPointerGetAttribute)(void *data, CUpointer_attribute pa, 
CUdeviceptr p);
 CUresult (*psmi_cuPointerSetAttribute)(void *data, CUpointer_attribute pa, 
CUdeviceptr p);
+CUresult (*psmi_cuDeviceGet)(CUdevice* device, int  ordinal);
+CUresult (*psmi_cuDeviceGetAttribute)(int* pi, CUdevice_attribute attrib, 
CUdevice dev);
 cudaError_t (*psmi_cudaRuntimeGetVersion)(int *runtime_version);
 cudaError_t (*psmi_cudaGetDeviceCount)(int *n);
-cudaError_t (*psmi_cudaGetDeviceProperties)(struct cudaDeviceProp *p, int d);
 cudaError_t (*psmi_cudaGetDevice)(int *n);
 cudaError_t (*psmi_cudaSetDevice)(int n);
 cudaError_t (*psmi_cudaStreamCreate)(cudaStream_t *s);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/psm_utils.c 
new/libpsm2-10.3.46/psm_utils.c
--- old/libpsm2-10.3.37/psm_utils.c     2017-12-06 23:24:50.000000000 +0100
+++ new/libpsm2-10.3.46/psm_utils.c     2018-02-26 22:57:32.000000000 +0100
@@ -442,6 +442,23 @@
                                ishex ? " 0x" : " ", defval);           \
        } while (0)
 
+/* _CONSUMED_ALL() is a macro which indicates if strtol() consumed all
+   of the input passed to it. */
+#define _CONSUMED_ALL(CHAR_PTR) (((CHAR_PTR) != NULL) && (*(CHAR_PTR) == 0))
+#define _CONVERT_TO_NUM(DEST,TYPE,STRTOL)                                      
        \
+       do {                                                                    
        \
+               char *ep;                                                       
        \
+               /* Avoid base 8 (octal) on purpose, so don't pass in 0 for 
radix */     \
+               DEST = (TYPE)STRTOL(env, &ep, 10);                              
        \
+               if (! _CONSUMED_ALL(ep)) {                                      
        \
+                       DEST = (TYPE)STRTOL(env, &ep, 16);                      
        \
+                       if (! _CONSUMED_ALL(ep)) {                              
        \
+                               used_default = 1;                               
        \
+                               tval = defval;                                  
        \
+                       }                                                       
        \
+               }                                                               
        \
+       } while (0)
+
        switch (type) {
        case PSMI_ENVVAR_TYPE_YESNO:
                if (!env || *env == '\0') {
@@ -478,16 +495,7 @@
                        tval = defval;
                        used_default = 1;
                } else {
-                       char *ep;
-                       /* Avoid base 8 (octal) on purpose, so don't pass in 0 
for radix */
-                       tval.e_int = (int)strtol(env, &ep, 10);
-                       if (ep == env) {
-                               tval.e_int = (int)strtol(env, &ep, 16);
-                               if (ep == env) {
-                                       used_default = 1;
-                                       tval = defval;
-                               }
-                       }
+                       _CONVERT_TO_NUM(tval.e_int,int,strtol);
                }
                _GETENV_PRINT(used_default, "%d", tval.e_int, defval.e_int);
                break;
@@ -498,16 +506,7 @@
                        tval = defval;
                        used_default = 1;
                } else {
-                       char *ep;
-                       /* Avoid base 8 (octal) on purpose, so don't pass in 0 
for radix */
-                       tval.e_int = (unsigned int)strtoul(env, &ep, 10);
-                       if (ep == env) {
-                               tval.e_int = (unsigned int)strtoul(env, &ep, 
16);
-                               if (ep == env) {
-                                       used_default = 1;
-                                       tval = defval;
-                               }
-                       }
+                       _CONVERT_TO_NUM(tval.e_int,unsigned int,strtoul);
                }
                if (type == PSMI_ENVVAR_TYPE_UINT_FLAGS)
                        _GETENV_PRINT(used_default, "%x", tval.e_uint,
@@ -522,16 +521,7 @@
                        tval = defval;
                        used_default = 1;
                } else {
-                       char *ep;
-                       /* Avoid base 8 (octal) on purpose, so don't pass in 0 
for radix */
-                       tval.e_long = strtol(env, &ep, 10);
-                       if (ep == env) {
-                               tval.e_long = strtol(env, &ep, 16);
-                               if (ep == env) {
-                                       used_default = 1;
-                                       tval = defval;
-                               }
-                       }
+                       _CONVERT_TO_NUM(tval.e_long,long,strtol);
                }
                _GETENV_PRINT(used_default, "%ld", tval.e_long, defval.e_long);
                break;
@@ -540,18 +530,7 @@
                        tval = defval;
                        used_default = 1;
                } else {
-                       char *ep;
-                       /* Avoid base 8 (octal) on purpose, so don't pass in 0 
for radix */
-                       tval.e_ulonglong =
-                           (unsigned long long)strtoull(env, &ep, 10);
-                       if (ep == env) {
-                               tval.e_ulonglong =
-                                   (unsigned long long)strtoull(env, &ep, 16);
-                               if (ep == env) {
-                                       used_default = 1;
-                                       tval = defval;
-                               }
-                       }
+                       _CONVERT_TO_NUM(tval.e_ulonglong,unsigned long 
long,strtoull);
                }
                _GETENV_PRINT(used_default, "%llu",
                              tval.e_ulonglong, defval.e_ulonglong);
@@ -563,16 +542,7 @@
                        tval = defval;
                        used_default = 1;
                } else {
-                       char *ep;
-                       /* Avoid base 8 (octal) on purpose, so don't pass in 0 
for radix */
-                       tval.e_ulong = (unsigned long)strtoul(env, &ep, 10);
-                       if (ep == env) {
-                               tval.e_ulong = (unsigned long)strtoul(env, &ep, 
16);
-                               if (ep == env) {
-                                       used_default = 1;
-                                       tval = defval;
-                               }
-                       }
+                       _CONVERT_TO_NUM(tval.e_ulong,unsigned long,strtoul);
                }
                if (type == PSMI_ENVVAR_TYPE_ULONG_FLAGS)
                        _GETENV_PRINT(used_default, "%lx", tval.e_ulong,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/ptl_ips/ips_path_rec.c 
new/libpsm2-10.3.46/ptl_ips/ips_path_rec.c
--- old/libpsm2-10.3.37/ptl_ips/ips_path_rec.c  2017-12-06 23:24:50.000000000 
+0100
+++ new/libpsm2-10.3.46/ptl_ips/ips_path_rec.c  2018-02-26 22:57:32.000000000 
+0100
@@ -692,7 +692,7 @@
  */
                i = hfi_get_cc_settings_bin(proto->ep->context.ctrl->__hfi_unit,
                                            proto->ep->context.ctrl->__hfi_port,
-                                           ccabuf);
+                                           ccabuf, sizeof(ccabuf));
                if (i <= 0) {
                        goto disablecca;
                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/ptl_ips/ips_proto.c 
new/libpsm2-10.3.46/ptl_ips/ips_proto.c
--- old/libpsm2-10.3.37/ptl_ips/ips_proto.c     2017-12-06 23:24:50.000000000 
+0100
+++ new/libpsm2-10.3.46/ptl_ips/ips_proto.c     2018-02-26 22:57:32.000000000 
+0100
@@ -456,6 +456,12 @@
        if ((err = ips_proto_recv_init(proto)))
                goto fail;
 
+       /* If progress thread is enabled, set the proto flag */
+       {
+               if(context->runtime_flags & PSMI_RUNTIME_RCVTHREAD)
+                       proto->flags |= IPS_PROTO_FLAG_RCVTHREAD;
+       }
+
        /*
         * Eager buffers.  We don't care to receive a callback when eager 
buffers
         * are newly released since we actively poll for new bufs.
@@ -618,16 +624,16 @@
        /* Default Send threshold for Gpu-direct set to 30000 */
        union psmi_envvar_val env_gpudirect_send_thresh;
        psmi_getenv("PSM2_GPUDIRECT_SEND_THRESH",
-                   "Threshold to switch off Gpu-Direct feature on send side",
+                   "GPUDirect feature on send side will be switched off if 
threshold value is exceeded.",
                    PSMI_ENVVAR_LEVEL_USER, PSMI_ENVVAR_TYPE_UINT,
                    (union psmi_envvar_val)30000, &env_gpudirect_send_thresh);
        gpudirect_send_threshold = env_gpudirect_send_thresh.e_uint;
 
        union psmi_envvar_val env_gpudirect_recv_thresh;
        psmi_getenv("PSM2_GPUDIRECT_RECV_THRESH",
-                   "Threshold to switch off Gpu-Direct feature on receive 
side",
+                   "GPUDirect feature on receive side will be switched off if 
threshold value is exceeded.",
                    PSMI_ENVVAR_LEVEL_USER, PSMI_ENVVAR_TYPE_UINT,
-                   (union psmi_envvar_val)0, &env_gpudirect_recv_thresh);
+                   (union psmi_envvar_val)UINT_MAX, 
&env_gpudirect_recv_thresh);
        gpudirect_recv_threshold = env_gpudirect_recv_thresh.e_uint;
 
        if (env_gpudirect_rdma.e_uint && device_support_gpudirect) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libpsm2-10.3.37/rpm_release_extension 
new/libpsm2-10.3.46/rpm_release_extension
--- old/libpsm2-10.3.37/rpm_release_extension   2017-12-06 23:24:50.000000000 
+0100
+++ new/libpsm2-10.3.46/rpm_release_extension   2018-02-26 22:57:32.000000000 
+0100
@@ -1 +1 @@
-37
+46

++++++ libpsm2-fix-gcc8-compilation-error.patch ++++++
commit e8380f93eddfe5c79f58c7315c9d027fe39230ce
Author: Nicolas Morey-Chaisemartin <[email protected]>
Date:   Thu Mar 15 08:13:38 2018 +0100

    libpsm2: fix gcc8 compilation error
    
    Compiling with gcc 8.0.1 fails with:
    /home/abuild/rpmbuild/BUILD/libpsm2-10.3.37/psm_utils.c: In function 
'psmi_faultinj_getspec':
    /home/abuild/rpmbuild/BUILD/libpsm2-10.3.37/psm_utils.c:985:59: error: '%s' 
directive output may be truncated writing up to 127 bytes into a region of size 
between 110 and 237 [-Werror=format-truncation=]
       snprintf(fdesc, sizeof(fdesc) - 1, "Fault Injection %s <%s>",
                                                               ^~
         fname, fvals_str);
                ~~~~~~~~~
    In file included from /usr/include/stdio.h:862,
                     from /usr/include/malloc.h:24,
                     from 
/home/abuild/rpmbuild/BUILD/libpsm2-10.3.37/psm_utils.c:55:
    /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output 
between 20 and 274 bytes into a destination of size 255
       return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            __bos (__s), __fmt, __va_arg_pack ());
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[1]: *** [Makefile:522: 
/home/abuild/rpmbuild/BUILD/libpsm2-10.3.37/build_release/psm_utils.o] Error 1
    
    This increases the target buffer size to remove the error
    
    Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]>

diff --git psm_utils.c psm_utils.c
index e5d4fbc2c498..b3371641304e 100644
--- psm_utils.c
+++ psm_utils.c
@@ -975,7 +975,7 @@ struct psmi_faultinj_spec *psmi_faultinj_getspec(char 
*spec_name, int num,
                union psmi_envvar_val env_fi;
                char fvals_str[128];
                char fname[128];
-               char fdesc[256];
+               char fdesc[280];
 
                snprintf(fvals_str, sizeof(fvals_str) - 1, "%d:%d:1", num,
                         denom);

Reply via email to