components/open-fabrics/libibverbs/patches/base.patch
branchs11u1-sru
changeset 2567 333785b27b31
parent 2453 1c6123926962
child 2761 91830550729b
equal deleted inserted replaced
2565:1811d1ff7c66 2567:333785b27b31
       
     1 #
       
     2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
       
     3 #
     1 diff -r -u /tmp/846623/libibverbs-1.1.4/Makefile.am libibverbs-1.1.4/Makefile.am
     4 diff -r -u /tmp/846623/libibverbs-1.1.4/Makefile.am libibverbs-1.1.4/Makefile.am
     2 --- /tmp/846623/libibverbs-1.1.4/Makefile.am	Thu Feb  3 01:53:17 2011
     5 --- /tmp/846623/libibverbs-1.1.4/Makefile.am	Thu Feb  3 01:53:17 2011
     3 +++ libibverbs-1.1.4/Makefile.am	Fri Feb 11 04:02:12 2011
     6 +++ libibverbs-1.1.4/Makefile.am	Fri Feb 11 04:02:12 2011
     4 @@ -4,13 +4,13 @@
     7 @@ -4,13 +4,13 @@
     5  
     8  
  1020  }
  1023  }
  1021 -
  1024 -
  1022 diff -r -u /tmp/846623/libibverbs-1.1.4/src/init.c libibverbs-1.1.4/src/init.c
  1025 diff -r -u /tmp/846623/libibverbs-1.1.4/src/init.c libibverbs-1.1.4/src/init.c
  1023 --- /tmp/846623/libibverbs-1.1.4/src/init.c	Sun Nov  1 06:47:19 2009
  1026 --- /tmp/846623/libibverbs-1.1.4/src/init.c	Sun Nov  1 06:47:19 2009
  1024 +++ libibverbs-1.1.4/src/init.c	Fri Feb 11 04:02:32 2011
  1027 +++ libibverbs-1.1.4/src/init.c	Fri Feb 11 04:02:32 2011
  1025 @@ -79,6 +79,9 @@
  1028 @@ -77,8 +77,13 @@
  1026  
  1029  static struct ibv_driver_name *driver_name_list;
       
  1030  static struct ibv_driver *head_driver, *tail_driver;
       
  1031  
       
  1032 +static uint blueflame_enabled = 0;
       
  1033 +
  1027  static int find_sysfs_devs(void)
  1034  static int find_sysfs_devs(void)
  1028  {
  1035  {
  1029 +#if defined(__SVR4) && defined(__sun)
  1036 +#if defined(__SVR4) && defined(__sun)
  1030 +	char device_path[IBV_SYSFS_PATH_MAX];
  1037 +	char device_path[IBV_SYSFS_PATH_MAX];
  1031 +#endif
  1038 +#endif
  1032  	char class_path[IBV_SYSFS_PATH_MAX];
  1039  	char class_path[IBV_SYSFS_PATH_MAX];
  1033  	DIR *class_dir;
  1040  	DIR *class_dir;
  1034  	struct dirent *dent;
  1041  	struct dirent *dent;
  1035 @@ -86,19 +89,35 @@
  1042 @@ -86,19 +91,35 @@
  1036  	char value[8];
  1043  	char value[8];
  1037  	int ret = 0;
  1044  	int ret = 0;
  1038  
  1045  
  1039 +#if defined(__SVR4) && defined(__sun)
  1046 +#if defined(__SVR4) && defined(__sun)
  1040 +	snprintf(device_path, sizeof device_path, "/dev/infiniband/ofs");
  1047 +	snprintf(device_path, sizeof device_path, "/dev/infiniband/ofs");
  1066 +			continue;
  1073 +			continue;
  1067 +#endif
  1074 +#endif
  1068  		if (!sysfs_dev)
  1075  		if (!sysfs_dev)
  1069  			sysfs_dev = malloc(sizeof *sysfs_dev);
  1076  			sysfs_dev = malloc(sizeof *sysfs_dev);
  1070  		if (!sysfs_dev) {
  1077  		if (!sysfs_dev) {
  1071 @@ -109,6 +128,7 @@
  1078 @@ -109,6 +130,7 @@
  1072  		snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
  1079  		snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
  1073  			 "%s/%s", class_path, dent->d_name);
  1080  			 "%s/%s", class_path, dent->d_name);
  1074  
  1081  
  1075 +#if !(defined(__SVR4) && defined(__sun))
  1082 +#if !(defined(__SVR4) && defined(__sun))
  1076  		if (stat(sysfs_dev->sysfs_path, &buf)) {
  1083  		if (stat(sysfs_dev->sysfs_path, &buf)) {
  1077  			fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
  1084  			fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
  1078  				sysfs_dev->sysfs_path);
  1085  				sysfs_dev->sysfs_path);
  1079 @@ -117,6 +137,7 @@
  1086 @@ -117,6 +139,7 @@
  1080  
  1087  
  1081  		if (!S_ISDIR(buf.st_mode))
  1088  		if (!S_ISDIR(buf.st_mode))
  1082  			continue;
  1089  			continue;
  1083 +#endif
  1090 +#endif
  1084  
  1091  
  1085  		snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
  1092  		snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
  1086  			"%s", dent->d_name);
  1093  			"%s", dent->d_name);
  1087 @@ -409,6 +430,7 @@
  1094 @@ -280,6 +303,13 @@
       
  1095  
       
  1096  			driver_name->next = driver_name_list;
       
  1097  			driver_name_list  = driver_name;
       
  1098 +		} else if (strcmp(field, "blueflame") == 0) {
       
  1099 +			config += strspn(config, "\t ");
       
  1100 +			field = strsep(&config, "\n\t ");
       
  1101 +			if (strcmp(field, "enable") == 0)
       
  1102 +				blueflame_enabled = 1;
       
  1103 +			if (strcmp(field, "disable") == 0)
       
  1104 +				blueflame_enabled = 0;
       
  1105  		} else
       
  1106  			fprintf(stderr, PFX "Warning: ignoring bad config directive "
       
  1107  				"'%s' in file '%s'.\n", field, path);
       
  1108 @@ -367,6 +397,7 @@
       
  1109  	strcpy(dev->dev_path,   sysfs_dev->sysfs_path);
       
  1110  	strcpy(dev->name,       sysfs_dev->ibdev_name);
       
  1111  	strcpy(dev->ibdev_path, sysfs_dev->ibdev_path);
       
  1112 +	dev->blueflame_enabled = blueflame_enabled;
       
  1113  
       
  1114  	return dev;
       
  1115  }
       
  1116 @@ -409,6 +440,7 @@
  1088  
  1117  
  1089  static void check_memlock_limit(void)
  1118  static void check_memlock_limit(void)
  1090  {
  1119  {
  1091 +#if !(defined(__SVR4) && defined(__sun))
  1120 +#if !(defined(__SVR4) && defined(__sun))
  1092  	struct rlimit rlim;
  1121  	struct rlimit rlim;
  1093  
  1122  
  1094  	if (!geteuid())
  1123  	if (!geteuid())
  1095 @@ -423,6 +445,7 @@
  1124 @@ -423,6 +455,7 @@
  1096  		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
  1125  		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
  1097  			"    This will severely limit memory registrations.\n",
  1126  			"    This will severely limit memory registrations.\n",
  1098  			rlim.rlim_cur);
  1127  			rlim.rlim_cur);
  1099 +#endif
  1128 +#endif
  1100  }
  1129  }
  1585 +#endif
  1614 +#endif
  1586 +
  1615 +
  1587  struct ibv_qp_init_attr {
  1616  struct ibv_qp_init_attr {
  1588  	void		       *qp_context;
  1617  	void		       *qp_context;
  1589  	struct ibv_cq	       *send_cq;
  1618  	struct ibv_cq	       *send_cq;
  1590 @@ -743,6 +760,12 @@
  1619 @@ -659,6 +676,7 @@
       
  1620  	char			dev_path[IBV_SYSFS_PATH_MAX];
       
  1621  	/* Path to infiniband class device in sysfs */
       
  1622  	char			ibdev_path[IBV_SYSFS_PATH_MAX];
       
  1623 +	uint			blueflame_enabled;
       
  1624  };
       
  1625  
       
  1626  struct ibv_more_ops {
       
  1627 @@ -743,6 +761,12 @@
  1591  	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
  1628  	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
  1592  						uint16_t lid);
  1629  						uint16_t lid);
  1593  	void			(*async_event)(struct ibv_async_event *event);
  1630  	void			(*async_event)(struct ibv_async_event *event);
  1594 +	struct ibv_mr *		(*reg_mr_relaxed)(struct ibv_pd *pd, void *addr, size_t length,
  1631 +	struct ibv_mr *		(*reg_mr_relaxed)(struct ibv_pd *pd, void *addr, size_t length,
  1595 +					  int access);
  1632 +					  int access);
  1598 +	struct ibv_shpd *	(*alloc_shpd)(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd);
  1635 +	struct ibv_shpd *	(*alloc_shpd)(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd);
  1599 +	struct ibv_pd *		(*share_pd)(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key);
  1636 +	struct ibv_pd *		(*share_pd)(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key);
  1600  };
  1637  };
  1601  
  1638  
  1602  struct ibv_context {
  1639  struct ibv_context {
  1603 @@ -749,6 +772,13 @@
  1640 @@ -749,6 +773,13 @@
  1604  	struct ibv_device      *device;
  1641  	struct ibv_device      *device;
  1605  	struct ibv_context_ops	ops;
  1642  	struct ibv_context_ops	ops;
  1606  	int			cmd_fd;
  1643  	int			cmd_fd;
  1607 +#if defined(__SVR4) && defined(__sun)
  1644 +#if defined(__SVR4) && defined(__sun)
  1608 +	/*
  1645 +	/*
  1612 +	int			mmap_fd;
  1649 +	int			mmap_fd;
  1613 +#endif
  1650 +#endif
  1614  	int			async_fd;
  1651  	int			async_fd;
  1615  	int			num_comp_vectors;
  1652  	int			num_comp_vectors;
  1616  	pthread_mutex_t		mutex;
  1653  	pthread_mutex_t		mutex;
  1617 @@ -797,6 +827,11 @@
  1654 @@ -797,6 +828,11 @@
  1618  uint64_t ibv_get_device_guid(struct ibv_device *device);
  1655  uint64_t ibv_get_device_guid(struct ibv_device *device);
  1619  
  1656  
  1620  /**
  1657  /**
  1621 + * ibv_get_device_guid_external - Return device's node external GUID
  1658 + * ibv_get_device_guid_external - Return device's node external GUID
  1622 + */
  1659 + */
  1624 +
  1661 +
  1625 +/**
  1662 +/**
  1626   * ibv_open_device - Initialize device for use
  1663   * ibv_open_device - Initialize device for use
  1627   */
  1664   */
  1628  struct ibv_context *ibv_open_device(struct ibv_device *device);
  1665  struct ibv_context *ibv_open_device(struct ibv_device *device);
  1629 @@ -858,6 +893,20 @@
  1666 @@ -858,6 +894,20 @@
  1630  struct ibv_pd *ibv_alloc_pd(struct ibv_context *context);
  1667  struct ibv_pd *ibv_alloc_pd(struct ibv_context *context);
  1631  
  1668  
  1632  /**
  1669  /**
  1633 + * ibv_alloc_shpd - Mark given protection domain as shareable & return shpd structure
  1670 + * ibv_alloc_shpd - Mark given protection domain as shareable & return shpd structure
  1634 + *                  that identify it.
  1671 + *                  that identify it.
  1645 +
  1682 +
  1646 +/**
  1683 +/**
  1647   * ibv_dealloc_pd - Free a protection domain
  1684   * ibv_dealloc_pd - Free a protection domain
  1648   */
  1685   */
  1649  int ibv_dealloc_pd(struct ibv_pd *pd);
  1686  int ibv_dealloc_pd(struct ibv_pd *pd);
  1650 @@ -869,11 +918,27 @@
  1687 @@ -869,11 +919,27 @@
  1651  			  size_t length, int access);
  1688  			  size_t length, int access);
  1652  
  1689  
  1653  /**
  1690  /**
  1654 + * ibv_reg_mr_relaxed - Register a memory region using FMR
  1691 + * ibv_reg_mr_relaxed - Register a memory region using FMR
  1655 + */
  1692 + */