components/open-fabrics/libibverbs/patches/base.patch
changeset 1196 cba083182ade
parent 1125 47a52afcc302
child 1399 8f4b38fe52ad
--- a/components/open-fabrics/libibverbs/patches/base.patch	Mon Mar 04 23:02:05 2013 -0800
+++ b/components/open-fabrics/libibverbs/patches/base.patch	Tue Mar 05 13:55:23 2013 -0800
@@ -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
@@ -1281,8 +1284,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)
@@ -1291,7 +1298,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;
  
@@ -1327,7 +1334,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);
  
@@ -1335,7 +1342,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;
@@ -1343,7 +1350,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)
  {
@@ -1351,7 +1380,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);
@@ -1936,7 +1965,15 @@
  struct ibv_qp_init_attr {
  	void		       *qp_context;
  	struct ibv_cq	       *send_cq;
-@@ -743,6 +774,12 @@
+@@ -659,6 +690,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 +775,12 @@
  	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
  						uint16_t lid);
  	void			(*async_event)(struct ibv_async_event *event);
@@ -1949,7 +1986,7 @@
  };
  
  struct ibv_context {
-@@ -749,6 +786,13 @@
+@@ -749,6 +787,13 @@
  	struct ibv_device      *device;
  	struct ibv_context_ops	ops;
  	int			cmd_fd;
@@ -1963,7 +2000,7 @@
  	int			async_fd;
  	int			num_comp_vectors;
  	pthread_mutex_t		mutex;
-@@ -797,6 +841,11 @@
+@@ -797,6 +842,11 @@
  uint64_t ibv_get_device_guid(struct ibv_device *device);
  
  /**
@@ -1975,7 +2012,7 @@
   * ibv_open_device - Initialize device for use
   */
  struct ibv_context *ibv_open_device(struct ibv_device *device);
-@@ -853,11 +902,44 @@
+@@ -853,11 +903,44 @@
  		   int index, uint16_t *pkey);
  
  /**
@@ -2020,7 +2057,7 @@
   * ibv_dealloc_pd - Free a protection domain
   */
  int ibv_dealloc_pd(struct ibv_pd *pd);
-@@ -869,11 +951,27 @@
+@@ -869,11 +952,27 @@
  			  size_t length, int access);
  
  /**