#ifndef _LIB_TYPES_H_
#define _LIB_TYPES_H_
+#include "build_check.h"
+
#include <portals/types.h>
#ifdef __KERNEL__
# include <linux/uio.h>
} lib_counters_t;
/* temporary expedient: limit number of entries in discontiguous MDs */
-# define PTL_MTU (512<<10)
-# define PTL_MD_MAX_IOV 128
-# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE)
+#define PTL_MTU (512<<10)
+#define PTL_MD_MAX_IOV 128
struct lib_msg_t {
struct list_head msg_list;
ptl_size_t size;
ptl_event_t *base;
int eq_refcount;
- int (*event_callback) (ptl_event_t * event);
+ ptl_eq_handler_t event_callback;
void *eq_addrkey;
};
ptl_size_t max_size;
int threshold;
int pending;
- ptl_unlink_t unlink;
unsigned int options;
unsigned int md_flags;
void *user_ptr;
} md_iov;
};
-#define PTL_MD_FLAG_UNLINK (1 << 0)
+#define PTL_MD_FLAG_ZOMBIE (1 << 0)
+#define PTL_MD_FLAG_AUTO_UNLINK (1 << 1)
+
+static inline int lib_md_exhausted (lib_md_t *md)
+{
+ return (md->threshold == 0 ||
+ ((md->options & PTL_MD_MAX_SIZE) != 0 &&
+ md->offset + md->max_size > md->length));
+}
#ifdef PTL_USE_LIB_FREELIST
typedef struct
* extracted by masking with (PTL_COOKIE_TYPES - 1) */
typedef struct {
- int up;
- int refcnt;
ptl_nid_t nid;
ptl_pid_t pid;
- int num_nodes;
- unsigned int debug;
lib_ptl_t tbl;
- lib_ac_t ac;
lib_counters_t counters;
+ ptl_ni_limits_t actual_limits;
int ni_lh_hash_size; /* size of lib handle hash table */
struct list_head *ni_lh_hash_table; /* all extant lib handles, this interface */