components/open-fabrics/libibverbs/patches/base.patch
branchs11u1-sru
changeset 2567 333785b27b31
parent 2453 1c6123926962
child 2761 91830550729b
--- a/components/open-fabrics/libibverbs/patches/base.patch	Wed Apr 10 16:23:54 2013 -0700
+++ b/components/open-fabrics/libibverbs/patches/base.patch	Fri Apr 12 18:35:54 2013 -0700
@@ -1,3 +1,6 @@
+#
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+#
 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
@@ -1022,8 +1025,12 @@
 diff -r -u /tmp/846623/libibverbs-1.1.4/src/init.c libibverbs-1.1.4/src/init.c
 --- /tmp/846623/libibverbs-1.1.4/src/init.c	Sun Nov  1 06:47:19 2009
 +++ libibverbs-1.1.4/src/init.c	Fri Feb 11 04:02:32 2011
-@@ -79,6 +79,9 @@
+@@ -77,8 +77,13 @@
+ static struct ibv_driver_name *driver_name_list;
+ static struct ibv_driver *head_driver, *tail_driver;
  
++static uint blueflame_enabled = 0;
++
  static int find_sysfs_devs(void)
  {
 +#if defined(__SVR4) && defined(__sun)
@@ -1032,7 +1039,7 @@
  	char class_path[IBV_SYSFS_PATH_MAX];
  	DIR *class_dir;
  	struct dirent *dent;
-@@ -86,19 +89,35 @@
+@@ -86,19 +91,35 @@
  	char value[8];
  	int ret = 0;
  
@@ -1068,7 +1075,7 @@
  		if (!sysfs_dev)
  			sysfs_dev = malloc(sizeof *sysfs_dev);
  		if (!sysfs_dev) {
-@@ -109,6 +128,7 @@
+@@ -109,6 +130,7 @@
  		snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
  			 "%s/%s", class_path, dent->d_name);
  
@@ -1076,7 +1083,7 @@
  		if (stat(sysfs_dev->sysfs_path, &buf)) {
  			fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
  				sysfs_dev->sysfs_path);
-@@ -117,6 +137,7 @@
+@@ -117,6 +139,7 @@
  
  		if (!S_ISDIR(buf.st_mode))
  			continue;
@@ -1084,7 +1091,29 @@
  
  		snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
  			"%s", dent->d_name);
-@@ -409,6 +430,7 @@
+@@ -280,6 +303,13 @@
+ 
+ 			driver_name->next = driver_name_list;
+ 			driver_name_list  = driver_name;
++		} else if (strcmp(field, "blueflame") == 0) {
++			config += strspn(config, "\t ");
++			field = strsep(&config, "\n\t ");
++			if (strcmp(field, "enable") == 0)
++				blueflame_enabled = 1;
++			if (strcmp(field, "disable") == 0)
++				blueflame_enabled = 0;
+ 		} else
+ 			fprintf(stderr, PFX "Warning: ignoring bad config directive "
+ 				"'%s' in file '%s'.\n", field, path);
+@@ -367,6 +397,7 @@
+ 	strcpy(dev->dev_path,   sysfs_dev->sysfs_path);
+ 	strcpy(dev->name,       sysfs_dev->ibdev_name);
+ 	strcpy(dev->ibdev_path, sysfs_dev->ibdev_path);
++	dev->blueflame_enabled = blueflame_enabled;
+ 
+ 	return dev;
+ }
+@@ -409,6 +440,7 @@
  
  static void check_memlock_limit(void)
  {
@@ -1092,7 +1121,7 @@
  	struct rlimit rlim;
  
  	if (!geteuid())
-@@ -423,6 +445,7 @@
+@@ -423,6 +455,7 @@
  		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
  			"    This will severely limit memory registrations.\n",
  			rlim.rlim_cur);
@@ -1587,7 +1616,15 @@
  struct ibv_qp_init_attr {
  	void		       *qp_context;
  	struct ibv_cq	       *send_cq;
-@@ -743,6 +760,12 @@
+@@ -659,6 +676,7 @@
+ 	char			dev_path[IBV_SYSFS_PATH_MAX];
+ 	/* Path to infiniband class device in sysfs */
+ 	char			ibdev_path[IBV_SYSFS_PATH_MAX];
++	uint			blueflame_enabled;
+ };
+ 
+ struct ibv_more_ops {
+@@ -743,6 +761,12 @@
  	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
  						uint16_t lid);
  	void			(*async_event)(struct ibv_async_event *event);
@@ -1600,7 +1637,7 @@
  };
  
  struct ibv_context {
-@@ -749,6 +772,13 @@
+@@ -749,6 +773,13 @@
  	struct ibv_device      *device;
  	struct ibv_context_ops	ops;
  	int			cmd_fd;
@@ -1614,7 +1651,7 @@
  	int			async_fd;
  	int			num_comp_vectors;
  	pthread_mutex_t		mutex;
-@@ -797,6 +827,11 @@
+@@ -797,6 +828,11 @@
  uint64_t ibv_get_device_guid(struct ibv_device *device);
  
  /**
@@ -1626,7 +1663,7 @@
   * ibv_open_device - Initialize device for use
   */
  struct ibv_context *ibv_open_device(struct ibv_device *device);
-@@ -858,6 +893,20 @@
+@@ -858,6 +894,20 @@
  struct ibv_pd *ibv_alloc_pd(struct ibv_context *context);
  
  /**
@@ -1647,7 +1684,7 @@
   * ibv_dealloc_pd - Free a protection domain
   */
  int ibv_dealloc_pd(struct ibv_pd *pd);
-@@ -869,11 +918,27 @@
+@@ -869,11 +919,27 @@
  			  size_t length, int access);
  
  /**