# HG changeset patch # User boris.chiu@oracle.com # Date 1422030554 28800 # Node ID c058dce9610f8e37daa6bcd0b02d7ab8e62a6ac3 # Parent 96c88473320c9d02c8d8746657be3c06b183c8d8 18117487 saquery -m -t 50000 failed with multiple VFs created 18247164 SUNBT7167127 Some OFED tools print errors with a connect-x VPI card (userland) 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work 19187537 iberror() of open-fabrics dumps core because of buffer overrun 19195181 wrong handling of getaddrinfo() retval in open-fabrics dumps core 19448949 libibverbs cleanup incomplete diff -r 96c88473320c -r c058dce9610f components/open-fabrics/ibutils/patches/base.patch --- a/components/open-fabrics/ibutils/patches/base.patch Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/ibutils/patches/base.patch Fri Jan 23 08:29:14 2015 -0800 @@ -1,3 +1,6 @@ +# This patch was developed in-house. Since it is Solaris-specific, +# it is not suitable for upstream. +# diff -r -u /tmp/ibutils-1.5.7/config/osm.m4 ibutils-1.5.7/config/osm.m4 --- /tmp/ibutils-1.5.7/config/osm.m4 Thu Feb 18 03:31:34 2010 +++ ibutils-1.5.7/config/osm.m4 Thu Feb 24 16:51:16 2011 @@ -210,7 +213,7 @@ INSTALL_HEADER = $(INSTALL_DATA) diff -r -u /tmp/ibutils-1.5.7/ibdiag/src/ibdebug.tcl ibutils-1.5.7/ibdiag/src/ibdebug.tcl --- /tmp/ibutils-1.5.7/ibdiag/src/ibdebug.tcl Tue Mar 8 03:08:02 2011 -+++ ibutils-1.5.7/ibdiag/src/ibdebug.tcl Thu Jun 27 22:46:57 2013 ++++ ibutils-1.5.7/ibdiag/src/ibdebug.tcl Wed Apr 16 17:45:12 2014 @@ -352,13 +352,16 @@ if {[file exists $ibisOutDir/$ibisLogFile] && (![file writable $ibisOutDir/$ibisLogFile])} { set ibisLogFile $ibisLogFile.[pid] @@ -253,7 +256,7 @@ foreach {array_name data} {G data* Neighbor *} { diff -r -u /tmp/ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl --- /tmp/ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl Thu Oct 7 07:29:56 2010 -+++ ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl Wed Jun 19 07:43:17 2013 ++++ ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl Wed Apr 16 17:45:12 2014 @@ -675,6 +675,16 @@ } @@ -947,6 +950,18 @@ #define CR_CLASS 0x09 #define CR_ATTR_50 0x50 +diff -r -u /tmp/ibutils-1.5.7/ibis/src/ibis_base.h ibutils-1.5.7/ibis/src/ibis_base.h +--- /tmp/ibutils-1.5.7/ibis/src/ibis_base.h Wed Feb 24 02:09:25 2010 ++++ ibutils-1.5.7/ibis/src/ibis_base.h Wed Apr 9 10:54:26 2014 +@@ -64,7 +64,7 @@ + #define IBIS_FILE_PATH_MAX PATH_MAX + #endif + +-#define MAX_LOCAL_IBPORTS 32 ++#define MAX_LOCAL_IBPORTS MAX_PORTS + #define DISP_HANDLE_MAX 32 + + END_C_DECLS diff -r -u /tmp/ibutils-1.5.7/ibis/src/ibis_wrap.c ibutils-1.5.7/ibis/src/ibis_wrap.c --- /tmp/ibutils-1.5.7/ibis/src/ibis_wrap.c Mon Nov 1 16:03:44 2010 +++ ibutils-1.5.7/ibis/src/ibis_wrap.c Mon Jun 6 15:35:52 2011 @@ -1366,7 +1381,7 @@ OSM_CLFAGS=disabled diff -r -u /tmp/ibutils-1.5.7/Makefile.in ibutils-1.5.7/Makefile.in --- /tmp/ibutils-1.5.7/Makefile.in Tue Mar 8 03:09:29 2011 -+++ ibutils-1.5.7/Makefile.in Thu Mar 10 18:33:24 2011 ++++ ibutils-1.5.7/Makefile.in Thu Dec 12 15:36:52 2013 @@ -54,7 +54,7 @@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -1378,7 +1393,7 @@ INSTALL_HEADER = $(INSTALL_DATA) diff -r -u /tmp/ibutils-1.5.7/configure ibutils-1.5.7/configure --- /tmp/ibutils-1.5.7/configure Tue Mar 8 03:09:29 2011 -+++ ibutils-1.5.7/configure Thu Mar 10 18:33:24 2011 ++++ ibutils-1.5.7/configure Thu Dec 12 16:51:11 2013 @@ -1824,7 +1824,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' diff -r 96c88473320c -r c058dce9610f components/open-fabrics/infiniband-diags/patches/base.patch --- a/components/open-fabrics/infiniband-diags/patches/base.patch Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/infiniband-diags/patches/base.patch Fri Jan 23 08:29:14 2015 -0800 @@ -1,3 +1,6 @@ +# This patch was developed in-house. Since it is Solaris-specific, +# it is not suitable for upstream. +# diff -r -u /tmp/infiniband-diags-1.5.8/Makefile.am infiniband-diags-1.5.8/Makefile.am --- /tmp/infiniband-diags-1.5.8/Makefile.am Wed Feb 16 02:13:21 2011 +++ infiniband-diags-1.5.8/Makefile.am Fri Feb 25 03:09:22 2011 @@ -1803,16 +1806,17 @@ diff -r -u /tmp/infiniband-diags-1.5.8/src/saquery.c infiniband-diags-1.5.8/src/saquery.c --- /tmp/infiniband-diags-1.5.8/src/saquery.c Wed Feb 16 02:13:21 2011 +++ infiniband-diags-1.5.8/src/saquery.c Thu Jun 23 10:36:40 2011 -@@ -105,7 +105,7 @@ +@@ -104,8 +104,7 @@ + /** * Declare some globals because I don't want this to be too complex. */ - #define MAX_PORTS (8) +-#define MAX_PORTS (8) -#define DEFAULT_SA_TIMEOUT_MS (1000) +#define DEFAULT_SA_TIMEOUT_MS (10000) static struct query_res result; enum { -@@ -1757,7 +1757,7 @@ +@@ -1757,7 +1756,7 @@ requested_lid = (uint16_t) strtoul(argv[0], NULL, 0); requested_lid_flag++; } else if (node_print_desc == NAME_OF_GUID) { @@ -1868,7 +1872,54 @@ diff -r -u /tmp/infiniband-diags-1.5.8/src/ibstat.c infiniband-diags-1.5.8/src/ibstat.c --- /tmp/infiniband-diags-1.5.8/src/ibstat.c Wed Feb 16 02:13:21 2011 +++ infiniband-diags-1.5.8/src/ibstat.c Fri Feb 25 03:09:28 2011 -@@ -245,7 +245,7 @@ +@@ -46,6 +46,7 @@ + + #include + #include ++#include + + #include + +@@ -78,7 +79,7 @@ + } + + static char *port_state_str[] = { +- "???", ++ "Unknown", + "Down", + "Initializing", + "Armed", +@@ -112,10 +113,10 @@ + printf("%sPort %d:\n", hdrpre, port->portnum); + printf("%sState: %s\n", pre, + (unsigned)port->state <= +- 4 ? port_state_str[port->state] : "???"); ++ 4 ? port_state_str[port->state] : "Unknown"); + printf("%sPhysical state: %s\n", pre, + (unsigned)port->phys_state <= +- 7 ? port_phy_state_str[port->phys_state] : "???"); ++ 7 ? port_phy_state_str[port->phys_state] : "Unknown"); + printf("%sRate: %d\n", pre, port->rate); + printf("%sBase lid: %d\n", pre, port->base_lid); + printf("%sLMC: %d\n", pre, port->lmc); +@@ -167,13 +168,13 @@ + + static int ports_list(char names[][UMAD_CA_NAME_LEN], int n) + { +- uint64_t guids[64]; ++ uint64_t guids[MAX_PORTS]; + int found, ports, i; + +- for (i = 0, found = 0; i < n && found < 64; i++) { ++ for (i = 0, found = 0; i < n && found < MAX_PORTS; i++) { + if ((ports = + umad_get_ca_portguids(names[i], guids + found, +- 64 - found)) < 0) ++ MAX_PORTS - found)) < 0) + return -1; + found += ports; + } +@@ -245,7 +246,7 @@ if (i >= n) IBPANIC("'%s' IB device can't be found", argv[0]); @@ -1880,7 +1931,18 @@ diff -r -u /tmp/infiniband-diags-1.5.8/src/ibdiag_common.c infiniband-diags-1.5.8/src/ibdiag_common.c --- /tmp/infiniband-diags-1.5.8/src/ibdiag_common.c Wed Feb 16 02:13:21 2011 +++ infiniband-diags-1.5.8/src/ibdiag_common.c Tue May 3 13:50:05 2011 -@@ -330,7 +330,7 @@ +@@ -322,15 +322,17 @@ + char buf[512]; + va_list va; + int n; ++ int bufsz; + + va_start(va, msg); +- n = vsprintf(buf, msg, va); ++ bufsz = strlen(msg) < sizeof (buf) ? strlen(msg) : sizeof (buf); ++ n = vsnprintf(buf, bufsz, msg, va); + va_end(va); + buf[n] = 0; if (ibdebug) printf("%s: iberror: [pid %d] %s: failed: %s\n", diff -r 96c88473320c -r c058dce9610f components/open-fabrics/infiniband-diags/solaris_set_nodedesc.c --- a/components/open-fabrics/infiniband-diags/solaris_set_nodedesc.c Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/infiniband-diags/solaris_set_nodedesc.c Fri Jan 23 08:29:14 2015 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -54,6 +54,7 @@ #include #include +#include #include @@ -87,7 +88,6 @@ static di_node_t di_rootnode; char *argv0 = "solaris_set_nodedesc"; -#define MAX_HCAS 32 static struct nodedesc_read_info_s { boolean_t info_valid; uint64_t guid; diff -r 96c88473320c -r c058dce9610f components/open-fabrics/libibumad/patches/base.patch --- a/components/open-fabrics/libibumad/patches/base.patch Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/libibumad/patches/base.patch Fri Jan 23 08:29:14 2015 -0800 @@ -1,3 +1,6 @@ +# This patch was developed in-house. Since it is Solaris-specific, +# it is not suitable for upstream. +# diff -r -u /tmp/libibumad-1.3.7/Makefile.in libibumad-1.3.7/Makefile.in --- /tmp/libibumad-1.3.7/Makefile.in Mon Feb 14 06:18:00 2011 +++ libibumad-1.3.7/Makefile.in Fri Feb 25 03:11:40 2011 @@ -15,9 +18,29 @@ diff -r -u /tmp/libibumad-1.3.7/include/infiniband/umad.h libibumad-1.3.7/include/infiniband/umad.h --- /tmp/libibumad-1.3.7/include/infiniband/umad.h Mon Feb 14 01:08:29 2011 +++ libibumad-1.3.7/include/infiniband/umad.h Fri May 13 04:28:12 2011 -@@ -96,7 +96,11 @@ +@@ -45,7 +45,15 @@ + #endif /* __cplusplus */ - #define UMAD_MAX_PORTS 64 + BEGIN_C_DECLS +-#define UMAD_MAX_DEVICES 32 ++/* To accomodate max. of 16 PCIe slots and 63 VFs per HCA, */ ++/* we define MAX_HCAS = (63VFs + 1PF) * 16HCAs */ ++/* MAX_PORTS = MAX_HCAS * 2ports per HCA */ ++#define MAX_HCAS (64*16) ++#define MAX_PORTS (MAX_HCAS*2) ++#define UMAD_MAX_DEVICES MAX_HCAS ++#define UMAD_MAX_HCAS MAX_HCAS ++#define UMAD_MAX_PORTS MAX_PORTS ++ + #define UMAD_ANY_PORT 0 + typedef struct ib_mad_addr { + uint32_t qpn; +@@ -94,9 +102,13 @@ + #define SYS_IB_MAD_PORT "port" + #define SYS_IB_MAD_DEV "ibdev" + +-#define UMAD_MAX_PORTS 64 ++#define UMAD_MAX_PORTS MAX_PORTS +#if defined(__SVR4) && defined(__sun) +#define UMAD_DEV_DIR "/dev/infiniband/ofs" diff -r 96c88473320c -r c058dce9610f components/open-fabrics/libibverbs/patches/base.patch --- a/components/open-fabrics/libibverbs/patches/base.patch Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/libibverbs/patches/base.patch Fri Jan 23 08:29:14 2015 -0800 @@ -1,3 +1,6 @@ +# This patch was developed in-house. Since it is Solaris-specific, +# it is not suitable for upstream. +# diff -r -u /tmp/846623/libibverbs-1.1.4/Makefile.am libibverbs-1.1.4/Makefile.am --- /tmp/846623/libibverbs-1.1.4/Makefile.am Thu Feb 3 01:53:17 2011 +++ libibverbs-1.1.4/Makefile.am Fri Feb 11 04:02:12 2011 @@ -2524,6 +2527,27 @@ device_list.o: examples/device_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT device_list.o -MD -MP -MF $(DEPDIR)/device_list.Tpo -c -o device_list.o `test -f 'examples/device_list.c' || echo '$(srcdir)/'`examples/device_list.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/device_list.Tpo $(DEPDIR)/device_list.Po +diff -r -u /tmp/846623/libibverbs-1.1.4/examples/uc_pingpong.c libibverbs-1.1.4/examples/uc_pingpong.c +--- /tmp/846623/libibverbs-1.1.4/examples/uc_pingpong.c Thu Mar 10 06:58:21 2011 ++++ libibverbs-1.1.4/examples/uc_pingpong.c Tue Jan 6 10:05:55 2015 +@@ -144,7 +144,7 @@ + + n = getaddrinfo(servername, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port); + free(service); + return NULL; +@@ -219,7 +219,7 @@ + + n = getaddrinfo(NULL, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for port %d\n", gai_strerror(n), port); + free(service); + return NULL; diff -r -u /tmp/846623/libibverbs-1.1.4/examples/asyncwatch.c libibverbs-1.1.4/examples/asyncwatch.c --- /tmp/846623/libibverbs-1.1.4/examples/asyncwatch.c Thu Mar 10 06:58:21 2011 +++ libibverbs-1.1.4/examples/asyncwatch.c Fri Feb 11 04:02:18 2011 @@ -2916,51 +2940,87 @@ diff -r -u /tmp/846623/libibverbs-1.1.4/examples/srq_pingpong.c libibverbs-1.1.4/examples/srq_pingpong.c --- /tmp/846623/libibverbs-1.1.4/examples/srq_pingpong.c Thu Mar 10 06:58:21 2011 +++ libibverbs-1.1.4/examples/srq_pingpong.c Wed Jun 8 09:46:34 2011 -@@ -171,6 +171,12 @@ +@@ -165,8 +165,13 @@ + + n = getaddrinfo(servername, service, &hints, &res); + +- if (n < 0) { +- fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port); ++ if (n != 0) { ++ if (n == EAI_NONAME) ++ fprintf(stderr, ++ "Name or service not known for %s:%d\n", servername, port); ++ else ++ fprintf(stderr, ++ "%s for %s:%d\n", gai_strerror(n), servername, port); + free(service); return NULL; } +@@ -253,7 +258,7 @@ -+ if (n == EAI_NONAME) { -+ fprintf(stderr, "Name or service not known for %s:%d\n", servername, port); -+ free(service); -+ return NULL; -+ } -+ - for (t = res; t; t = t->ai_next) { - sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol); - if (sockfd >= 0) { + n = getaddrinfo(NULL, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for port %d\n", gai_strerror(n), port); + free(service); + return NULL; diff -r -u /tmp/846623/libibverbs-1.1.4/examples/ud_pingpong.c libibverbs-1.1.4/examples/ud_pingpong.c --- /tmp/846623/libibverbs-1.1.4/examples/ud_pingpong.c Thu Mar 10 06:58:21 2011 +++ libibverbs-1.1.4/examples/ud_pingpong.c Wed Jun 8 09:46:34 2011 -@@ -149,6 +149,12 @@ +@@ -143,8 +143,13 @@ + + n = getaddrinfo(servername, service, &hints, &res); + +- if (n < 0) { +- fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port); ++ if (n != 0) { ++ if (n == EAI_NONAME) ++ fprintf(stderr, ++ "Name or service not known for %s:%d\n", servername, port); ++ else ++ fprintf(stderr, ++ "%s for %s:%d\n", gai_strerror(n), servername, port); + free(service); return NULL; } +@@ -217,7 +222,7 @@ -+ if (n == EAI_NONAME) { -+ fprintf(stderr, "Name or service not known for %s:%d\n", servername, port); -+ free(service); -+ return NULL; -+ } -+ - for (t = res; t; t = t->ai_next) { - sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol); - if (sockfd >= 0) { + n = getaddrinfo(NULL, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for port %d\n", gai_strerror(n), port); + free(service); + return NULL; diff -r -u /tmp/846623/libibverbs-1.1.4/examples/rc_pingpong.c libibverbs-1.1.4/examples/rc_pingpong.c --- /tmp/846623/libibverbs-1.1.4/examples/rc_pingpong.c Thu Mar 10 06:58:21 2011 +++ libibverbs-1.1.4/examples/rc_pingpong.c Wed Jun 8 09:46:34 2011 -@@ -161,6 +161,12 @@ +@@ -155,8 +155,13 @@ + + n = getaddrinfo(servername, service, &hints, &res); + +- if (n < 0) { +- fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port); ++ if (n != 0) { ++ if (n == EAI_NONAME) ++ fprintf(stderr, ++ "Name or service not known for %s:%d\n", servername, port); ++ else ++ fprintf(stderr, ++ "%s for %s:%d\n", gai_strerror(n), servername, port); + free(service); return NULL; } +@@ -230,7 +235,7 @@ -+ if (n == EAI_NONAME) { -+ fprintf(stderr, "Name or service not known for %s:%d\n", servername, port); -+ free(service); -+ return NULL; -+ } -+ - for (t = res; t; t = t->ai_next) { - sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol); - if (sockfd >= 0) { + n = getaddrinfo(NULL, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for port %d\n", gai_strerror(n), port); + free(service); + return NULL; diff -r -u /tmp/846623/libibverbs-1.1.4/examples/device_list.c libibverbs-1.1.4/examples/device_list.c --- /tmp/846623/libibverbs-1.1.4/examples/device_list.c Sun Nov 1 06:47:19 2009 +++ libibverbs-1.1.4/examples/device_list.c Fri Feb 11 04:02:18 2011 diff -r 96c88473320c -r c058dce9610f components/open-fabrics/libibverbs/solaris_compatibility.c --- a/components/open-fabrics/libibverbs/solaris_compatibility.c Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/libibverbs/solaris_compatibility.c Fri Jan 23 08:29:14 2015 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -101,8 +101,6 @@ #define RDMA_USER_CM_MAX_ABI_VERSION 4 /* rdma_cma_abi.h */ #define MLX4 0 -#define MAX_HCAS 260 -#define MAX_HCA_PORTS 16 #define HW_DRIVER_MAX_NAME_LEN 20 #define UVERBS_KERNEL_SYSFS_NAME_BASE "uverbs" #define UMAD_KERNEL_SYSFS_NAME_BASE "umad" @@ -119,6 +117,9 @@ #define INFINIHOST_DEVICE_ID_2 0x5a45 #define INFINIHOST_DEVICE_ID_4 0x6279 +#define MAX_HCAS (64*16) +#define MAX_PORTS (MAX_HCAS*2) + /* * sol_uverbs_drv_status is the status of what libibverbs knows * about the status of sol_uverbs driver. @@ -164,7 +165,7 @@ char ibd_node_guid_external_str[20]; char ibd_sys_image_guid[20]; char ibd_fw_ver[16]; - char ibd_name[8]; + char ibd_name[16]; int ibd_boardid_index; uint_t ibd_device_id; } ibdev_cache_info_t; @@ -178,7 +179,7 @@ uint_t uvc_vendor_id; uint_t uvc_device_id; int uvc_hca_instance; - char uvc_ibdev_name[8]; + char uvc_ibdev_name[16]; char uvc_ibdev_hca_path[MAXPATHLEN]; } uverbs_cache_info_t; static uverbs_cache_info_t uverbs_dev_cache[MAX_HCAS]; @@ -189,7 +190,7 @@ int umc_port; char umc_ib_dev[16]; } umad_cache_info_t; -static umad_cache_info_t umad_dev_cache[MAX_HCAS * MAX_HCA_PORTS]; +static umad_cache_info_t umad_dev_cache[MAX_PORTS]; static int umad_abi_version = -1; pthread_once_t oneTimeInit = PTHREAD_ONCE_INIT; @@ -236,8 +237,7 @@ static int umad_cache_add(uint_t dev_num, int port, char *ibdev) { - if ((dev_num >= (MAX_HCAS * MAX_HCA_PORTS)) || - (umad_cache_cnt >= (MAX_HCAS * MAX_HCA_PORTS))) { + if ((dev_num >= MAX_PORTS) || (umad_cache_cnt >= MAX_PORTS)) { fprintf(stderr, "dev %d: exceeds umad cache size\n", dev_num); return (1); } @@ -371,13 +371,8 @@ uverbs_cache_info_t info; int dev_num, fd, i, bufsize, hca_cnt; char uverbs_devpath[MAXPATHLEN]; -#ifndef IB_USER_VERBS_V2_IN_V1 sol_uverbs_info_t *uverbs_infop; sol_uverbs_hca_info_t *hca_infop; -#else - sol_uverbs_info_v2_t *uverbs_infop; - sol_uverbs_hca_info_v2_t *hca_infop; -#endif char *buf; snprintf(uverbs_devpath, MAXPATHLEN, "%s/%s%d", @@ -394,20 +389,11 @@ goto error_exit1; } -#ifndef IB_USER_VERBS_V2_IN_V1 bufsize = sizeof (sol_uverbs_info_t) + sizeof (sol_uverbs_hca_info_t) * MAX_HCAS; -#else - bufsize = sizeof (sol_uverbs_info_v2_t) + - sizeof (sol_uverbs_hca_info_v2_t) * MAX_HCAS; -#endif buf = malloc(bufsize); memset(buf, 0, bufsize); -#ifndef IB_USER_VERBS_V2_IN_V1 uverbs_infop = (sol_uverbs_info_t *)buf; -#else - uverbs_infop = (sol_uverbs_info_v2_t *)buf; -#endif uverbs_infop->uverbs_hca_cnt = MAX_HCAS; if (ioctl(fd, UVERBS_IOCTL_GET_HCA_INFO, uverbs_infop) != 0) { @@ -484,7 +470,7 @@ sol_umad_ioctl_info_t *umad_infop; sol_umad_ioctl_port_info_t *port_infop; - for (minor = 0; minor < MAX_HCAS * MAX_HCA_PORTS; minor++) { + for (minor = 0; minor < MAX_PORTS; minor++) { snprintf(umad_devpath, MAXPATHLEN, "%s/%s%d", IB_OFS_DEVPATH_PREFIX, UMAD_KERNEL_SYSFS_NAME_BASE, minor); @@ -496,7 +482,7 @@ save_errno = errno; } - if ((minor == MAX_HCAS * MAX_HCA_PORTS) && (fd < 0)) { + if ((minor == MAX_PORTS) && (fd < 0)) { if (! save_errno) save_errno = errno; fprintf(stderr, "failed to open sol_umad: %s\n", @@ -505,12 +491,12 @@ } bufsize = sizeof (sol_umad_ioctl_info_t) + - (sizeof (sol_umad_ioctl_port_info_t) * MAX_HCAS * MAX_HCA_PORTS); + (sizeof (sol_umad_ioctl_port_info_t) * MAX_PORTS); buf = malloc(bufsize); memset(buf, 0, bufsize); umad_infop = (sol_umad_ioctl_info_t *)buf; - umad_infop->umad_port_cnt = MAX_HCAS * MAX_HCA_PORTS; + umad_infop->umad_port_cnt = MAX_PORTS; if (ioctl(fd, IB_USER_MAD_GET_PORT_INFO, umad_infop) != 0) { fprintf(stderr, "sol_umad ioctl failed: %s\n", @@ -593,7 +579,7 @@ memset(&uverbs_dev_cache, 0, (sizeof (uverbs_cache_info_t) * MAX_HCAS)); memset(&ibdev_cache, 0, (sizeof (ibdev_cache_info_t) * MAX_HCAS * 2)); memset(&umad_dev_cache, 0, - (sizeof (umad_cache_info_t) * MAX_HCAS * MAX_HCA_PORTS)); + (sizeof (umad_cache_info_t) * MAX_PORTS)); initialized = B_TRUE; } @@ -1146,6 +1132,19 @@ } else if (strcmp(path, "cap_mask") == 0) { len = 1 + sprintf(buf, "0x%08x", port_attr.port_cap_flags); + } else if (strcmp(path, "link_layer") == 0) { + switch (port_attr.link_layer) { + case IBV_LINK_LAYER_UNSPECIFIED: + case IBV_LINK_LAYER_INFINIBAND: + len = 1 + sprintf(buf, "%s", "IB"); + break; + case IBV_LINK_LAYER_ETHERNET: + len = + 1 + sprintf(buf, "%s", "Ethernet"); + break; + default: + len = 1 + sprintf(buf, "%s", "Unknown"); + } } } exit: @@ -1396,7 +1395,7 @@ (void) pthread_mutex_unlock(&umad_cache_mutex); if (check_path(path, CP_UMAD, &dev_num)) { - if (dev_num >= MAX_HCAS * MAX_HCA_PORTS) { + if (dev_num >= MAX_PORTS) { fprintf(stderr, "Invalid Path: %s\n", path); goto exit; } diff -r 96c88473320c -r c058dce9610f components/open-fabrics/opensm/patches/base.patch --- a/components/open-fabrics/opensm/patches/base.patch Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/opensm/patches/base.patch Fri Jan 23 08:29:14 2015 -0800 @@ -1,3 +1,6 @@ +# This patch was developed in-house. Since it is Solaris-specific, +# it is not suitable for upstream. +# diff -r -u /tmp/opensm-3.3.9/complib/Makefile.in opensm-3.3.9/complib/Makefile.in --- /tmp/opensm-3.3.9/complib/Makefile.in Mon Mar 7 00:01:52 2011 +++ opensm-3.3.9/complib/Makefile.in Mon Mar 14 03:17:52 2011 @@ -665,6 +668,18 @@ } /* +diff -r -u /tmp/opensm-3.3.9/include/vendor/osm_vendor_ibumad.h opensm-3.3.9/include/vendor/osm_vendor_ibumad.h +--- /tmp/opensm-3.3.9/include/vendor/osm_vendor_ibumad.h Sun Mar 6 23:51:12 2011 ++++ opensm-3.3.9/include/vendor/osm_vendor_ibumad.h Wed Apr 9 10:54:26 2014 +@@ -64,7 +64,7 @@ + * + *********/ + #define OSM_DEFAULT_RETRY_COUNT 3 +-#define OSM_UMAD_MAX_CAS 32 ++#define OSM_UMAD_MAX_CAS UMAD_MAX_HCAS + #define OSM_UMAD_MAX_PORTS_PER_CA 2 + #define OSM_UMAD_MAX_AGENTS 32 + diff -r -u /tmp/opensm-3.3.9/configure opensm-3.3.9/configure --- /tmp/opensm-3.3.9/configure Mon Mar 7 00:01:54 2011 +++ opensm-3.3.9/configure Mon Mar 14 03:13:28 2011 diff -r 96c88473320c -r c058dce9610f components/open-fabrics/perftest/patches/base.patch --- a/components/open-fabrics/perftest/patches/base.patch Tue Jan 20 05:18:57 2015 -0800 +++ b/components/open-fabrics/perftest/patches/base.patch Fri Jan 23 08:29:14 2015 -0800 @@ -1,3 +1,6 @@ +# This patch was developed in-house. Since it is Solaris-specific, +# it is not suitable for upstream. +# diff -r -u /tmp/perftest-1.3.0/Makefile perftest-1.3.0/Makefile --- /tmp/perftest-1.3.0/Makefile Thu Jan 20 01:37:35 2011 +++ perftest-1.3.0/Makefile Fri Feb 11 04:12:45 2011 @@ -214,9 +217,12 @@ #include #include -@@ -144,7 +147,7 @@ +@@ -142,9 +145,9 @@ - if (n < 0) { + n = getaddrinfo(data->servername, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { fprintf(stderr, "%d:%s: %s for %s:%d\n", - pid, __func__, gai_strerror(n), + (int)pid, __func__, gai_strerror(n), @@ -343,11 +349,13 @@ free(data->rem_dest); goto err; } -@@ -347,7 +350,7 @@ +@@ -346,8 +349,8 @@ + if (asprintf(&service, "%d", data->port) < 0) goto err5; - if ( (n = getaddrinfo(NULL, service, &hints, &res)) < 0 ) { +- if ( (n = getaddrinfo(NULL, service, &hints, &res)) < 0 ) { - fprintf(stderr, "%d:%s: %s for port %d\n", pid, __func__, ++ if ( (n = getaddrinfo(NULL, service, &hints, &res) != 0) ) { + fprintf(stderr, "%d:%s: %s for port %d\n", (int)pid, __func__, gai_strerror(n), data->port); goto err5; @@ -828,6 +836,15 @@ return 1; } ccnt += 1; +@@ -1265,7 +1277,7 @@ + + write(data.sockfd, "done", sizeof "done"); + close(data.sockfd); +- ++ + } + + print_report(iters, data.size, duplex, tposted, tcompleted); diff -r -u /tmp/perftest-1.3.0/rdma_lat.c perftest-1.3.0/rdma_lat.c --- /tmp/perftest-1.3.0/rdma_lat.c Wed Apr 7 09:44:33 2010 +++ perftest-1.3.0/rdma_lat.c Fri Feb 11 04:12:46 2011 @@ -874,9 +891,12 @@ &rem_dest->psn, &rem_dest->rkey, &rem_dest->vaddr); if (parsed != 5) { -@@ -220,7 +229,7 @@ +@@ -218,9 +227,9 @@ - if (n < 0) { + n = getaddrinfo(data->servername, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { fprintf(stderr, "%d:%s: %s for %s:%d\n", - pid, __func__, gai_strerror(n), + (int)pid, __func__, gai_strerror(n), @@ -962,11 +982,13 @@ goto err3; } ctx = pp_init_ctx(data->ib_dev, data); -@@ -393,7 +402,7 @@ +@@ -392,8 +401,8 @@ + if (asprintf(&service, "%d", data->port) < 0) goto err5; - if ( (n = getaddrinfo(NULL, service, &hints, &res)) < 0 ) { +- if ( (n = getaddrinfo(NULL, service, &hints, &res)) < 0 ) { - fprintf(stderr, "%d:%s: %s for port %d\n", pid, __func__, ++ if ( (n = getaddrinfo(NULL, service, &hints, &res) != 0) ) { + fprintf(stderr, "%d:%s: %s for port %d\n", (int)pid, __func__, gai_strerror(n), data->port); goto err5; @@ -1384,6 +1406,24 @@ } else { switch (params->mtu) { +@@ -791,7 +807,7 @@ + + n = getaddrinfo(servername, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port); + return n; + } +@@ -835,7 +851,7 @@ + + n = getaddrinfo(NULL, service, &hints, &res); + +- if (n < 0) { ++ if (n != 0) { + fprintf(stderr, "%s for port %d\n", gai_strerror(n), port); + return n; + } @@ -869,7 +885,6 @@ close(sockfd); return connfd;