Whamcloud - gitweb
Use the newer libsysio tags.
[fs/lustre-release.git] / lustre / portals / tests / ping.h
1 #ifndef _KPING_INCLUDED
2 #define _KPING_INCLUDED
3
4 #include <portals/p30.h>
5
6
7 #define PTL_PING_IN_SIZE                256     // n packets per buffer
8 #define PTL_PING_IN_BUFFERS             2       // n fallback buffers
9
10 #define PTL_PING_CLIENT                 4
11 #define PTL_PING_SERVER                 5
12
13 #define PING_HEADER_MAGIC               0xDEADBEEF
14 #define PING_BULK_MAGIC                 0xCAFEBABE
15
16 #define PING_HEAD_BITS                  0x00000001
17 #define PING_BULK_BITS                  0x00000002
18 #define PING_IGNORE_BITS                0xFFFFFFFC
19
20 #define PTL_PING_ACK                    0x01
21 #define PTL_PING_VERBOSE                0x02
22 #define PTL_PING_VERIFY                 0x04
23 #define PTL_PING_PREALLOC               0x08
24
25
26 #define NEXT_PRIMARY_BUFFER(index)              \
27         (((index + 1) >= PTL_PING_IN_BUFFERS) ? 0 : (index + 1))
28
29 #define PDEBUG(str, err)                        \
30         CERROR ("%s: error=%s (%d)\n", str, ptl_err_str[err], err)
31
32
33 /* Ping data to be passed via the ioctl to kernel space */
34
35 #if __KERNEL__
36
37
38 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
39 #include <linux/workqueue.h>
40 #else
41 #include <linux/tqueue.h>
42 #endif
43 struct pingsrv_data {
44         
45         ptl_handle_ni_t         ni;
46         ptl_handle_me_t         me;
47         ptl_handle_eq_t         eq;
48         void                   *in_buf;
49         ptl_process_id_t        my_id;
50         ptl_process_id_t        id_local;
51         ptl_md_t                mdin;
52         ptl_md_t                mdout;
53         ptl_handle_md_t         mdin_h;
54         ptl_handle_md_t         mdout_h;
55         ptl_event_t             evnt;
56         struct task_struct     *tsk;
57 }; /* struct pingsrv_data */
58  
59 struct pingcli_data {
60         
61         struct portal_ioctl_data *args;
62         ptl_handle_me_t         me;
63         ptl_handle_eq_t         eq;
64         char                   *inbuf;    
65         char                   *outbuf;   
66         ptl_process_id_t        myid; 
67         ptl_process_id_t        id_local; 
68         ptl_process_id_t        id_remote;
69         ptl_md_t                md_in_head;
70         ptl_md_t                md_out_head;
71         ptl_handle_md_t         md_in_head_h;
72         ptl_handle_md_t         md_out_head_h;
73         ptl_event_t             ev;
74         struct task_struct     *tsk;
75 }; /* struct pingcli_data */
76
77
78 #endif /* __KERNEL__ */
79
80 #endif /* _KPING_INCLUDED */