X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Finclude%2Flnet%2Ftypes.h;h=f07534baa286bfee83191352970dbab8c9a32c45;hp=7ffe797b1a4119fcc8814e1cf69f37fb66847f6c;hb=a487457bb00b5a862d0f51071b6c8da7aae99390;hpb=e0576be940d7af30b2ba6e219891a4413670325d diff --git a/lnet/include/lnet/types.h b/lnet/include/lnet/types.h index 7ffe797..f07534b 100644 --- a/lnet/include/lnet/types.h +++ b/lnet/include/lnet/types.h @@ -1,25 +1,20 @@ #ifndef _P30_TYPES_H_ #define _P30_TYPES_H_ -#ifdef __linux__ -# include -# include -#else -# include -typedef u_int32_t __u32; -typedef u_int64_t __u64; -#endif - -#ifdef __KERNEL__ -# include -#else -# include -# define do_gettimeofday(tv) gettimeofday(tv, NULL) -#endif +#include "build_check.h" +#include #include +/* This implementation uses the same type for API function return codes and + * the completion status in an event */ +#define PTL_NI_OK PTL_OK +typedef ptl_err_t ptl_ni_fail_t; + +typedef __u32 ptl_uid_t; +typedef __u32 ptl_jid_t; typedef __u64 ptl_nid_t; +typedef __u32 ptl_netid_t; typedef __u32 ptl_pid_t; typedef __u32 ptl_pt_index_t; typedef __u32 ptl_ac_index_t; @@ -27,6 +22,8 @@ typedef __u64 ptl_match_bits_t; typedef __u64 ptl_hdr_data_t; typedef __u32 ptl_size_t; +#define PTL_TIME_FOREVER (-1) + typedef struct { unsigned long nal_idx; /* which network interface */ __u64 cookie; /* which thing on that interface */ @@ -37,15 +34,17 @@ typedef ptl_handle_any_t ptl_handle_eq_t; typedef ptl_handle_any_t ptl_handle_md_t; typedef ptl_handle_any_t ptl_handle_me_t; -#define PTL_HANDLE_NONE \ +#define PTL_INVALID_HANDLE \ ((const ptl_handle_any_t){.nal_idx = -1, .cookie = -1}) -#define PTL_EQ_NONE PTL_HANDLE_NONE +#define PTL_EQ_NONE PTL_INVALID_HANDLE -static inline int PtlHandleEqual (ptl_handle_any_t h1, ptl_handle_any_t h2) +static inline int PtlHandleIsEqual (ptl_handle_any_t h1, ptl_handle_any_t h2) { return (h1.nal_idx == h2.nal_idx && h1.cookie == h2.cookie); } +#define PTL_UID_ANY ((ptl_uid_t) -1) +#define PTL_JID_ANY ((ptl_jid_t) -1) #define PTL_NID_ANY ((ptl_nid_t) -1) #define PTL_PID_ANY ((ptl_pid_t) -1) @@ -65,41 +64,58 @@ typedef enum { } ptl_ins_pos_t; typedef struct { - struct page *kiov_page; - unsigned int kiov_len; - unsigned int kiov_offset; -} ptl_kiov_t; - -typedef struct { void *start; ptl_size_t length; int threshold; int max_size; unsigned int options; void *user_ptr; - ptl_handle_eq_t eventq; - unsigned int niov; + ptl_handle_eq_t eq_handle; } ptl_md_t; /* Options for the MD structure */ -#define PTL_MD_OP_PUT (1 << 0) -#define PTL_MD_OP_GET (1 << 1) -#define PTL_MD_MANAGE_REMOTE (1 << 2) -#define PTL_MD_AUTO_UNLINK (1 << 3) -#define PTL_MD_TRUNCATE (1 << 4) -#define PTL_MD_ACK_DISABLE (1 << 5) -#define PTL_MD_IOV (1 << 6) -#define PTL_MD_MAX_SIZE (1 << 7) -#define PTL_MD_KIOV (1 << 8) +#define PTL_MD_OP_PUT (1 << 0) +#define PTL_MD_OP_GET (1 << 1) +#define PTL_MD_MANAGE_REMOTE (1 << 2) +/* unused (1 << 3) */ +#define PTL_MD_TRUNCATE (1 << 4) +#define PTL_MD_ACK_DISABLE (1 << 5) +#define PTL_MD_IOVEC (1 << 6) +#define PTL_MD_MAX_SIZE (1 << 7) +#define PTL_MD_KIOV (1 << 8) +#define PTL_MD_EVENT_START_DISABLE (1 << 9) +#define PTL_MD_EVENT_END_DISABLE (1 << 10) + +/* For compatibility with Cray Portals */ +#define PTL_MD_LUSTRE_COMPLETION_SEMANTICS 0 +#define PTL_MD_PHYS 0 #define PTL_MD_THRESH_INF (-1) +/* NB lustre portals uses struct iovec internally! */ +typedef struct iovec ptl_md_iovec_t; + +typedef struct { + cfs_page_t *kiov_page; + unsigned int kiov_len; + unsigned int kiov_offset; +} ptl_kiov_t; + typedef enum { - PTL_EVENT_GET, - PTL_EVENT_PUT, - PTL_EVENT_REPLY, + PTL_EVENT_GET_START, + PTL_EVENT_GET_END, + + PTL_EVENT_PUT_START, + PTL_EVENT_PUT_END, + + PTL_EVENT_REPLY_START, + PTL_EVENT_REPLY_END, + PTL_EVENT_ACK, - PTL_EVENT_SENT, + + PTL_EVENT_SEND_START, + PTL_EVENT_SEND_END, + PTL_EVENT_UNLINK, } ptl_event_kind_t; @@ -116,17 +132,21 @@ typedef unsigned PTL_SEQ_BASETYPE ptl_seq_t; #endif typedef struct { ptl_event_kind_t type; - ptl_err_t status; - int unlinked; ptl_process_id_t initiator; - ptl_pt_index_t portal; + ptl_uid_t uid; + ptl_jid_t jid; + ptl_pt_index_t pt_index; ptl_match_bits_t match_bits; ptl_size_t rlength; - ptl_size_t mlength; - ptl_size_t offset; - ptl_md_t mem_desc; + ptl_size_t mlength; + ptl_size_t offset; + ptl_handle_md_t md_handle; + ptl_md_t md; ptl_hdr_data_t hdr_data; - struct timeval arrival_time; + ptl_seq_t link; + ptl_ni_fail_t ni_fail_type; + + int unlinked; volatile ptl_seq_t sequence; } ptl_event_t; @@ -139,23 +159,18 @@ typedef enum { PTL_NOACK_REQ } ptl_ack_req_t; -typedef struct { - volatile ptl_seq_t sequence; - ptl_size_t size; - ptl_event_t *base; - ptl_handle_any_t cb_eq_handle; -} ptl_eq_t; - -typedef struct { - ptl_eq_t *eq; -} ptl_ni_t; +typedef void (*ptl_eq_handler_t)(ptl_event_t *event); +#define PTL_EQ_HANDLER_NONE NULL typedef struct { - int max_match_entries; /* max number of match entries */ - int max_mem_descriptors; /* max number of memory descriptors */ - int max_event_queues; /* max number of event queues */ - int max_atable_index; /* maximum access control list table index */ - int max_ptable_index; /* maximum portals table index */ + int max_mes; + int max_mds; + int max_eqs; + int max_ac_index; + int max_pt_index; + int max_md_iovecs; + int max_me_list; + int max_getput_md; } ptl_ni_limits_t; /* @@ -173,4 +188,7 @@ typedef enum { typedef int ptl_sr_value_t; +typedef int ptl_interface_t; +#define PTL_IFACE_DEFAULT (-1) + #endif