components/open-fabrics/libibverbs/patches/base.patch
changeset 1196 cba083182ade
parent 1125 47a52afcc302
child 1399 8f4b38fe52ad
equal deleted inserted replaced
1195:71686832cf20 1196:cba083182ade
       
     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  
  1279  }
  1282  }
  1280 -
  1283 -
  1281 diff -r -u /tmp/846623/libibverbs-1.1.4/src/init.c libibverbs-1.1.4/src/init.c
  1284 diff -r -u /tmp/846623/libibverbs-1.1.4/src/init.c libibverbs-1.1.4/src/init.c
  1282 --- /tmp/846623/libibverbs-1.1.4/src/init.c	Sun Nov  1 06:47:19 2009
  1285 --- /tmp/846623/libibverbs-1.1.4/src/init.c	Sun Nov  1 06:47:19 2009
  1283 +++ libibverbs-1.1.4/src/init.c	Fri Feb 11 04:02:32 2011
  1286 +++ libibverbs-1.1.4/src/init.c	Fri Feb 11 04:02:32 2011
  1284 @@ -79,6 +79,9 @@
  1287 @@ -77,8 +77,13 @@
  1285  
  1288  static struct ibv_driver_name *driver_name_list;
       
  1289  static struct ibv_driver *head_driver, *tail_driver;
       
  1290  
       
  1291 +static uint blueflame_enabled = 0;
       
  1292 +
  1286  static int find_sysfs_devs(void)
  1293  static int find_sysfs_devs(void)
  1287  {
  1294  {
  1288 +#if defined(__SVR4) && defined(__sun)
  1295 +#if defined(__SVR4) && defined(__sun)
  1289 +	char device_path[IBV_SYSFS_PATH_MAX];
  1296 +	char device_path[IBV_SYSFS_PATH_MAX];
  1290 +#endif
  1297 +#endif
  1291  	char class_path[IBV_SYSFS_PATH_MAX];
  1298  	char class_path[IBV_SYSFS_PATH_MAX];
  1292  	DIR *class_dir;
  1299  	DIR *class_dir;
  1293  	struct dirent *dent;
  1300  	struct dirent *dent;
  1294 @@ -86,19 +89,35 @@
  1301 @@ -86,19 +91,35 @@
  1295  	char value[8];
  1302  	char value[8];
  1296  	int ret = 0;
  1303  	int ret = 0;
  1297  
  1304  
  1298 +#if defined(__SVR4) && defined(__sun)
  1305 +#if defined(__SVR4) && defined(__sun)
  1299 +	snprintf(device_path, sizeof device_path, "/dev/infiniband/ofs");
  1306 +	snprintf(device_path, sizeof device_path, "/dev/infiniband/ofs");
  1325 +			continue;
  1332 +			continue;
  1326 +#endif
  1333 +#endif
  1327  		if (!sysfs_dev)
  1334  		if (!sysfs_dev)
  1328  			sysfs_dev = malloc(sizeof *sysfs_dev);
  1335  			sysfs_dev = malloc(sizeof *sysfs_dev);
  1329  		if (!sysfs_dev) {
  1336  		if (!sysfs_dev) {
  1330 @@ -109,6 +128,7 @@
  1337 @@ -109,6 +130,7 @@
  1331  		snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
  1338  		snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
  1332  			 "%s/%s", class_path, dent->d_name);
  1339  			 "%s/%s", class_path, dent->d_name);
  1333  
  1340  
  1334 +#if !(defined(__SVR4) && defined(__sun))
  1341 +#if !(defined(__SVR4) && defined(__sun))
  1335  		if (stat(sysfs_dev->sysfs_path, &buf)) {
  1342  		if (stat(sysfs_dev->sysfs_path, &buf)) {
  1336  			fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
  1343  			fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
  1337  				sysfs_dev->sysfs_path);
  1344  				sysfs_dev->sysfs_path);
  1338 @@ -117,6 +137,7 @@
  1345 @@ -117,6 +139,7 @@
  1339  
  1346  
  1340  		if (!S_ISDIR(buf.st_mode))
  1347  		if (!S_ISDIR(buf.st_mode))
  1341  			continue;
  1348  			continue;
  1342 +#endif
  1349 +#endif
  1343  
  1350  
  1344  		snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
  1351  		snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
  1345  			"%s", dent->d_name);
  1352  			"%s", dent->d_name);
  1346 @@ -409,6 +430,7 @@
  1353 @@ -280,6 +303,13 @@
       
  1354  
       
  1355  			driver_name->next = driver_name_list;
       
  1356  			driver_name_list  = driver_name;
       
  1357 +		} else if (strcmp(field, "blueflame") == 0) {
       
  1358 +			config += strspn(config, "\t ");
       
  1359 +			field = strsep(&config, "\n\t ");
       
  1360 +			if (strcmp(field, "enable") == 0)
       
  1361 +				blueflame_enabled = 1;
       
  1362 +			if (strcmp(field, "disable") == 0)
       
  1363 +				blueflame_enabled = 0;
       
  1364  		} else
       
  1365  			fprintf(stderr, PFX "Warning: ignoring bad config directive "
       
  1366  				"'%s' in file '%s'.\n", field, path);
       
  1367 @@ -367,6 +397,7 @@
       
  1368  	strcpy(dev->dev_path,   sysfs_dev->sysfs_path);
       
  1369  	strcpy(dev->name,       sysfs_dev->ibdev_name);
       
  1370  	strcpy(dev->ibdev_path, sysfs_dev->ibdev_path);
       
  1371 +	dev->blueflame_enabled = blueflame_enabled;
       
  1372  
       
  1373  	return dev;
       
  1374  }
       
  1375 @@ -409,6 +440,7 @@
  1347  
  1376  
  1348  static void check_memlock_limit(void)
  1377  static void check_memlock_limit(void)
  1349  {
  1378  {
  1350 +#if !(defined(__SVR4) && defined(__sun))
  1379 +#if !(defined(__SVR4) && defined(__sun))
  1351  	struct rlimit rlim;
  1380  	struct rlimit rlim;
  1352  
  1381  
  1353  	if (!geteuid())
  1382  	if (!geteuid())
  1354 @@ -423,6 +445,7 @@
  1383 @@ -423,6 +455,7 @@
  1355  		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
  1384  		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
  1356  			"    This will severely limit memory registrations.\n",
  1385  			"    This will severely limit memory registrations.\n",
  1357  			rlim.rlim_cur);
  1386  			rlim.rlim_cur);
  1358 +#endif
  1387 +#endif
  1359  }
  1388  }
  1934 +#endif
  1963 +#endif
  1935 +
  1964 +
  1936  struct ibv_qp_init_attr {
  1965  struct ibv_qp_init_attr {
  1937  	void		       *qp_context;
  1966  	void		       *qp_context;
  1938  	struct ibv_cq	       *send_cq;
  1967  	struct ibv_cq	       *send_cq;
  1939 @@ -743,6 +774,12 @@
  1968 @@ -659,6 +690,7 @@
       
  1969  	char			dev_path[IBV_SYSFS_PATH_MAX];
       
  1970  	/* Path to infiniband class device in sysfs */
       
  1971  	char			ibdev_path[IBV_SYSFS_PATH_MAX];
       
  1972 +	uint                    blueflame_enabled;
       
  1973  };
       
  1974  
       
  1975  struct ibv_more_ops {
       
  1976 @@ -743,6 +775,12 @@
  1940  	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
  1977  	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
  1941  						uint16_t lid);
  1978  						uint16_t lid);
  1942  	void			(*async_event)(struct ibv_async_event *event);
  1979  	void			(*async_event)(struct ibv_async_event *event);
  1943 +	struct ibv_mr *		(*reg_mr_relaxed)(struct ibv_pd *pd, void *addr, size_t length,
  1980 +	struct ibv_mr *		(*reg_mr_relaxed)(struct ibv_pd *pd, void *addr, size_t length,
  1944 +					  int access);
  1981 +					  int access);
  1947 +	struct ibv_shpd *	(*alloc_shpd)(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd);
  1984 +	struct ibv_shpd *	(*alloc_shpd)(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd);
  1948 +	struct ibv_pd *		(*share_pd)(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key);
  1985 +	struct ibv_pd *		(*share_pd)(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key);
  1949  };
  1986  };
  1950  
  1987  
  1951  struct ibv_context {
  1988  struct ibv_context {
  1952 @@ -749,6 +786,13 @@
  1989 @@ -749,6 +787,13 @@
  1953  	struct ibv_device      *device;
  1990  	struct ibv_device      *device;
  1954  	struct ibv_context_ops	ops;
  1991  	struct ibv_context_ops	ops;
  1955  	int			cmd_fd;
  1992  	int			cmd_fd;
  1956 +#if defined(__SVR4) && defined(__sun)
  1993 +#if defined(__SVR4) && defined(__sun)
  1957 +	/*
  1994 +	/*
  1961 +	int			mmap_fd;
  1998 +	int			mmap_fd;
  1962 +#endif
  1999 +#endif
  1963  	int			async_fd;
  2000  	int			async_fd;
  1964  	int			num_comp_vectors;
  2001  	int			num_comp_vectors;
  1965  	pthread_mutex_t		mutex;
  2002  	pthread_mutex_t		mutex;
  1966 @@ -797,6 +841,11 @@
  2003 @@ -797,6 +842,11 @@
  1967  uint64_t ibv_get_device_guid(struct ibv_device *device);
  2004  uint64_t ibv_get_device_guid(struct ibv_device *device);
  1968  
  2005  
  1969  /**
  2006  /**
  1970 + * ibv_get_device_guid_external - Return device's node external GUID
  2007 + * ibv_get_device_guid_external - Return device's node external GUID
  1971 + */
  2008 + */
  1973 +
  2010 +
  1974 +/**
  2011 +/**
  1975   * ibv_open_device - Initialize device for use
  2012   * ibv_open_device - Initialize device for use
  1976   */
  2013   */
  1977  struct ibv_context *ibv_open_device(struct ibv_device *device);
  2014  struct ibv_context *ibv_open_device(struct ibv_device *device);
  1978 @@ -853,11 +902,44 @@
  2015 @@ -853,11 +903,44 @@
  1979  		   int index, uint16_t *pkey);
  2016  		   int index, uint16_t *pkey);
  1980  
  2017  
  1981  /**
  2018  /**
  1982 + * ibv_register_sm_events - Register subnet event for GID change
  2019 + * ibv_register_sm_events - Register subnet event for GID change
  1983 + */
  2020 + */
  2018 +
  2055 +
  2019 +/**
  2056 +/**
  2020   * ibv_dealloc_pd - Free a protection domain
  2057   * ibv_dealloc_pd - Free a protection domain
  2021   */
  2058   */
  2022  int ibv_dealloc_pd(struct ibv_pd *pd);
  2059  int ibv_dealloc_pd(struct ibv_pd *pd);
  2023 @@ -869,11 +951,27 @@
  2060 @@ -869,11 +952,27 @@
  2024  			  size_t length, int access);
  2061  			  size_t length, int access);
  2025  
  2062  
  2026  /**
  2063  /**
  2027 + * ibv_reg_mr_relaxed - Register a memory region using FMR
  2064 + * ibv_reg_mr_relaxed - Register a memory region using FMR
  2028 + */
  2065 + */