1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lnet/include/lnet/lnetst.h
38 * Author: Liang Zhen <liangzhen@clusterfs.com>
44 #include <libcfs/libcfs.h>
45 #include <lnet/lnet.h>
46 #include <lnet/lib-types.h>
48 #define LST_NAME_SIZE 32 /* max name buffer length */
50 #define LSTIO_DEBUG 0xC00 /* debug */
51 #define LSTIO_SESSION_NEW 0xC01 /* create session */
52 #define LSTIO_SESSION_END 0xC02 /* end session */
53 #define LSTIO_SESSION_INFO 0xC03 /* query session */
54 #define LSTIO_GROUP_ADD 0xC10 /* add group */
55 #define LSTIO_GROUP_LIST 0xC11 /* list all groups in session */
56 #define LSTIO_GROUP_INFO 0xC12 /* query defailt infomation of specified group */
57 #define LSTIO_GROUP_DEL 0xC13 /* delete group */
58 #define LSTIO_NODES_ADD 0xC14 /* add nodes to specified group */
59 #define LSTIO_GROUP_UPDATE 0xC15 /* update group */
60 #define LSTIO_BATCH_ADD 0xC20 /* add batch */
61 #define LSTIO_BATCH_START 0xC21 /* start batch */
62 #define LSTIO_BATCH_STOP 0xC22 /* stop batch */
63 #define LSTIO_BATCH_DEL 0xC23 /* delete batch */
64 #define LSTIO_BATCH_LIST 0xC24 /* show all batches in the session */
65 #define LSTIO_BATCH_INFO 0xC25 /* show defail of specified batch */
66 #define LSTIO_TEST_ADD 0xC26 /* add test (to batch) */
67 #define LSTIO_BATCH_QUERY 0xC27 /* query batch status */
68 #define LSTIO_STAT_QUERY 0xC30 /* get stats */
71 lnet_nid_t ses_nid; /* nid of console node */
72 __u64 ses_stamp; /* time stamp */
73 } lst_sid_t; /*** session id */
75 extern lst_sid_t LST_INVALID_SID;
78 __u64 bat_id; /* unique id in session */
79 } lst_bid_t; /*** batch id (group of tests) */
81 /* Status of test node */
82 #define LST_NODE_ACTIVE 0x1 /* node in this session */
83 #define LST_NODE_BUSY 0x2 /* node is taken by other session */
84 #define LST_NODE_DOWN 0x4 /* node is down */
85 #define LST_NODE_UNKNOWN 0x8 /* node not in session */
88 lnet_process_id_t nde_id; /* id of node */
89 int nde_state; /* state of node */
90 } lstcon_node_ent_t; /*** node entry, for list_group command */
93 int nle_nnode; /* # of nodes */
94 int nle_nactive; /* # of active nodes */
95 int nle_nbusy; /* # of busy nodes */
96 int nle_ndown; /* # of down nodes */
97 int nle_nunknown; /* # of unknown nodes */
98 } lstcon_ndlist_ent_t; /*** node_list entry, for list_batch command */
101 int tse_type; /* test type */
102 int tse_loop; /* loop count */
103 int tse_concur; /* concurrency of test */
104 } lstcon_test_ent_t; /*** test summary entry, for list_batch command */
107 int bae_state; /* batch status */
108 int bae_timeout; /* batch timeout */
109 int bae_ntest; /* # of tests in the batch */
110 } lstcon_batch_ent_t; /*** batch summary entry, for list_batch command */
113 lstcon_ndlist_ent_t tbe_cli_nle; /* client (group) node_list entry */
114 lstcon_ndlist_ent_t tbe_srv_nle; /* server (group) node_list entry */
116 lstcon_test_ent_t tbe_test; /* test entry */
117 lstcon_batch_ent_t tbe_batch; /* batch entry */
119 } lstcon_test_batch_ent_t; /*** test/batch verbose information entry,
120 *** for list_batch command */
123 struct list_head rpe_link; /* link chain */
124 lnet_process_id_t rpe_peer; /* peer's id */
125 struct timeval rpe_stamp; /* time stamp of RPC */
126 int rpe_state; /* peer's state */
127 int rpe_rpc_errno; /* RPC errno */
129 lst_sid_t rpe_sid; /* peer's session id */
130 int rpe_fwk_errno; /* framework errno */
131 int rpe_priv[4]; /* private data */
132 char rpe_payload[0]; /* private reply payload */
136 int trs_rpc_stat[4]; /* RPCs stat (0: total, 1: failed, 2: finished, 4: reserved */
137 int trs_rpc_errno; /* RPC errno */
138 int trs_fwk_stat[8]; /* framework stat */
139 int trs_fwk_errno; /* errno of the first remote error */
140 void *trs_fwk_private; /* private framework stat */
141 } lstcon_trans_stat_t;
144 lstcon_rpc_stat_total(lstcon_trans_stat_t *stat, int inc)
146 return inc ? ++stat->trs_rpc_stat[0] : stat->trs_rpc_stat[0];
150 lstcon_rpc_stat_success(lstcon_trans_stat_t *stat, int inc)
152 return inc ? ++stat->trs_rpc_stat[1] : stat->trs_rpc_stat[1];
156 lstcon_rpc_stat_failure(lstcon_trans_stat_t *stat, int inc)
158 return inc ? ++stat->trs_rpc_stat[2] : stat->trs_rpc_stat[2];
162 lstcon_sesop_stat_success(lstcon_trans_stat_t *stat, int inc)
164 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
168 lstcon_sesop_stat_failure(lstcon_trans_stat_t *stat, int inc)
170 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
174 lstcon_sesqry_stat_active(lstcon_trans_stat_t *stat, int inc)
176 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
180 lstcon_sesqry_stat_busy(lstcon_trans_stat_t *stat, int inc)
182 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
186 lstcon_sesqry_stat_unknown(lstcon_trans_stat_t *stat, int inc)
188 return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
192 lstcon_tsbop_stat_success(lstcon_trans_stat_t *stat, int inc)
194 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
198 lstcon_tsbop_stat_failure(lstcon_trans_stat_t *stat, int inc)
200 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
204 lstcon_tsbqry_stat_idle(lstcon_trans_stat_t *stat, int inc)
206 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
210 lstcon_tsbqry_stat_run(lstcon_trans_stat_t *stat, int inc)
212 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
216 lstcon_tsbqry_stat_failure(lstcon_trans_stat_t *stat, int inc)
218 return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
222 lstcon_statqry_stat_success(lstcon_trans_stat_t *stat, int inc)
224 return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
228 lstcon_statqry_stat_failure(lstcon_trans_stat_t *stat, int inc)
230 return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
233 /* create a session */
235 int lstio_ses_key; /* IN: local key */
236 int lstio_ses_timeout; /* IN: session timeout */
237 int lstio_ses_force; /* IN: force create ? */
238 lst_sid_t *lstio_ses_idp; /* OUT: session id */
239 int lstio_ses_nmlen; /* IN: name length */
240 char *lstio_ses_namep; /* IN: session name */
241 } lstio_session_new_args_t;
243 /* query current session */
245 lst_sid_t *lstio_ses_idp; /* OUT: session id */
246 int *lstio_ses_keyp; /* OUT: local key */
247 lstcon_ndlist_ent_t *lstio_ses_ndinfo; /* OUT: */
248 int lstio_ses_nmlen; /* IN: name length */
249 char *lstio_ses_namep; /* OUT: session name */
250 } lstio_session_info_args_t;
252 /* delete a session */
254 int lstio_ses_key; /* IN: session key */
255 } lstio_session_end_args_t;
257 #define LST_OPC_SESSION 1
258 #define LST_OPC_GROUP 2
259 #define LST_OPC_NODES 3
260 #define LST_OPC_BATCHCLI 4
261 #define LST_OPC_BATCHSRV 5
264 int lstio_dbg_key; /* IN: session key */
265 int lstio_dbg_type; /* IN: debug sessin|batch|group|nodes list */
266 int lstio_dbg_flags; /* IN: reserved debug flags */
267 int lstio_dbg_timeout; /* IN: timeout of debug */
269 int lstio_dbg_nmlen; /* IN: len of name */
270 char *lstio_dbg_namep; /* IN: name of group|batch */
271 int lstio_dbg_count; /* IN: # of test nodes to debug */
272 lnet_process_id_t *lstio_dbg_idsp; /* IN: id of test nodes */
273 struct list_head *lstio_dbg_resultp; /* OUT: list head of result buffer */
274 } lstio_debug_args_t;
277 int lstio_grp_key; /* IN: session key */
278 int lstio_grp_nmlen; /* IN: name length */
279 char *lstio_grp_namep; /* IN: group name */
280 } lstio_group_add_args_t;
283 int lstio_grp_key; /* IN: session key */
284 int lstio_grp_nmlen; /* IN: name length */
285 char *lstio_grp_namep; /* IN: group name */
286 } lstio_group_del_args_t;
288 #define LST_GROUP_CLEAN 1 /* remove inactive nodes in the group */
289 #define LST_GROUP_REFRESH 2 /* refresh inactive nodes in the group */
290 #define LST_GROUP_RMND 3 /* delete nodes from the group */
293 int lstio_grp_key; /* IN: session key */
294 int lstio_grp_opc; /* IN: OPC */
295 int lstio_grp_args; /* IN: arguments */
296 int lstio_grp_nmlen; /* IN: name length */
297 char *lstio_grp_namep; /* IN: group name */
298 int lstio_grp_count; /* IN: # of nodes id */
299 lnet_process_id_t *lstio_grp_idsp; /* IN: array of nodes */
300 struct list_head *lstio_grp_resultp; /* OUT: list head of result buffer */
301 } lstio_group_update_args_t;
304 int lstio_grp_key; /* IN: session key */
305 int lstio_grp_nmlen; /* IN: name length */
306 char *lstio_grp_namep; /* IN: group name */
307 int lstio_grp_count; /* IN: # of nodes */
308 lnet_process_id_t *lstio_grp_idsp; /* IN: nodes */
309 struct list_head *lstio_grp_resultp; /* OUT: list head of result buffer */
310 } lstio_group_nodes_args_t;
313 int lstio_grp_key; /* IN: session key */
314 int lstio_grp_idx; /* IN: group idx */
315 int lstio_grp_nmlen; /* IN: name len */
316 char *lstio_grp_namep; /* OUT: name */
317 } lstio_group_list_args_t;
320 int lstio_grp_key; /* IN: session key */
321 int lstio_grp_nmlen; /* IN: name len */
322 char *lstio_grp_namep; /* IN: name */
323 lstcon_ndlist_ent_t *lstio_grp_entp; /* OUT: description of group */
325 int *lstio_grp_idxp; /* IN/OUT: node index */
326 int *lstio_grp_ndentp; /* IN/OUT: # of nodent */
327 lstcon_node_ent_t *lstio_grp_dentsp; /* OUT: nodent array */
328 } lstio_group_info_args_t;
330 #define LST_DEFAULT_BATCH "batch" /* default batch name */
333 int lstio_bat_key; /* IN: session key */
334 int lstio_bat_nmlen; /* IN: name length */
335 char *lstio_bat_namep; /* IN: batch name */
336 } lstio_batch_add_args_t;
339 int lstio_bat_key; /* IN: session key */
340 int lstio_bat_nmlen; /* IN: name length */
341 char *lstio_bat_namep; /* IN: batch name */
342 } lstio_batch_del_args_t;
345 int lstio_bat_key; /* IN: session key */
346 int lstio_bat_timeout; /* IN: timeout for the batch */
347 int lstio_bat_nmlen; /* IN: name length */
348 char *lstio_bat_namep; /* IN: batch name */
349 struct list_head *lstio_bat_resultp; /* OUT: list head of result buffer */
350 } lstio_batch_run_args_t;
353 int lstio_bat_key; /* IN: session key */
354 int lstio_bat_force; /* IN: abort unfinished test RPC */
355 int lstio_bat_nmlen; /* IN: name length */
356 char *lstio_bat_namep; /* IN: batch name */
357 struct list_head *lstio_bat_resultp; /* OUT: list head of result buffer */
358 } lstio_batch_stop_args_t;
361 int lstio_bat_key; /* IN: session key */
362 int lstio_bat_testidx; /* IN: test index */
363 int lstio_bat_client; /* IN: is test client? */
364 int lstio_bat_timeout; /* IN: timeout for waiting */
365 int lstio_bat_nmlen; /* IN: name length */
366 char *lstio_bat_namep; /* IN: batch name */
367 struct list_head *lstio_bat_resultp; /* OUT: list head of result buffer */
368 } lstio_batch_query_args_t;
371 int lstio_bat_key; /* IN: session key */
372 int lstio_bat_idx; /* IN: index */
373 int lstio_bat_nmlen; /* IN: name length */
374 char *lstio_bat_namep; /* IN: batch name */
375 } lstio_batch_list_args_t;
378 int lstio_bat_key; /* IN: session key */
379 int lstio_bat_nmlen; /* IN: name length */
380 char *lstio_bat_namep; /* IN: name */
381 int lstio_bat_server; /* IN: query server or not */
382 int lstio_bat_testidx; /* IN: test index */
383 lstcon_test_batch_ent_t *lstio_bat_entp; /* OUT: batch ent */
385 int *lstio_bat_idxp; /* IN/OUT: index of node */
386 int *lstio_bat_ndentp; /* IN/OUT: # of nodent */
387 lstcon_node_ent_t *lstio_bat_dentsp; /* array of nodent */
388 } lstio_batch_info_args_t;
390 /* add stat in session */
392 int lstio_sta_key; /* IN: session key */
393 int lstio_sta_timeout; /* IN: timeout for stat requst */
394 int lstio_sta_nmlen; /* IN: group name length */
395 char *lstio_sta_namep; /* IN: group name */
396 int lstio_sta_count; /* IN: # of pid */
397 lnet_process_id_t *lstio_sta_idsp; /* IN: pid */
398 struct list_head *lstio_sta_resultp; /* OUT: list head of result buffer */
406 /* create a test in a batch */
407 #define LST_MAX_CONCUR 1024 /* Max concurrency of test */
410 int lstio_tes_key; /* IN: session key */
411 int lstio_tes_bat_nmlen; /* IN: batch name len */
412 char *lstio_tes_bat_name; /* IN: batch name */
413 int lstio_tes_type; /* IN: test type */
414 int lstio_tes_oneside; /* IN: one sided test */
415 int lstio_tes_loop; /* IN: loop count */
416 int lstio_tes_concur; /* IN: concurrency */
418 int lstio_tes_dist; /* IN: node distribution in destination groups */
419 int lstio_tes_span; /* IN: node span in destination groups */
420 int lstio_tes_sgrp_nmlen; /* IN: source group name length */
421 char *lstio_tes_sgrp_name; /* IN: group name */
422 int lstio_tes_dgrp_nmlen; /* IN: destination group name length */
423 char *lstio_tes_dgrp_name; /* IN: group name */
425 int lstio_tes_param_len; /* IN: param buffer len */
426 void *lstio_tes_param; /* IN: parameter for specified test:
430 int *lstio_tes_retp; /* OUT: private returned value */
431 struct list_head *lstio_tes_resultp; /* OUT: list head of result buffer */
440 LST_BRW_CHECK_NONE = 1,
441 LST_BRW_CHECK_SIMPLE = 2,
442 LST_BRW_CHECK_FULL = 3
446 int blk_opc; /* bulk operation code */
447 int blk_size; /* size (bytes) */
448 int blk_time; /* time of running the test*/
449 int blk_flags; /* reserved flags */
450 } lst_test_bulk_param_t;
453 int png_size; /* size of ping message */
454 int png_time; /* time */
455 int png_loop; /* loop */
456 int png_flags; /* reserved flags */
457 } lst_test_ping_param_t;
460 #include <libcfs/libcfs_pack.h>
469 } WIRE_ATTR srpc_counters_t;
473 __u32 active_batches;
474 __u32 zombie_sessions;
477 } WIRE_ATTR sfw_counters_t;
478 #include <libcfs/libcfs_unpack.h>