1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37#ifndef __LNET_ST_H__
38#define __LNET_ST_H__
39
40#include <linux/types.h>
41
42#define LST_FEAT_NONE (0)
43#define LST_FEAT_BULK_LEN (1 << 0)
44
45#define LST_FEATS_EMPTY (LST_FEAT_NONE)
46#define LST_FEATS_MASK (LST_FEAT_NONE | LST_FEAT_BULK_LEN)
47
48#define LST_NAME_SIZE 32
49
50#define LSTIO_DEBUG 0xC00
51#define LSTIO_SESSION_NEW 0xC01
52#define LSTIO_SESSION_END 0xC02
53#define LSTIO_SESSION_INFO 0xC03
54#define LSTIO_GROUP_ADD 0xC10
55#define LSTIO_GROUP_LIST 0xC11
56#define LSTIO_GROUP_INFO 0xC12
57
58#define LSTIO_GROUP_DEL 0xC13
59#define LSTIO_NODES_ADD 0xC14
60#define LSTIO_GROUP_UPDATE 0xC15
61#define LSTIO_BATCH_ADD 0xC20
62#define LSTIO_BATCH_START 0xC21
63#define LSTIO_BATCH_STOP 0xC22
64#define LSTIO_BATCH_DEL 0xC23
65#define LSTIO_BATCH_LIST 0xC24
66#define LSTIO_BATCH_INFO 0xC25
67#define LSTIO_TEST_ADD 0xC26
68#define LSTIO_BATCH_QUERY 0xC27
69#define LSTIO_STAT_QUERY 0xC30
70
71typedef struct {
72 lnet_nid_t ses_nid;
73 __u64 ses_stamp;
74} lst_sid_t;
75
76extern lst_sid_t LST_INVALID_SID;
77
78typedef struct {
79 __u64 bat_id;
80} lst_bid_t;
81
82
83#define LST_NODE_ACTIVE 0x1
84#define LST_NODE_BUSY 0x2
85#define LST_NODE_DOWN 0x4
86#define LST_NODE_UNKNOWN 0x8
87
88typedef struct {
89 lnet_process_id_t nde_id;
90 int nde_state;
91} lstcon_node_ent_t;
92
93typedef struct {
94 int nle_nnode;
95 int nle_nactive;
96 int nle_nbusy;
97 int nle_ndown;
98 int nle_nunknown;
99} lstcon_ndlist_ent_t;
100
101typedef struct {
102 int tse_type;
103 int tse_loop;
104 int tse_concur;
105} lstcon_test_ent_t;
106
107
108typedef struct {
109 int bae_state;
110 int bae_timeout;
111 int bae_ntest;
112} lstcon_batch_ent_t;
113
114
115typedef struct {
116 lstcon_ndlist_ent_t tbe_cli_nle;
117
118 lstcon_ndlist_ent_t tbe_srv_nle;
119
120 union {
121 lstcon_test_ent_t tbe_test;
122 lstcon_batch_ent_t tbe_batch;
123 } u;
124} lstcon_test_batch_ent_t;
125
126
127typedef struct {
128 struct list_head rpe_link;
129 lnet_process_id_t rpe_peer;
130 struct timeval rpe_stamp;
131 int rpe_state;
132 int rpe_rpc_errno;
133
134 lst_sid_t rpe_sid;
135 int rpe_fwk_errno;
136 int rpe_priv[4];
137 char rpe_payload[0];
138} lstcon_rpc_ent_t;
139
140typedef struct {
141 int trs_rpc_stat[4];
142
143
144
145 int trs_rpc_errno;
146 int trs_fwk_stat[8];
147 int trs_fwk_errno;
148 void *trs_fwk_private;
149} lstcon_trans_stat_t;
150
151static inline int
152lstcon_rpc_stat_total(lstcon_trans_stat_t *stat, int inc)
153{
154 return inc ? ++stat->trs_rpc_stat[0] : stat->trs_rpc_stat[0];
155}
156
157static inline int
158lstcon_rpc_stat_success(lstcon_trans_stat_t *stat, int inc)
159{
160 return inc ? ++stat->trs_rpc_stat[1] : stat->trs_rpc_stat[1];
161}
162
163static inline int
164lstcon_rpc_stat_failure(lstcon_trans_stat_t *stat, int inc)
165{
166 return inc ? ++stat->trs_rpc_stat[2] : stat->trs_rpc_stat[2];
167}
168
169static inline int
170lstcon_sesop_stat_success(lstcon_trans_stat_t *stat, int inc)
171{
172 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
173}
174
175static inline int
176lstcon_sesop_stat_failure(lstcon_trans_stat_t *stat, int inc)
177{
178 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
179}
180
181static inline int
182lstcon_sesqry_stat_active(lstcon_trans_stat_t *stat, int inc)
183{
184 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
185}
186
187static inline int
188lstcon_sesqry_stat_busy(lstcon_trans_stat_t *stat, int inc)
189{
190 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
191}
192
193static inline int
194lstcon_sesqry_stat_unknown(lstcon_trans_stat_t *stat, int inc)
195{
196 return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
197}
198
199static inline int
200lstcon_tsbop_stat_success(lstcon_trans_stat_t *stat, int inc)
201{
202 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
203}
204
205static inline int
206lstcon_tsbop_stat_failure(lstcon_trans_stat_t *stat, int inc)
207{
208 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
209}
210
211static inline int
212lstcon_tsbqry_stat_idle(lstcon_trans_stat_t *stat, int inc)
213{
214 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
215}
216
217static inline int
218lstcon_tsbqry_stat_run(lstcon_trans_stat_t *stat, int inc)
219{
220 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
221}
222
223static inline int
224lstcon_tsbqry_stat_failure(lstcon_trans_stat_t *stat, int inc)
225{
226 return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
227}
228
229static inline int
230lstcon_statqry_stat_success(lstcon_trans_stat_t *stat, int inc)
231{
232 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
233}
234
235static inline int
236lstcon_statqry_stat_failure(lstcon_trans_stat_t *stat, int inc)
237{
238 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
239}
240
241
242typedef struct {
243 int lstio_ses_key;
244 int lstio_ses_timeout;
245 int lstio_ses_force;
246
247 unsigned lstio_ses_feats;
248 lst_sid_t __user *lstio_ses_idp;
249 int lstio_ses_nmlen;
250 char __user *lstio_ses_namep;
251} lstio_session_new_args_t;
252
253
254typedef struct {
255 lst_sid_t __user *lstio_ses_idp;
256 int __user *lstio_ses_keyp;
257
258 unsigned __user *lstio_ses_featp;
259 lstcon_ndlist_ent_t __user *lstio_ses_ndinfo;
260 int lstio_ses_nmlen;
261 char __user *lstio_ses_namep;
262} lstio_session_info_args_t;
263
264
265typedef struct {
266 int lstio_ses_key;
267} lstio_session_end_args_t;
268
269#define LST_OPC_SESSION 1
270#define LST_OPC_GROUP 2
271#define LST_OPC_NODES 3
272#define LST_OPC_BATCHCLI 4
273#define LST_OPC_BATCHSRV 5
274
275typedef struct {
276 int lstio_dbg_key;
277 int lstio_dbg_type;
278
279
280
281 int lstio_dbg_flags;
282
283 int lstio_dbg_timeout;
284
285 int lstio_dbg_nmlen;
286 char __user *lstio_dbg_namep;
287
288 int lstio_dbg_count;
289
290 lnet_process_id_t __user *lstio_dbg_idsp;
291
292 struct list_head __user *lstio_dbg_resultp;
293
294} lstio_debug_args_t;
295
296typedef struct {
297 int lstio_grp_key;
298 int lstio_grp_nmlen;
299 char __user *lstio_grp_namep;
300} lstio_group_add_args_t;
301
302typedef struct {
303 int lstio_grp_key;
304 int lstio_grp_nmlen;
305 char __user *lstio_grp_namep;
306} lstio_group_del_args_t;
307
308#define LST_GROUP_CLEAN 1
309#define LST_GROUP_REFRESH 2
310
311#define LST_GROUP_RMND 3
312
313typedef struct {
314 int lstio_grp_key;
315 int lstio_grp_opc;
316 int lstio_grp_args;
317 int lstio_grp_nmlen;
318 char __user *lstio_grp_namep;
319 int lstio_grp_count;
320 lnet_process_id_t __user *lstio_grp_idsp;
321 struct list_head __user *lstio_grp_resultp;
322
323} lstio_group_update_args_t;
324
325typedef struct {
326 int lstio_grp_key;
327 int lstio_grp_nmlen;
328 char __user *lstio_grp_namep;
329 int lstio_grp_count;
330
331 unsigned __user *lstio_grp_featp;
332 lnet_process_id_t __user *lstio_grp_idsp;
333 struct list_head __user *lstio_grp_resultp;
334
335} lstio_group_nodes_args_t;
336
337typedef struct {
338 int lstio_grp_key;
339 int lstio_grp_idx;
340 int lstio_grp_nmlen;
341 char __user *lstio_grp_namep;
342} lstio_group_list_args_t;
343
344typedef struct {
345 int lstio_grp_key;
346 int lstio_grp_nmlen;
347 char __user *lstio_grp_namep;
348 lstcon_ndlist_ent_t __user *lstio_grp_entp;
349
350 int __user *lstio_grp_idxp;
351 int __user *lstio_grp_ndentp;
352 lstcon_node_ent_t __user *lstio_grp_dentsp;
353} lstio_group_info_args_t;
354
355#define LST_DEFAULT_BATCH "batch"
356
357typedef struct {
358 int lstio_bat_key;
359 int lstio_bat_nmlen;
360 char __user *lstio_bat_namep;
361} lstio_batch_add_args_t;
362
363typedef struct {
364 int lstio_bat_key;
365 int lstio_bat_nmlen;
366 char __user *lstio_bat_namep;
367} lstio_batch_del_args_t;
368
369typedef struct {
370 int lstio_bat_key;
371 int lstio_bat_timeout;
372
373 int lstio_bat_nmlen;
374 char __user *lstio_bat_namep;
375 struct list_head __user *lstio_bat_resultp;
376
377} lstio_batch_run_args_t;
378
379typedef struct {
380 int lstio_bat_key;
381 int lstio_bat_force;
382
383 int lstio_bat_nmlen;
384 char __user *lstio_bat_namep;
385 struct list_head __user *lstio_bat_resultp;
386
387} lstio_batch_stop_args_t;
388
389typedef struct {
390 int lstio_bat_key;
391 int lstio_bat_testidx;
392 int lstio_bat_client;
393
394 int lstio_bat_timeout;
395
396 int lstio_bat_nmlen;
397 char __user *lstio_bat_namep;
398 struct list_head __user *lstio_bat_resultp;
399
400} lstio_batch_query_args_t;
401
402typedef struct {
403 int lstio_bat_key;
404 int lstio_bat_idx;
405 int lstio_bat_nmlen;
406 char __user *lstio_bat_namep;
407} lstio_batch_list_args_t;
408
409typedef struct {
410 int lstio_bat_key;
411 int lstio_bat_nmlen;
412 char __user *lstio_bat_namep;
413 int lstio_bat_server;
414
415 int lstio_bat_testidx;
416 lstcon_test_batch_ent_t __user *lstio_bat_entp;
417
418 int __user *lstio_bat_idxp;
419 int __user *lstio_bat_ndentp;
420 lstcon_node_ent_t __user *lstio_bat_dentsp;
421} lstio_batch_info_args_t;
422
423
424typedef struct {
425 int lstio_sta_key;
426 int lstio_sta_timeout;
427
428 int lstio_sta_nmlen;
429
430 char __user *lstio_sta_namep;
431 int lstio_sta_count;
432 lnet_process_id_t __user *lstio_sta_idsp;
433 struct list_head __user *lstio_sta_resultp;
434
435} lstio_stat_args_t;
436
437typedef enum {
438 LST_TEST_BULK = 1,
439 LST_TEST_PING = 2
440} lst_test_type_t;
441
442
443#define LST_MAX_CONCUR 1024
444
445typedef struct {
446 int lstio_tes_key;
447 int lstio_tes_bat_nmlen;
448 char __user *lstio_tes_bat_name;
449 int lstio_tes_type;
450 int lstio_tes_oneside;
451 int lstio_tes_loop;
452 int lstio_tes_concur;
453
454 int lstio_tes_dist;
455
456 int lstio_tes_span;
457
458 int lstio_tes_sgrp_nmlen;
459
460 char __user *lstio_tes_sgrp_name;
461 int lstio_tes_dgrp_nmlen;
462
463 char __user *lstio_tes_dgrp_name;
464
465 int lstio_tes_param_len;
466 void __user *lstio_tes_param;
467
468
469
470
471 int __user *lstio_tes_retp;
472
473 struct list_head __user *lstio_tes_resultp;
474
475} lstio_test_args_t;
476
477typedef enum {
478 LST_BRW_READ = 1,
479 LST_BRW_WRITE = 2
480} lst_brw_type_t;
481
482typedef enum {
483 LST_BRW_CHECK_NONE = 1,
484 LST_BRW_CHECK_SIMPLE = 2,
485 LST_BRW_CHECK_FULL = 3
486} lst_brw_flags_t;
487
488typedef struct {
489 int blk_opc;
490 int blk_size;
491 int blk_time;
492 int blk_flags;
493} lst_test_bulk_param_t;
494
495typedef struct {
496 int png_size;
497 int png_time;
498 int png_loop;
499 int png_flags;
500} lst_test_ping_param_t;
501
502typedef struct {
503 __u32 errors;
504 __u32 rpcs_sent;
505 __u32 rpcs_rcvd;
506 __u32 rpcs_dropped;
507 __u32 rpcs_expired;
508 __u64 bulk_get;
509 __u64 bulk_put;
510} WIRE_ATTR srpc_counters_t;
511
512typedef struct {
513
514 __u32 running_ms;
515 __u32 active_batches;
516 __u32 zombie_sessions;
517 __u32 brw_errors;
518 __u32 ping_errors;
519} WIRE_ATTR sfw_counters_t;
520
521#endif
522