16485129 Need a way to disable blueflame on sparc in OFUV libraries s11-update
authorChristophe Juhasz <Chris.Juhasz@Sun.COM>
Fri, 05 Apr 2013 07:47:58 -0700
branchs11-update
changeset 2550 02b339f70efd
parent 2549 66da0486207a
child 2551 0391c5c3b137
16485129 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	Thu Apr 04 20:41:44 2013 +0100
+++ b/components/open-fabrics/libibverbs/patches/base.patch	Fri Apr 05 07:47:58 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
@@ -172,7 +175,7 @@
  .B ibv_get_device_guid()
 diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_post_send.3 libibverbs-1.1.4/man/ibv_post_send.3
 --- /tmp/846623/libibverbs-1.1.4/man/ibv_post_send.3	Thu Mar 10 06:58:20 2011
-+++ libibverbs-1.1.4/man/ibv_post_send.3	Thu Dec  6 13:50:27 2012
++++ libibverbs-1.1.4/man/ibv_post_send.3	Wed Mar 13 07:28:54 2013
 @@ -91,14 +91,17 @@
  The attribute send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 of one or more of the following flags:
  .PP
@@ -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);
  
  /**
--- a/components/open-fabrics/libmlx4/Makefile	Thu Apr 04 20:41:44 2013 +0100
+++ b/components/open-fabrics/libmlx4/Makefile	Fri Apr 05 07:47:58 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 05 07:47:58 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 05 07:47:58 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	Thu Apr 04 20:41:44 2013 +0100
+++ b/components/open-fabrics/libmlx4/patches/base.patch	Fri Apr 05 07:47:58 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 */
  }