16425070 Need a way to disable blueflame on sparc in OFUV libraries
authorChristophe Juhasz <Chris.Juhasz@Sun.COM>
Tue, 05 Mar 2013 13:55:23 -0800
changeset 1196 cba083182ade
parent 1195 71686832cf20
child 1197 2cb98ee9bc03
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	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
[email protected]@ -79,6 +79,9 @@
[email protected]@ -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;
[email protected]@ -86,19 +89,35 @@
[email protected]@ -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) {
[email protected]@ -109,6 +128,7 @@
[email protected]@ -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);
[email protected]@ -117,6 +137,7 @@
[email protected]@ -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);
[email protected]@ -409,6 +430,7 @@
[email protected]@ -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);
[email protected]@ -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;
+ }
[email protected]@ -409,6 +440,7 @@
  
  static void check_memlock_limit(void)
  {
@@ -1351,7 +1380,7 @@
  	struct rlimit rlim;
  
  	if (!geteuid())
[email protected]@ -423,6 +445,7 @@
[email protected]@ -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;
[email protected]@ -743,6 +774,12 @@
[email protected]@ -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 {
[email protected]@ -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 {
[email protected]@ -749,6 +786,13 @@
[email protected]@ -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;
[email protected]@ -797,6 +841,11 @@
[email protected]@ -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);
[email protected]@ -853,11 +902,44 @@
[email protected]@ -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);
[email protected]@ -869,11 +951,27 @@
[email protected]@ -869,11 +952,27 @@
  			  size_t length, int access);
  
  /**
--- a/components/open-fabrics/libmlx4/Makefile	Mon Mar 04 23:02:05 2013 -0800
+++ b/components/open-fabrics/libmlx4/Makefile	Tue Mar 05 13:55:23 2013 -0800
@@ -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	Tue Mar 05 13:55:23 2013 -0800
@@ -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	Tue Mar 05 13:55:23 2013 -0800
@@ -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	Mon Mar 04 23:02:05 2013 -0800
+++ b/components/open-fabrics/libmlx4/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/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
[email protected]@ -589,6 +589,58 @@
[email protected]@ -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;
+ 		/*
[email protected]@ -589,6 +590,58 @@
  		; /* nothing */
  }