components/open-fabrics/libibumad/patches/base.patch
changeset 715 eed3ed08f692
parent 636 da28b1dc61e7
child 900 63d3bf696d85
--- a/components/open-fabrics/libibumad/patches/base.patch	Wed Feb 29 12:08:58 2012 -0800
+++ b/components/open-fabrics/libibumad/patches/base.patch	Wed Feb 29 22:39:04 2012 +0000
@@ -104,7 +104,7 @@
  
  #define TRACE	if (umaddebug)	IBWARN
  #define DEBUG	if (umaddebug)	IBWARN
-@@ -172,6 +176,82 @@
+@@ -172,6 +176,73 @@
  	memcpy(&port->port_guid, gid + 8, sizeof port->port_guid);
  
  	snprintf(port_dir + len, sizeof(port_dir) - len, "/pkeys");
@@ -166,20 +166,11 @@
 +		num_pkeys = ibv_query_pkey(ctx, portnum, port_attr.pkey_tbl_len,
 +		    port->pkeys);
 +		if (num_pkeys != 0) {
-+			/*
-+			 * have to do one at a time.
-+			 */
-+			portnum &= 0x7f;
-+			for (i = 0; i < port_attr.pkey_tbl_len; i++) {
-+				if (ibv_query_pkey(ctx, portnum, i,
-+				    &(port->pkeys[i]))) {
-+					IBWARN("Could not retrieve pkeys for "
-+					    "\"%s\"", ca_name);
-+					ibv_close_device(ctx);
-+					ibv_free_device_list(root_dev_list);
-+					goto clean;
-+				}
-+			}
++			IBWARN("get_port: ibv_query_pkey() failed for \"%s\"",
++			    ca_name);
++			ibv_close_device(ctx);
++			ibv_free_device_list(root_dev_list);
++			goto clean;
 +		}
 +		port->pkeys_size = port_attr.pkey_tbl_len;
 +	}
@@ -187,7 +178,7 @@
  	num_pkeys = scandir(port_dir, &namelist, check_for_digit_name, NULL);
  	if (num_pkeys <= 0) {
  		IBWARN("no pkeys found for %s:%u (at dir %s)...",
-@@ -193,6 +273,8 @@
+@@ -193,6 +264,8 @@
  	port->pkeys_size = num_pkeys;
  	free(namelist);
  	namelist = NULL;
@@ -196,7 +187,7 @@
  	port_dir[len] = '\0';
  
  	/* FIXME: handle gids */
-@@ -384,6 +466,7 @@
+@@ -384,6 +457,7 @@
  	snprintf(dir_name, sizeof(dir_name), "%s/%s/%s",
  		 SYS_INFINIBAND, ca->ca_name, SYS_CA_PORTS_DIR);
  
@@ -204,7 +195,7 @@
  	if (!(dir = opendir(dir_name)))
  		return -ENOENT;
  
-@@ -425,15 +508,41 @@
+@@ -425,15 +499,41 @@
  	free(namelist);
  
  	closedir(dir);
@@ -246,7 +237,7 @@
  	release_ca(ca);
  
  	return ret;
-@@ -484,6 +593,11 @@
+@@ -484,6 +584,11 @@
  int umad_init(void)
  {
  	TRACE("umad_init");
@@ -258,7 +249,7 @@
  	if (sys_read_uint(IB_UMAD_ABI_DIR, IB_UMAD_ABI_FILE, &abi_version) < 0) {
  		IBWARN
  		    ("can't read ABI version from %s/%s (%m): is ib_umad module loaded?",
-@@ -522,6 +636,28 @@
+@@ -522,6 +627,28 @@
  
  int umad_get_cas_names(char cas[][UMAD_CA_NAME_LEN], int max)
  {
@@ -287,7 +278,7 @@
  	struct dirent **namelist;
  	int n, i, j = 0;
  
-@@ -547,6 +683,7 @@
+@@ -547,6 +674,7 @@
  	}
  	if (n >= 0)
  		free(namelist);