16425070 Need a way to disable blueflame on sparc in OFUV libraries s11u1-sru
authorChristophe Juhasz <Chris.Juhasz@Sun.COM>
Fri, 12 Apr 2013 18:35:54 -0700
branchs11u1-sru
changeset 2567 333785b27b31
parent 2565 1811d1ff7c66
child 2570 40da38c985e9
16425070 Need a way to disable blueflame on sparc in OFUV libraries
components/open-fabrics/libibverbs/patches/base.patch
components/open-fabrics/libmlx4/Makefile
components/open-fabrics/libmlx4/mlx4.driver.i386
components/open-fabrics/libmlx4/mlx4.driver.sparc
components/open-fabrics/libmlx4/patches/base.patch
--- 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);
  
  /**
--- a/components/open-fabrics/libmlx4/Makefile	Wed Apr 10 16:23:54 2013 -0700
+++ b/components/open-fabrics/libmlx4/Makefile	Fri Apr 12 18:35:54 2013 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../../make-rules/shared-macros.mk
 
@@ -44,7 +44,12 @@
 
 CONFIGURE_OPTIONS +=	LDFLAGS="$(LDFLAGS)"
 
-COMPONENT_PREP_ACTION += (cd $(@D) ; \
+COMPONENT_PREP_ACTION += (if [ x$(MACH) = "xi386" ]; then \
+		cp mlx4.driver.i386 $(@D)/mlx4.driver; \
+		else \
+		cp mlx4.driver.sparc $(@D)/mlx4.driver; \
+		fi; \
+		cd $(@D) ; \
 		aclocal --force ; \
 		libtoolize --copy --force --ltdl ; \
 		autoconf --force ; \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/open-fabrics/libmlx4/mlx4.driver.i386	Fri Apr 12 18:35:54 2013 -0700
@@ -0,0 +1,6 @@
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# 
+# WARNING: Do not change these settings unless you know what you are doing.
+driver mlx4
+blueflame enable
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/open-fabrics/libmlx4/mlx4.driver.sparc	Fri Apr 12 18:35:54 2013 -0700
@@ -0,0 +1,5 @@
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+#
+# WARNING: Do not change these settings unless you know what you are doing.
+driver mlx4
--- a/components/open-fabrics/libmlx4/patches/base.patch	Wed Apr 10 16:23:54 2013 -0700
+++ b/components/open-fabrics/libmlx4/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/839450/libmlx4-1.0.1/Makefile.am libmlx4-1.0.1/Makefile.am
 --- /tmp/839450/libmlx4-1.0.1/Makefile.am	Tue Sep  8 06:40:35 2009
 +++ libmlx4-1.0.1/Makefile.am	Tue Mar 15 06:49:47 2011
@@ -823,7 +826,17 @@
 diff -r -u /tmp/839450/libmlx4-1.0.1/src/qp.c libmlx4-1.0.1/src/qp.c
 --- /tmp/839450/libmlx4-1.0.1/src/qp.c	Thu Mar 10 04:48:34 2011
 +++ libmlx4-1.0.1/src/qp.c	Tue Mar 15 07:09:43 2011
-@@ -589,6 +589,58 @@
+@@ -407,7 +407,8 @@
+ out:
+ 	ctx = to_mctx(ibqp->context);
+ 
+-	if (nreq == 1 && inl && size > 1 && size < ctx->bf_buf_size / 16) {
++	if (ctx->ibv_ctx.device->blueflame_enabled && nreq == 1 && inl &&
++	    size > 1 && size < ctx->bf_buf_size / 16) {
+ 		ctrl->owner_opcode |= htonl((qp->sq.head & 0xffff) << 8);
+ 		*(uint32_t *) (&ctrl->vlan_tag) |= qp->doorbell_qpn;
+ 		/*
+@@ -589,6 +590,58 @@
  		; /* nothing */
  }