aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2016-03-11 20:29:47 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-12 01:24:47 -0500
commitb794d796b45907a82c3541d64dc3947039f1d15e (patch)
tree7988d8681c948bda776b0869f7fe6c2e9d644a7e
parentec436b9a08858e566f00e0bba717020812ecd6c0 (diff)
staging: lustre: filter remaining extra spacing for lnet selftest
This patch is a result of a filter applied to the lnet selftest code to remove the last bits of hidden white spaces. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lnet/selftest/brw_test.c6
-rw-r--r--drivers/staging/lustre/lnet/selftest/conctl.c10
-rw-r--r--drivers/staging/lustre/lnet/selftest/conrpc.h58
-rw-r--r--drivers/staging/lustre/lnet/selftest/console.c8
-rw-r--r--drivers/staging/lustre/lnet/selftest/console.h116
-rw-r--r--drivers/staging/lustre/lnet/selftest/framework.c86
-rw-r--r--drivers/staging/lustre/lnet/selftest/module.c2
-rw-r--r--drivers/staging/lustre/lnet/selftest/ping_test.c2
-rw-r--r--drivers/staging/lustre/lnet/selftest/rpc.c10
-rw-r--r--drivers/staging/lustre/lnet/selftest/rpc.h178
-rw-r--r--drivers/staging/lustre/lnet/selftest/selftest.h250
-rw-r--r--drivers/staging/lustre/lnet/selftest/timer.c8
-rw-r--r--drivers/staging/lustre/lnet/selftest/timer.h6
13 files changed, 370 insertions, 370 deletions
diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 0d0c22c86773..eebc92412061 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -131,9 +131,9 @@ brw_client_init(sfw_test_instance_t *tsi)
131 return 0; 131 return 0;
132} 132}
133 133
134#define BRW_POISON 0xbeefbeefbeefbeefULL 134#define BRW_POISON 0xbeefbeefbeefbeefULL
135#define BRW_MAGIC 0xeeb0eeb1eeb2eeb3ULL 135#define BRW_MAGIC 0xeeb0eeb1eeb2eeb3ULL
136#define BRW_MSIZE sizeof(__u64) 136#define BRW_MSIZE sizeof(__u64)
137 137
138static int 138static int
139brw_inject_one_error(void) 139brw_inject_one_error(void)
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 9793bc6a109a..872df72a221f 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -100,7 +100,7 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
100 !args->lstio_ses_featp || /* address for output features */ 100 !args->lstio_ses_featp || /* address for output features */
101 !args->lstio_ses_ndinfo || /* address for output ndinfo */ 101 !args->lstio_ses_ndinfo || /* address for output ndinfo */
102 !args->lstio_ses_namep || /* address for output name */ 102 !args->lstio_ses_namep || /* address for output name */
103 args->lstio_ses_nmlen <= 0 || 103 args->lstio_ses_nmlen <= 0 ||
104 args->lstio_ses_nmlen > LST_NAME_SIZE) 104 args->lstio_ses_nmlen > LST_NAME_SIZE)
105 return -EINVAL; 105 return -EINVAL;
106 106
@@ -297,7 +297,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args)
297 break; 297 break;
298 298
299 case LST_GROUP_RMND: 299 case LST_GROUP_RMND:
300 if (args->lstio_grp_count <= 0 || 300 if (args->lstio_grp_count <= 0 ||
301 !args->lstio_grp_idsp) { 301 !args->lstio_grp_idsp) {
302 rc = -EINVAL; 302 rc = -EINVAL;
303 break; 303 break;
@@ -368,7 +368,7 @@ lst_group_list_ioctl(lstio_group_list_args_t *args)
368 if (args->lstio_grp_key != console_session.ses_key) 368 if (args->lstio_grp_key != console_session.ses_key)
369 return -EACCES; 369 return -EACCES;
370 370
371 if (args->lstio_grp_idx < 0 || 371 if (args->lstio_grp_idx < 0 ||
372 !args->lstio_grp_namep || 372 !args->lstio_grp_namep ||
373 args->lstio_grp_nmlen <= 0 || 373 args->lstio_grp_nmlen <= 0 ||
374 args->lstio_grp_nmlen > LST_NAME_SIZE) 374 args->lstio_grp_nmlen > LST_NAME_SIZE)
@@ -591,7 +591,7 @@ lst_batch_list_ioctl(lstio_batch_list_args_t *args)
591 if (args->lstio_bat_key != console_session.ses_key) 591 if (args->lstio_bat_key != console_session.ses_key)
592 return -EACCES; 592 return -EACCES;
593 593
594 if (args->lstio_bat_idx < 0 || 594 if (args->lstio_bat_idx < 0 ||
595 !args->lstio_bat_namep || 595 !args->lstio_bat_namep ||
596 args->lstio_bat_nmlen <= 0 || 596 args->lstio_bat_nmlen <= 0 ||
597 args->lstio_bat_nmlen > LST_NAME_SIZE) 597 args->lstio_bat_nmlen > LST_NAME_SIZE)
@@ -755,7 +755,7 @@ static int lst_test_add_ioctl(lstio_test_args_t *args)
755 goto out; 755 goto out;
756 756
757 LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1); 757 LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1);
758 if (!dst_name) 758 if (!dst_name)
759 goto out; 759 goto out;
760 760
761 if (args->lstio_tes_param) { 761 if (args->lstio_tes_param) {
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h
index d2133bc76e93..3e7839dad5bb 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.h
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.h
@@ -51,12 +51,12 @@
51#include "selftest.h" 51#include "selftest.h"
52 52
53/* Console rpc and rpc transaction */ 53/* Console rpc and rpc transaction */
54#define LST_TRANS_TIMEOUT 30 54#define LST_TRANS_TIMEOUT 30
55#define LST_TRANS_MIN_TIMEOUT 3 55#define LST_TRANS_MIN_TIMEOUT 3
56 56
57#define LST_VALIDATE_TIMEOUT(t) min(max(t, LST_TRANS_MIN_TIMEOUT), LST_TRANS_TIMEOUT) 57#define LST_VALIDATE_TIMEOUT(t) min(max(t, LST_TRANS_MIN_TIMEOUT), LST_TRANS_TIMEOUT)
58 58
59#define LST_PING_INTERVAL 8 59#define LST_PING_INTERVAL 8
60 60
61struct lstcon_rpc_trans; 61struct lstcon_rpc_trans;
62struct lstcon_tsb_hdr; 62struct lstcon_tsb_hdr;
@@ -64,46 +64,46 @@ struct lstcon_test;
64struct lstcon_node; 64struct lstcon_node;
65 65
66typedef struct lstcon_rpc { 66typedef struct lstcon_rpc {
67 struct list_head crp_link; /* chain on rpc transaction */ 67 struct list_head crp_link; /* chain on rpc transaction */
68 srpc_client_rpc_t *crp_rpc; /* client rpc */ 68 srpc_client_rpc_t *crp_rpc; /* client rpc */
69 struct lstcon_node *crp_node; /* destination node */ 69 struct lstcon_node *crp_node; /* destination node */
70 struct lstcon_rpc_trans *crp_trans; /* conrpc transaction */ 70 struct lstcon_rpc_trans *crp_trans; /* conrpc transaction */
71 71
72 unsigned int crp_posted:1; /* rpc is posted */ 72 unsigned int crp_posted:1; /* rpc is posted */
73 unsigned int crp_finished:1; /* rpc is finished */ 73 unsigned int crp_finished:1; /* rpc is finished */
74 unsigned int crp_unpacked:1; /* reply is unpacked */ 74 unsigned int crp_unpacked:1; /* reply is unpacked */
75 /** RPC is embedded in other structure and can't free it */ 75 /** RPC is embedded in other structure and can't free it */
76 unsigned int crp_embedded:1; 76 unsigned int crp_embedded:1;
77 int crp_status; /* console rpc errors */ 77 int crp_status; /* console rpc errors */
78 unsigned long crp_stamp; /* replied time stamp */ 78 unsigned long crp_stamp; /* replied time stamp */
79} lstcon_rpc_t; 79} lstcon_rpc_t;
80 80
81typedef struct lstcon_rpc_trans { 81typedef struct lstcon_rpc_trans {
82 struct list_head tas_olink; /* link chain on owner list */ 82 struct list_head tas_olink; /* link chain on owner list */
83 struct list_head tas_link; /* link chain on global list */ 83 struct list_head tas_link; /* link chain on global list */
84 int tas_opc; /* operation code of transaction */ 84 int tas_opc; /* operation code of transaction */
85 unsigned tas_feats_updated; /* features mask is uptodate */ 85 unsigned tas_feats_updated; /* features mask is uptodate */
86 unsigned tas_features; /* test features mask */ 86 unsigned tas_features; /* test features mask */
87 wait_queue_head_t tas_waitq; /* wait queue head */ 87 wait_queue_head_t tas_waitq; /* wait queue head */
88 atomic_t tas_remaining; /* # of un-scheduled rpcs */ 88 atomic_t tas_remaining; /* # of un-scheduled rpcs */
89 struct list_head tas_rpcs_list; /* queued requests */ 89 struct list_head tas_rpcs_list; /* queued requests */
90} lstcon_rpc_trans_t; 90} lstcon_rpc_trans_t;
91 91
92#define LST_TRANS_PRIVATE 0x1000 92#define LST_TRANS_PRIVATE 0x1000
93 93
94#define LST_TRANS_SESNEW (LST_TRANS_PRIVATE | 0x01) 94#define LST_TRANS_SESNEW (LST_TRANS_PRIVATE | 0x01)
95#define LST_TRANS_SESEND (LST_TRANS_PRIVATE | 0x02) 95#define LST_TRANS_SESEND (LST_TRANS_PRIVATE | 0x02)
96#define LST_TRANS_SESQRY 0x03 96#define LST_TRANS_SESQRY 0x03
97#define LST_TRANS_SESPING 0x04 97#define LST_TRANS_SESPING 0x04
98 98
99#define LST_TRANS_TSBCLIADD (LST_TRANS_PRIVATE | 0x11) 99#define LST_TRANS_TSBCLIADD (LST_TRANS_PRIVATE | 0x11)
100#define LST_TRANS_TSBSRVADD (LST_TRANS_PRIVATE | 0x12) 100#define LST_TRANS_TSBSRVADD (LST_TRANS_PRIVATE | 0x12)
101#define LST_TRANS_TSBRUN (LST_TRANS_PRIVATE | 0x13) 101#define LST_TRANS_TSBRUN (LST_TRANS_PRIVATE | 0x13)
102#define LST_TRANS_TSBSTOP (LST_TRANS_PRIVATE | 0x14) 102#define LST_TRANS_TSBSTOP (LST_TRANS_PRIVATE | 0x14)
103#define LST_TRANS_TSBCLIQRY 0x15 103#define LST_TRANS_TSBCLIQRY 0x15
104#define LST_TRANS_TSBSRVQRY 0x16 104#define LST_TRANS_TSBSRVQRY 0x16
105 105
106#define LST_TRANS_STATQRY 0x21 106#define LST_TRANS_STATQRY 0x21
107 107
108typedef int (*lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *); 108typedef int (*lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *);
109typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *, 109typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *,
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 15cd83088004..6017f213b4d7 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -49,9 +49,9 @@
49do { \ 49do { \
50 if ((nd)->nd_state == LST_NODE_ACTIVE) \ 50 if ((nd)->nd_state == LST_NODE_ACTIVE) \
51 (p)->nle_nactive++; \ 51 (p)->nle_nactive++; \
52 else if ((nd)->nd_state == LST_NODE_BUSY) \ 52 else if ((nd)->nd_state == LST_NODE_BUSY) \
53 (p)->nle_nbusy++; \ 53 (p)->nle_nbusy++; \
54 else if ((nd)->nd_state == LST_NODE_DOWN) \ 54 else if ((nd)->nd_state == LST_NODE_DOWN) \
55 (p)->nle_ndown++; \ 55 (p)->nle_ndown++; \
56 else \ 56 else \
57 (p)->nle_nunknown++; \ 57 (p)->nle_nunknown++; \
@@ -1690,7 +1690,7 @@ int
1690lstcon_session_match(lst_sid_t sid) 1690lstcon_session_match(lst_sid_t sid)
1691{ 1691{
1692 return (console_session.ses_id.ses_nid == sid.ses_nid && 1692 return (console_session.ses_id.ses_nid == sid.ses_nid &&
1693 console_session.ses_id.ses_stamp == sid.ses_stamp) ? 1 : 0; 1693 console_session.ses_id.ses_stamp == sid.ses_stamp) ? 1 : 0;
1694} 1694}
1695 1695
1696static void 1696static void
@@ -1723,7 +1723,7 @@ lstcon_session_new(char *name, int key, unsigned feats,
1723 rc = lstcon_session_end(); 1723 rc = lstcon_session_end();
1724 1724
1725 /* lstcon_session_end() only return local error */ 1725 /* lstcon_session_end() only return local error */
1726 if (rc) 1726 if (rc)
1727 return rc; 1727 return rc;
1728 } 1728 }
1729 1729
diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h
index 5421311ce6e8..554f582441f1 100644
--- a/drivers/staging/lustre/lnet/selftest/console.h
+++ b/drivers/staging/lustre/lnet/selftest/console.h
@@ -52,79 +52,79 @@
52 52
53typedef struct lstcon_node { 53typedef struct lstcon_node {
54 lnet_process_id_t nd_id; /* id of the node */ 54 lnet_process_id_t nd_id; /* id of the node */
55 int nd_ref; /* reference count */ 55 int nd_ref; /* reference count */
56 int nd_state; /* state of the node */ 56 int nd_state; /* state of the node */
57 int nd_timeout; /* session timeout */ 57 int nd_timeout; /* session timeout */
58 unsigned long nd_stamp; /* timestamp of last replied RPC */ 58 unsigned long nd_stamp; /* timestamp of last replied RPC */
59 struct lstcon_rpc nd_ping; /* ping rpc */ 59 struct lstcon_rpc nd_ping; /* ping rpc */
60} lstcon_node_t; /* node descriptor */ 60} lstcon_node_t; /* node descriptor */
61 61
62typedef struct { 62typedef struct {
63 struct list_head ndl_link; /* chain on list */ 63 struct list_head ndl_link; /* chain on list */
64 struct list_head ndl_hlink; /* chain on hash */ 64 struct list_head ndl_hlink; /* chain on hash */
65 lstcon_node_t *ndl_node; /* pointer to node */ 65 lstcon_node_t *ndl_node; /* pointer to node */
66} lstcon_ndlink_t; /* node link descriptor */ 66} lstcon_ndlink_t; /* node link descriptor */
67 67
68typedef struct { 68typedef struct {
69 struct list_head grp_link; /* chain on global group list 69 struct list_head grp_link; /* chain on global group list
70 */ 70 */
71 int grp_ref; /* reference count */ 71 int grp_ref; /* reference count */
72 int grp_userland; /* has userland nodes */ 72 int grp_userland; /* has userland nodes */
73 int grp_nnode; /* # of nodes */ 73 int grp_nnode; /* # of nodes */
74 char grp_name[LST_NAME_SIZE]; /* group name */ 74 char grp_name[LST_NAME_SIZE]; /* group name */
75 75
76 struct list_head grp_trans_list; /* transaction list */ 76 struct list_head grp_trans_list; /* transaction list */
77 struct list_head grp_ndl_list; /* nodes list */ 77 struct list_head grp_ndl_list; /* nodes list */
78 struct list_head grp_ndl_hash[0]; /* hash table for nodes */ 78 struct list_head grp_ndl_hash[0]; /* hash table for nodes */
79} lstcon_group_t; /* (alias of nodes) group descriptor */ 79} lstcon_group_t; /* (alias of nodes) group descriptor */
80 80
81#define LST_BATCH_IDLE 0xB0 /* idle batch */ 81#define LST_BATCH_IDLE 0xB0 /* idle batch */
82#define LST_BATCH_RUNNING 0xB1 /* running batch */ 82#define LST_BATCH_RUNNING 0xB1 /* running batch */
83 83
84typedef struct lstcon_tsb_hdr { 84typedef struct lstcon_tsb_hdr {
85 lst_bid_t tsb_id; /* batch ID */ 85 lst_bid_t tsb_id; /* batch ID */
86 int tsb_index; /* test index */ 86 int tsb_index; /* test index */
87} lstcon_tsb_hdr_t; 87} lstcon_tsb_hdr_t;
88 88
89typedef struct { 89typedef struct {
90 lstcon_tsb_hdr_t bat_hdr; /* test_batch header */ 90 lstcon_tsb_hdr_t bat_hdr; /* test_batch header */
91 struct list_head bat_link; /* chain on session's batches list */ 91 struct list_head bat_link; /* chain on session's batches list */
92 int bat_ntest; /* # of test */ 92 int bat_ntest; /* # of test */
93 int bat_state; /* state of the batch */ 93 int bat_state; /* state of the batch */
94 int bat_arg; /* parameter for run|stop, timeout 94 int bat_arg; /* parameter for run|stop, timeout
95 * for run, force for stop */ 95 * for run, force for stop */
96 char bat_name[LST_NAME_SIZE];/* name of batch */ 96 char bat_name[LST_NAME_SIZE];/* name of batch */
97 97
98 struct list_head bat_test_list; /* list head of tests (lstcon_test_t) 98 struct list_head bat_test_list; /* list head of tests (lstcon_test_t)
99 */ 99 */
100 struct list_head bat_trans_list; /* list head of transaction */ 100 struct list_head bat_trans_list; /* list head of transaction */
101 struct list_head bat_cli_list; /* list head of client nodes 101 struct list_head bat_cli_list; /* list head of client nodes
102 * (lstcon_node_t) */ 102 * (lstcon_node_t) */
103 struct list_head *bat_cli_hash; /* hash table of client nodes */ 103 struct list_head *bat_cli_hash; /* hash table of client nodes */
104 struct list_head bat_srv_list; /* list head of server nodes */ 104 struct list_head bat_srv_list; /* list head of server nodes */
105 struct list_head *bat_srv_hash; /* hash table of server nodes */ 105 struct list_head *bat_srv_hash; /* hash table of server nodes */
106} lstcon_batch_t; /* (tests ) batch descriptor */ 106} lstcon_batch_t; /* (tests ) batch descriptor */
107 107
108typedef struct lstcon_test { 108typedef struct lstcon_test {
109 lstcon_tsb_hdr_t tes_hdr; /* test batch header */ 109 lstcon_tsb_hdr_t tes_hdr; /* test batch header */
110 struct list_head tes_link; /* chain on batch's tests list */ 110 struct list_head tes_link; /* chain on batch's tests list */
111 lstcon_batch_t *tes_batch; /* pointer to batch */ 111 lstcon_batch_t *tes_batch; /* pointer to batch */
112 112
113 int tes_type; /* type of the test, i.e: bulk, ping */ 113 int tes_type; /* type of the test, i.e: bulk, ping */
114 int tes_stop_onerr; /* stop on error */ 114 int tes_stop_onerr; /* stop on error */
115 int tes_oneside; /* one-sided test */ 115 int tes_oneside; /* one-sided test */
116 int tes_concur; /* concurrency */ 116 int tes_concur; /* concurrency */
117 int tes_loop; /* loop count */ 117 int tes_loop; /* loop count */
118 int tes_dist; /* nodes distribution of target group */ 118 int tes_dist; /* nodes distribution of target group */
119 int tes_span; /* nodes span of target group */ 119 int tes_span; /* nodes span of target group */
120 int tes_cliidx; /* client index, used for RPC creating */ 120 int tes_cliidx; /* client index, used for RPC creating */
121 121
122 struct list_head tes_trans_list; /* transaction list */ 122 struct list_head tes_trans_list; /* transaction list */
123 lstcon_group_t *tes_src_grp; /* group run the test */ 123 lstcon_group_t *tes_src_grp; /* group run the test */
124 lstcon_group_t *tes_dst_grp; /* target group */ 124 lstcon_group_t *tes_dst_grp; /* target group */
125 125
126 int tes_paramlen; /* test parameter length */ 126 int tes_paramlen; /* test parameter length */
127 char tes_param[0]; /* test parameter */ 127 char tes_param[0]; /* test parameter */
128} lstcon_test_t; /* a single test descriptor */ 128} lstcon_test_t; /* a single test descriptor */
129 129
130#define LST_GLOBAL_HASHSIZE 503 /* global nodes hash table size */ 130#define LST_GLOBAL_HASHSIZE 503 /* global nodes hash table size */
@@ -136,24 +136,24 @@ typedef struct lstcon_test {
136#define LST_CONSOLE_TIMEOUT 300 /* default console timeout */ 136#define LST_CONSOLE_TIMEOUT 300 /* default console timeout */
137 137
138struct lstcon_session { 138struct lstcon_session {
139 struct mutex ses_mutex; /* only 1 thread in session */ 139 struct mutex ses_mutex; /* only 1 thread in session */
140 lst_sid_t ses_id; /* global session id */ 140 lst_sid_t ses_id; /* global session id */
141 int ses_key; /* local session key */ 141 int ses_key; /* local session key */
142 int ses_state; /* state of session */ 142 int ses_state; /* state of session */
143 int ses_timeout; /* timeout in seconds */ 143 int ses_timeout; /* timeout in seconds */
144 time64_t ses_laststamp; /* last operation stamp (seconds) 144 time64_t ses_laststamp; /* last operation stamp (seconds)
145 */ 145 */
146 unsigned ses_features; /* tests features of the session 146 unsigned ses_features; /* tests features of the session
147 */ 147 */
148 unsigned ses_feats_updated:1; /* features are synced with 148 unsigned ses_feats_updated:1; /* features are synced with
149 * remote test nodes */ 149 * remote test nodes */
150 unsigned ses_force:1; /* force creating */ 150 unsigned ses_force:1; /* force creating */
151 unsigned ses_shutdown:1; /* session is shutting down */ 151 unsigned ses_shutdown:1; /* session is shutting down */
152 unsigned ses_expired:1; /* console is timedout */ 152 unsigned ses_expired:1; /* console is timedout */
153 __u64 ses_id_cookie; /* batch id cookie */ 153 __u64 ses_id_cookie; /* batch id cookie */
154 char ses_name[LST_NAME_SIZE];/* session name */ 154 char ses_name[LST_NAME_SIZE];/* session name */
155 lstcon_rpc_trans_t *ses_ping; /* session pinger */ 155 lstcon_rpc_trans_t *ses_ping; /* session pinger */
156 struct stt_timer ses_ping_timer; /* timer for pinger */ 156 struct stt_timer ses_ping_timer; /* timer for pinger */
157 lstcon_trans_stat_t ses_trans_stat; /* transaction stats */ 157 lstcon_trans_stat_t ses_trans_stat; /* transaction stats */
158 158
159 struct list_head ses_trans_list; /* global list of transaction */ 159 struct list_head ses_trans_list; /* global list of transaction */
@@ -162,8 +162,8 @@ struct lstcon_session {
162 struct list_head ses_ndl_list; /* global list of nodes */ 162 struct list_head ses_ndl_list; /* global list of nodes */
163 struct list_head *ses_ndl_hash; /* hash table of nodes */ 163 struct list_head *ses_ndl_hash; /* hash table of nodes */
164 164
165 spinlock_t ses_rpc_lock; /* serialize */ 165 spinlock_t ses_rpc_lock; /* serialize */
166 atomic_t ses_rpc_counter; /* # of initialized RPCs */ 166 atomic_t ses_rpc_counter; /* # of initialized RPCs */
167 struct list_head ses_rpc_freelist; /* idle console rpc */ 167 struct list_head ses_rpc_freelist; /* idle console rpc */
168}; /* session descriptor */ 168}; /* session descriptor */
169 169
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index a3ccd784b317..2ff47d2b6b02 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -53,64 +53,64 @@ static int rpc_timeout = 64;
53module_param(rpc_timeout, int, 0644); 53module_param(rpc_timeout, int, 0644);
54MODULE_PARM_DESC(rpc_timeout, "rpc timeout in seconds (64 by default, 0 == never)"); 54MODULE_PARM_DESC(rpc_timeout, "rpc timeout in seconds (64 by default, 0 == never)");
55 55
56#define sfw_unpack_id(id) \ 56#define sfw_unpack_id(id) \
57do { \ 57do { \
58 __swab64s(&(id).nid); \ 58 __swab64s(&(id).nid); \
59 __swab32s(&(id).pid); \ 59 __swab32s(&(id).pid); \
60} while (0) 60} while (0)
61 61
62#define sfw_unpack_sid(sid) \ 62#define sfw_unpack_sid(sid) \
63do { \ 63do { \
64 __swab64s(&(sid).ses_nid); \ 64 __swab64s(&(sid).ses_nid); \
65 __swab64s(&(sid).ses_stamp); \ 65 __swab64s(&(sid).ses_stamp); \
66} while (0) 66} while (0)
67 67
68#define sfw_unpack_fw_counters(fc) \ 68#define sfw_unpack_fw_counters(fc) \
69do { \ 69do { \
70 __swab32s(&(fc).running_ms); \ 70 __swab32s(&(fc).running_ms); \
71 __swab32s(&(fc).active_batches); \ 71 __swab32s(&(fc).active_batches); \
72 __swab32s(&(fc).zombie_sessions); \ 72 __swab32s(&(fc).zombie_sessions); \
73 __swab32s(&(fc).brw_errors); \ 73 __swab32s(&(fc).brw_errors); \
74 __swab32s(&(fc).ping_errors); \ 74 __swab32s(&(fc).ping_errors); \
75} while (0) 75} while (0)
76 76
77#define sfw_unpack_rpc_counters(rc) \ 77#define sfw_unpack_rpc_counters(rc) \
78do { \ 78do { \
79 __swab32s(&(rc).errors); \ 79 __swab32s(&(rc).errors); \
80 __swab32s(&(rc).rpcs_sent); \ 80 __swab32s(&(rc).rpcs_sent); \
81 __swab32s(&(rc).rpcs_rcvd); \ 81 __swab32s(&(rc).rpcs_rcvd); \
82 __swab32s(&(rc).rpcs_dropped); \ 82 __swab32s(&(rc).rpcs_dropped); \
83 __swab32s(&(rc).rpcs_expired); \ 83 __swab32s(&(rc).rpcs_expired); \
84 __swab64s(&(rc).bulk_get); \ 84 __swab64s(&(rc).bulk_get); \
85 __swab64s(&(rc).bulk_put); \ 85 __swab64s(&(rc).bulk_put); \
86} while (0) 86} while (0)
87 87
88#define sfw_unpack_lnet_counters(lc) \ 88#define sfw_unpack_lnet_counters(lc) \
89do { \ 89do { \
90 __swab32s(&(lc).errors); \ 90 __swab32s(&(lc).errors); \
91 __swab32s(&(lc).msgs_max); \ 91 __swab32s(&(lc).msgs_max); \
92 __swab32s(&(lc).msgs_alloc); \ 92 __swab32s(&(lc).msgs_alloc); \
93 __swab32s(&(lc).send_count); \ 93 __swab32s(&(lc).send_count); \
94 __swab32s(&(lc).recv_count); \ 94 __swab32s(&(lc).recv_count); \
95 __swab32s(&(lc).drop_count); \ 95 __swab32s(&(lc).drop_count); \
96 __swab32s(&(lc).route_count); \ 96 __swab32s(&(lc).route_count); \
97 __swab64s(&(lc).send_length); \ 97 __swab64s(&(lc).send_length); \
98 __swab64s(&(lc).recv_length); \ 98 __swab64s(&(lc).recv_length); \
99 __swab64s(&(lc).drop_length); \ 99 __swab64s(&(lc).drop_length); \
100 __swab64s(&(lc).route_length); \ 100 __swab64s(&(lc).route_length); \
101} while (0) 101} while (0)
102 102
103#define sfw_test_active(t) (atomic_read(&(t)->tsi_nactive)) 103#define sfw_test_active(t) (atomic_read(&(t)->tsi_nactive))
104#define sfw_batch_active(b) (atomic_read(&(b)->bat_nactive)) 104#define sfw_batch_active(b) (atomic_read(&(b)->bat_nactive))
105 105
106static struct smoketest_framework { 106static struct smoketest_framework {
107 struct list_head fw_zombie_rpcs; /* RPCs to be recycled */ 107 struct list_head fw_zombie_rpcs; /* RPCs to be recycled */
108 struct list_head fw_zombie_sessions; /* stopping sessions */ 108 struct list_head fw_zombie_sessions; /* stopping sessions */
109 struct list_head fw_tests; /* registered test cases */ 109 struct list_head fw_tests; /* registered test cases */
110 atomic_t fw_nzombies; /* # zombie sessions */ 110 atomic_t fw_nzombies; /* # zombie sessions */
111 spinlock_t fw_lock; /* serialise */ 111 spinlock_t fw_lock; /* serialise */
112 sfw_session_t *fw_session; /* _the_ session */ 112 sfw_session_t *fw_session; /* _the_ session */
113 int fw_shuttingdown; /* shutdown in progress */ 113 int fw_shuttingdown; /* shutdown in progress */
114 struct srpc_server_rpc *fw_active_srpc;/* running RPC */ 114 struct srpc_server_rpc *fw_active_srpc;/* running RPC */
115} sfw_data; 115} sfw_data;
116 116
@@ -194,7 +194,7 @@ sfw_del_session_timer(void)
194 194
195static void 195static void
196sfw_deactivate_session(void) 196sfw_deactivate_session(void)
197 __must_hold(&sfw_data.fw_lock) 197__must_hold(&sfw_data.fw_lock)
198{ 198{
199 sfw_session_t *sn = sfw_data.fw_session; 199 sfw_session_t *sn = sfw_data.fw_session;
200 int nactive = 0; 200 int nactive = 0;
@@ -1164,7 +1164,7 @@ sfw_add_test(struct srpc_server_rpc *rpc)
1164 if (!(sn->sn_features & LST_FEAT_BULK_LEN)) { 1164 if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
1165 len = npg * PAGE_CACHE_SIZE; 1165 len = npg * PAGE_CACHE_SIZE;
1166 1166
1167 } else { 1167 } else {
1168 len = sizeof(lnet_process_id_packed_t) * 1168 len = sizeof(lnet_process_id_packed_t) *
1169 request->tsr_ndest; 1169 request->tsr_ndest;
1170 } 1170 }
@@ -1274,7 +1274,7 @@ sfw_handle_server_rpc(struct srpc_server_rpc *rpc)
1274 } 1274 }
1275 1275
1276 } else if (request->msg_ses_feats & ~LST_FEATS_MASK) { 1276 } else if (request->msg_ses_feats & ~LST_FEATS_MASK) {
1277 /* 1277 /**
1278 * NB: at this point, old version will ignore features and 1278 * NB: at this point, old version will ignore features and
1279 * create new session anyway, so console should be able 1279 * create new session anyway, so console should be able
1280 * to handle this 1280 * to handle this
diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
index 55082ce8b250..1e858e9121cc 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -40,7 +40,7 @@
40#include "console.h" 40#include "console.h"
41 41
42enum { 42enum {
43 LST_INIT_NONE = 0, 43 LST_INIT_NONE = 0,
44 LST_INIT_WI_SERIAL, 44 LST_INIT_WI_SERIAL,
45 LST_INIT_WI_TEST, 45 LST_INIT_WI_TEST,
46 LST_INIT_RPC, 46 LST_INIT_RPC,
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index cb2707af4849..81a45045e186 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -42,7 +42,7 @@
42 42
43#include "selftest.h" 43#include "selftest.h"
44 44
45#define LST_PING_TEST_MAGIC 0xbabeface 45#define LST_PING_TEST_MAGIC 0xbabeface
46 46
47static int ping_srv_workitems = SFW_TEST_WI_MAX; 47static int ping_srv_workitems = SFW_TEST_WI_MAX;
48module_param(ping_srv_workitems, int, 0644); 48module_param(ping_srv_workitems, int, 0644);
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index f344d564f4d2..69be7d6f48fa 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -463,7 +463,7 @@ srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
463 463
464static int 464static int
465srpc_service_post_buffer(struct srpc_service_cd *scd, struct srpc_buffer *buf) 465srpc_service_post_buffer(struct srpc_service_cd *scd, struct srpc_buffer *buf)
466 __must_hold(&scd->scd_lock) 466__must_hold(&scd->scd_lock)
467{ 467{
468 struct srpc_service *sv = scd->scd_svc; 468 struct srpc_service *sv = scd->scd_svc;
469 struct srpc_msg *msg = &buf->buf_msg; 469 struct srpc_msg *msg = &buf->buf_msg;
@@ -698,7 +698,7 @@ srpc_finish_service(struct srpc_service *sv)
698/* called with sv->sv_lock held */ 698/* called with sv->sv_lock held */
699static void 699static void
700srpc_service_recycle_buffer(struct srpc_service_cd *scd, srpc_buffer_t *buf) 700srpc_service_recycle_buffer(struct srpc_service_cd *scd, srpc_buffer_t *buf)
701 __must_hold(&scd->scd_lock) 701__must_hold(&scd->scd_lock)
702{ 702{
703 if (!scd->scd_svc->sv_shuttingdown && scd->scd_buf_adjust >= 0) { 703 if (!scd->scd_svc->sv_shuttingdown && scd->scd_buf_adjust >= 0) {
704 if (srpc_service_post_buffer(scd, buf)) { 704 if (srpc_service_post_buffer(scd, buf)) {
@@ -1104,8 +1104,8 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
1104 return; 1104 return;
1105 1105
1106 INIT_LIST_HEAD(&timer->stt_list); 1106 INIT_LIST_HEAD(&timer->stt_list);
1107 timer->stt_data = rpc; 1107 timer->stt_data = rpc;
1108 timer->stt_func = srpc_client_rpc_expired; 1108 timer->stt_func = srpc_client_rpc_expired;
1109 timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout; 1109 timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
1110 stt_add_timer(timer); 1110 stt_add_timer(timer);
1111} 1111}
@@ -1333,7 +1333,7 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
1333 LASSERT(why); 1333 LASSERT(why);
1334 1334
1335 if (rpc->crpc_aborted || /* already aborted */ 1335 if (rpc->crpc_aborted || /* already aborted */
1336 rpc->crpc_closed) /* callback imminent */ 1336 rpc->crpc_closed) /* callback imminent */
1337 return; 1337 return;
1338 1338
1339 CDEBUG(D_NET, "Aborting RPC: service %d, peer %s, state %s, why %d\n", 1339 CDEBUG(D_NET, "Aborting RPC: service %d, peer %s, state %s, why %d\n",
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h
index 9dfb3662a2eb..a79c315f2ceb 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.h
+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
@@ -45,24 +45,24 @@
45 * XXX: *REPLY == *REQST + 1 45 * XXX: *REPLY == *REQST + 1
46 */ 46 */
47typedef enum { 47typedef enum {
48 SRPC_MSG_MKSN_REQST = 0, 48 SRPC_MSG_MKSN_REQST = 0,
49 SRPC_MSG_MKSN_REPLY = 1, 49 SRPC_MSG_MKSN_REPLY = 1,
50 SRPC_MSG_RMSN_REQST = 2, 50 SRPC_MSG_RMSN_REQST = 2,
51 SRPC_MSG_RMSN_REPLY = 3, 51 SRPC_MSG_RMSN_REPLY = 3,
52 SRPC_MSG_BATCH_REQST = 4, 52 SRPC_MSG_BATCH_REQST = 4,
53 SRPC_MSG_BATCH_REPLY = 5, 53 SRPC_MSG_BATCH_REPLY = 5,
54 SRPC_MSG_STAT_REQST = 6, 54 SRPC_MSG_STAT_REQST = 6,
55 SRPC_MSG_STAT_REPLY = 7, 55 SRPC_MSG_STAT_REPLY = 7,
56 SRPC_MSG_TEST_REQST = 8, 56 SRPC_MSG_TEST_REQST = 8,
57 SRPC_MSG_TEST_REPLY = 9, 57 SRPC_MSG_TEST_REPLY = 9,
58 SRPC_MSG_DEBUG_REQST = 10, 58 SRPC_MSG_DEBUG_REQST = 10,
59 SRPC_MSG_DEBUG_REPLY = 11, 59 SRPC_MSG_DEBUG_REPLY = 11,
60 SRPC_MSG_BRW_REQST = 12, 60 SRPC_MSG_BRW_REQST = 12,
61 SRPC_MSG_BRW_REPLY = 13, 61 SRPC_MSG_BRW_REPLY = 13,
62 SRPC_MSG_PING_REQST = 14, 62 SRPC_MSG_PING_REQST = 14,
63 SRPC_MSG_PING_REPLY = 15, 63 SRPC_MSG_PING_REPLY = 15,
64 SRPC_MSG_JOIN_REQST = 16, 64 SRPC_MSG_JOIN_REQST = 16,
65 SRPC_MSG_JOIN_REPLY = 17, 65 SRPC_MSG_JOIN_REPLY = 17,
66} srpc_msg_type_t; 66} srpc_msg_type_t;
67 67
68/* CAVEAT EMPTOR: 68/* CAVEAT EMPTOR:
@@ -78,127 +78,127 @@ typedef struct {
78} WIRE_ATTR srpc_generic_reqst_t; 78} WIRE_ATTR srpc_generic_reqst_t;
79 79
80typedef struct { 80typedef struct {
81 __u32 status; 81 __u32 status;
82 lst_sid_t sid; 82 lst_sid_t sid;
83} WIRE_ATTR srpc_generic_reply_t; 83} WIRE_ATTR srpc_generic_reply_t;
84 84
85/* FRAMEWORK RPCs */ 85/* FRAMEWORK RPCs */
86typedef struct { 86typedef struct {
87 __u64 mksn_rpyid; /* reply buffer matchbits */ 87 __u64 mksn_rpyid; /* reply buffer matchbits */
88 lst_sid_t mksn_sid; /* session id */ 88 lst_sid_t mksn_sid; /* session id */
89 __u32 mksn_force; /* use brute force */ 89 __u32 mksn_force; /* use brute force */
90 char mksn_name[LST_NAME_SIZE]; 90 char mksn_name[LST_NAME_SIZE];
91} WIRE_ATTR srpc_mksn_reqst_t; /* make session request */ 91} WIRE_ATTR srpc_mksn_reqst_t; /* make session request */
92 92
93typedef struct { 93typedef struct {
94 __u32 mksn_status; /* session status */ 94 __u32 mksn_status; /* session status */
95 lst_sid_t mksn_sid; /* session id */ 95 lst_sid_t mksn_sid; /* session id */
96 __u32 mksn_timeout; /* session timeout */ 96 __u32 mksn_timeout; /* session timeout */
97 char mksn_name[LST_NAME_SIZE]; 97 char mksn_name[LST_NAME_SIZE];
98} WIRE_ATTR srpc_mksn_reply_t; /* make session reply */ 98} WIRE_ATTR srpc_mksn_reply_t; /* make session reply */
99 99
100typedef struct { 100typedef struct {
101 __u64 rmsn_rpyid; /* reply buffer matchbits */ 101 __u64 rmsn_rpyid; /* reply buffer matchbits */
102 lst_sid_t rmsn_sid; /* session id */ 102 lst_sid_t rmsn_sid; /* session id */
103} WIRE_ATTR srpc_rmsn_reqst_t; /* remove session request */ 103} WIRE_ATTR srpc_rmsn_reqst_t; /* remove session request */
104 104
105typedef struct { 105typedef struct {
106 __u32 rmsn_status; 106 __u32 rmsn_status;
107 lst_sid_t rmsn_sid; /* session id */ 107 lst_sid_t rmsn_sid; /* session id */
108} WIRE_ATTR srpc_rmsn_reply_t; /* remove session reply */ 108} WIRE_ATTR srpc_rmsn_reply_t; /* remove session reply */
109 109
110typedef struct { 110typedef struct {
111 __u64 join_rpyid; /* reply buffer matchbits */ 111 __u64 join_rpyid; /* reply buffer matchbits */
112 lst_sid_t join_sid; /* session id to join */ 112 lst_sid_t join_sid; /* session id to join */
113 char join_group[LST_NAME_SIZE]; /* group name */ 113 char join_group[LST_NAME_SIZE]; /* group name */
114} WIRE_ATTR srpc_join_reqst_t; 114} WIRE_ATTR srpc_join_reqst_t;
115 115
116typedef struct { 116typedef struct {
117 __u32 join_status; /* returned status */ 117 __u32 join_status; /* returned status */
118 lst_sid_t join_sid; /* session id */ 118 lst_sid_t join_sid; /* session id */
119 __u32 join_timeout; /* # seconds' inactivity to 119 __u32 join_timeout; /* # seconds' inactivity to
120 * expire */ 120 * expire */
121 char join_session[LST_NAME_SIZE]; /* session name */ 121 char join_session[LST_NAME_SIZE]; /* session name */
122} WIRE_ATTR srpc_join_reply_t; 122} WIRE_ATTR srpc_join_reply_t;
123 123
124typedef struct { 124typedef struct {
125 __u64 dbg_rpyid; /* reply buffer matchbits */ 125 __u64 dbg_rpyid; /* reply buffer matchbits */
126 lst_sid_t dbg_sid; /* session id */ 126 lst_sid_t dbg_sid; /* session id */
127 __u32 dbg_flags; /* bitmap of debug */ 127 __u32 dbg_flags; /* bitmap of debug */
128} WIRE_ATTR srpc_debug_reqst_t; 128} WIRE_ATTR srpc_debug_reqst_t;
129 129
130typedef struct { 130typedef struct {
131 __u32 dbg_status; /* returned code */ 131 __u32 dbg_status; /* returned code */
132 lst_sid_t dbg_sid; /* session id */ 132 lst_sid_t dbg_sid; /* session id */
133 __u32 dbg_timeout; /* session timeout */ 133 __u32 dbg_timeout; /* session timeout */
134 __u32 dbg_nbatch; /* # of batches in the node */ 134 __u32 dbg_nbatch; /* # of batches in the node */
135 char dbg_name[LST_NAME_SIZE]; /* session name */ 135 char dbg_name[LST_NAME_SIZE]; /* session name */
136} WIRE_ATTR srpc_debug_reply_t; 136} WIRE_ATTR srpc_debug_reply_t;
137 137
138#define SRPC_BATCH_OPC_RUN 1 138#define SRPC_BATCH_OPC_RUN 1
139#define SRPC_BATCH_OPC_STOP 2 139#define SRPC_BATCH_OPC_STOP 2
140#define SRPC_BATCH_OPC_QUERY 3 140#define SRPC_BATCH_OPC_QUERY 3
141 141
142typedef struct { 142typedef struct {
143 __u64 bar_rpyid; /* reply buffer matchbits */ 143 __u64 bar_rpyid; /* reply buffer matchbits */
144 lst_sid_t bar_sid; /* session id */ 144 lst_sid_t bar_sid; /* session id */
145 lst_bid_t bar_bid; /* batch id */ 145 lst_bid_t bar_bid; /* batch id */
146 __u32 bar_opc; /* create/start/stop batch */ 146 __u32 bar_opc; /* create/start/stop batch */
147 __u32 bar_testidx; /* index of test */ 147 __u32 bar_testidx; /* index of test */
148 __u32 bar_arg; /* parameters */ 148 __u32 bar_arg; /* parameters */
149} WIRE_ATTR srpc_batch_reqst_t; 149} WIRE_ATTR srpc_batch_reqst_t;
150 150
151typedef struct { 151typedef struct {
152 __u32 bar_status; /* status of request */ 152 __u32 bar_status; /* status of request */
153 lst_sid_t bar_sid; /* session id */ 153 lst_sid_t bar_sid; /* session id */
154 __u32 bar_active; /* # of active tests in batch/test */ 154 __u32 bar_active; /* # of active tests in batch/test */
155 __u32 bar_time; /* remained time */ 155 __u32 bar_time; /* remained time */
156} WIRE_ATTR srpc_batch_reply_t; 156} WIRE_ATTR srpc_batch_reply_t;
157 157
158typedef struct { 158typedef struct {
159 __u64 str_rpyid; /* reply buffer matchbits */ 159 __u64 str_rpyid; /* reply buffer matchbits */
160 lst_sid_t str_sid; /* session id */ 160 lst_sid_t str_sid; /* session id */
161 __u32 str_type; /* type of stat */ 161 __u32 str_type; /* type of stat */
162} WIRE_ATTR srpc_stat_reqst_t; 162} WIRE_ATTR srpc_stat_reqst_t;
163 163
164typedef struct { 164typedef struct {
165 __u32 str_status; 165 __u32 str_status;
166 lst_sid_t str_sid; 166 lst_sid_t str_sid;
167 sfw_counters_t str_fw; 167 sfw_counters_t str_fw;
168 srpc_counters_t str_rpc; 168 srpc_counters_t str_rpc;
169 lnet_counters_t str_lnet; 169 lnet_counters_t str_lnet;
170} WIRE_ATTR srpc_stat_reply_t; 170} WIRE_ATTR srpc_stat_reply_t;
171 171
172typedef struct { 172typedef struct {
173 __u32 blk_opc; /* bulk operation code */ 173 __u32 blk_opc; /* bulk operation code */
174 __u32 blk_npg; /* # of pages */ 174 __u32 blk_npg; /* # of pages */
175 __u32 blk_flags; /* reserved flags */ 175 __u32 blk_flags; /* reserved flags */
176} WIRE_ATTR test_bulk_req_t; 176} WIRE_ATTR test_bulk_req_t;
177 177
178typedef struct { 178typedef struct {
179 __u16 blk_opc; /* bulk operation code */ 179 __u16 blk_opc; /* bulk operation code */
180 __u16 blk_flags; /* data check flags */ 180 __u16 blk_flags; /* data check flags */
181 __u32 blk_len; /* data length */ 181 __u32 blk_len; /* data length */
182 __u32 blk_offset; /* reserved: offset */ 182 __u32 blk_offset; /* reserved: offset */
183} WIRE_ATTR test_bulk_req_v1_t; 183} WIRE_ATTR test_bulk_req_v1_t;
184 184
185typedef struct { 185typedef struct {
186 __u32 png_size; /* size of ping message */ 186 __u32 png_size; /* size of ping message */
187 __u32 png_flags; /* reserved flags */ 187 __u32 png_flags; /* reserved flags */
188} WIRE_ATTR test_ping_req_t; 188} WIRE_ATTR test_ping_req_t;
189 189
190typedef struct { 190typedef struct {
191 __u64 tsr_rpyid; /* reply buffer matchbits */ 191 __u64 tsr_rpyid; /* reply buffer matchbits */
192 __u64 tsr_bulkid; /* bulk buffer matchbits */ 192 __u64 tsr_bulkid; /* bulk buffer matchbits */
193 lst_sid_t tsr_sid; /* session id */ 193 lst_sid_t tsr_sid; /* session id */
194 lst_bid_t tsr_bid; /* batch id */ 194 lst_bid_t tsr_bid; /* batch id */
195 __u32 tsr_service; /* test type: bulk|ping|... */ 195 __u32 tsr_service; /* test type: bulk|ping|... */
196 __u32 tsr_loop; /* test client loop count or 196 __u32 tsr_loop; /* test client loop count or
197 * # server buffers needed */ 197 * # server buffers needed */
198 __u32 tsr_concur; /* concurrency of test */ 198 __u32 tsr_concur; /* concurrency of test */
199 __u8 tsr_is_client; /* is test client or not */ 199 __u8 tsr_is_client; /* is test client or not */
200 __u8 tsr_stop_onerr; /* stop on error */ 200 __u8 tsr_stop_onerr; /* stop on error */
201 __u32 tsr_ndest; /* # of dest nodes */ 201 __u32 tsr_ndest; /* # of dest nodes */
202 202
203 union { 203 union {
204 test_ping_req_t ping; 204 test_ping_req_t ping;
@@ -208,7 +208,7 @@ typedef struct {
208} WIRE_ATTR srpc_test_reqst_t; 208} WIRE_ATTR srpc_test_reqst_t;
209 209
210typedef struct { 210typedef struct {
211 __u32 tsr_status; /* returned code */ 211 __u32 tsr_status; /* returned code */
212 lst_sid_t tsr_sid; 212 lst_sid_t tsr_sid;
213} WIRE_ATTR srpc_test_reply_t; 213} WIRE_ATTR srpc_test_reply_t;
214 214
@@ -228,19 +228,19 @@ typedef struct {
228} WIRE_ATTR srpc_ping_reply_t; 228} WIRE_ATTR srpc_ping_reply_t;
229 229
230typedef struct { 230typedef struct {
231 __u64 brw_rpyid; /* reply buffer matchbits */ 231 __u64 brw_rpyid; /* reply buffer matchbits */
232 __u64 brw_bulkid; /* bulk buffer matchbits */ 232 __u64 brw_bulkid; /* bulk buffer matchbits */
233 __u32 brw_rw; /* read or write */ 233 __u32 brw_rw; /* read or write */
234 __u32 brw_len; /* bulk data len */ 234 __u32 brw_len; /* bulk data len */
235 __u32 brw_flags; /* bulk data patterns */ 235 __u32 brw_flags; /* bulk data patterns */
236} WIRE_ATTR srpc_brw_reqst_t; /* bulk r/w request */ 236} WIRE_ATTR srpc_brw_reqst_t; /* bulk r/w request */
237 237
238typedef struct { 238typedef struct {
239 __u32 brw_status; 239 __u32 brw_status;
240} WIRE_ATTR srpc_brw_reply_t; /* bulk r/w reply */ 240} WIRE_ATTR srpc_brw_reply_t; /* bulk r/w reply */
241 241
242#define SRPC_MSG_MAGIC 0xeeb0f00d 242#define SRPC_MSG_MAGIC 0xeeb0f00d
243#define SRPC_MSG_VERSION 1 243#define SRPC_MSG_VERSION 1
244 244
245typedef struct srpc_msg { 245typedef struct srpc_msg {
246 __u32 msg_magic; /* magic number */ 246 __u32 msg_magic; /* magic number */
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 7a22bd327677..288522d4d7b9 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -56,14 +56,14 @@
56#define MADE_WITHOUT_COMPROMISE 56#define MADE_WITHOUT_COMPROMISE
57#endif 57#endif
58 58
59#define SWI_STATE_NEWBORN 0 59#define SWI_STATE_NEWBORN 0
60#define SWI_STATE_REPLY_SUBMITTED 1 60#define SWI_STATE_REPLY_SUBMITTED 1
61#define SWI_STATE_REPLY_SENT 2 61#define SWI_STATE_REPLY_SENT 2
62#define SWI_STATE_REQUEST_SUBMITTED 3 62#define SWI_STATE_REQUEST_SUBMITTED 3
63#define SWI_STATE_REQUEST_SENT 4 63#define SWI_STATE_REQUEST_SENT 4
64#define SWI_STATE_REPLY_RECEIVED 5 64#define SWI_STATE_REPLY_RECEIVED 5
65#define SWI_STATE_BULK_STARTED 6 65#define SWI_STATE_BULK_STARTED 6
66#define SWI_STATE_DONE 10 66#define SWI_STATE_DONE 10
67 67
68/* forward refs */ 68/* forward refs */
69struct srpc_service; 69struct srpc_service;
@@ -74,24 +74,24 @@ struct sfw_test_instance;
74/* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework 74/* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
75 * services, e.g. create/modify session. 75 * services, e.g. create/modify session.
76 */ 76 */
77#define SRPC_SERVICE_DEBUG 0 77#define SRPC_SERVICE_DEBUG 0
78#define SRPC_SERVICE_MAKE_SESSION 1 78#define SRPC_SERVICE_MAKE_SESSION 1
79#define SRPC_SERVICE_REMOVE_SESSION 2 79#define SRPC_SERVICE_REMOVE_SESSION 2
80#define SRPC_SERVICE_BATCH 3 80#define SRPC_SERVICE_BATCH 3
81#define SRPC_SERVICE_TEST 4 81#define SRPC_SERVICE_TEST 4
82#define SRPC_SERVICE_QUERY_STAT 5 82#define SRPC_SERVICE_QUERY_STAT 5
83#define SRPC_SERVICE_JOIN 6 83#define SRPC_SERVICE_JOIN 6
84#define SRPC_FRAMEWORK_SERVICE_MAX_ID 10 84#define SRPC_FRAMEWORK_SERVICE_MAX_ID 10
85/* other services start from SRPC_FRAMEWORK_SERVICE_MAX_ID+1 */ 85/* other services start from SRPC_FRAMEWORK_SERVICE_MAX_ID+1 */
86#define SRPC_SERVICE_BRW 11 86#define SRPC_SERVICE_BRW 11
87#define SRPC_SERVICE_PING 12 87#define SRPC_SERVICE_PING 12
88#define SRPC_SERVICE_MAX_ID 12 88#define SRPC_SERVICE_MAX_ID 12
89 89
90#define SRPC_REQUEST_PORTAL 50 90#define SRPC_REQUEST_PORTAL 50
91/* a lazy portal for framework RPC requests */ 91/* a lazy portal for framework RPC requests */
92#define SRPC_FRAMEWORK_REQUEST_PORTAL 51 92#define SRPC_FRAMEWORK_REQUEST_PORTAL 51
93/* all reply/bulk RDMAs go to this portal */ 93/* all reply/bulk RDMAs go to this portal */
94#define SRPC_RDMA_PORTAL 52 94#define SRPC_RDMA_PORTAL 52
95 95
96static inline srpc_msg_type_t 96static inline srpc_msg_type_t
97srpc_service2request(int service) 97srpc_service2request(int service)
@@ -149,25 +149,25 @@ typedef enum {
149typedef struct { 149typedef struct {
150 srpc_event_type_t ev_type; /* what's up */ 150 srpc_event_type_t ev_type; /* what's up */
151 lnet_event_kind_t ev_lnet; /* LNet event type */ 151 lnet_event_kind_t ev_lnet; /* LNet event type */
152 int ev_fired; /* LNet event fired? */ 152 int ev_fired; /* LNet event fired? */
153 int ev_status; /* LNet event status */ 153 int ev_status; /* LNet event status */
154 void *ev_data; /* owning server/client RPC */ 154 void *ev_data; /* owning server/client RPC */
155} srpc_event_t; 155} srpc_event_t;
156 156
157typedef struct { 157typedef struct {
158 int bk_len; /* len of bulk data */ 158 int bk_len; /* len of bulk data */
159 lnet_handle_md_t bk_mdh; 159 lnet_handle_md_t bk_mdh;
160 int bk_sink; /* sink/source */ 160 int bk_sink; /* sink/source */
161 int bk_niov; /* # iov in bk_iovs */ 161 int bk_niov; /* # iov in bk_iovs */
162 lnet_kiov_t bk_iovs[0]; 162 lnet_kiov_t bk_iovs[0];
163} srpc_bulk_t; /* bulk descriptor */ 163} srpc_bulk_t; /* bulk descriptor */
164 164
165/* message buffer descriptor */ 165/* message buffer descriptor */
166typedef struct srpc_buffer { 166typedef struct srpc_buffer {
167 struct list_head buf_list; /* chain on srpc_service::*_msgq */ 167 struct list_head buf_list; /* chain on srpc_service::*_msgq */
168 srpc_msg_t buf_msg; 168 srpc_msg_t buf_msg;
169 lnet_handle_md_t buf_mdh; 169 lnet_handle_md_t buf_mdh;
170 lnet_nid_t buf_self; 170 lnet_nid_t buf_self;
171 lnet_process_id_t buf_peer; 171 lnet_process_id_t buf_peer;
172} srpc_buffer_t; 172} srpc_buffer_t;
173 173
@@ -176,9 +176,9 @@ typedef int (*swi_action_t) (struct swi_workitem *);
176 176
177typedef struct swi_workitem { 177typedef struct swi_workitem {
178 struct cfs_wi_sched *swi_sched; 178 struct cfs_wi_sched *swi_sched;
179 cfs_workitem_t swi_workitem; 179 cfs_workitem_t swi_workitem;
180 swi_action_t swi_action; 180 swi_action_t swi_action;
181 int swi_state; 181 int swi_state;
182} swi_workitem_t; 182} swi_workitem_t;
183 183
184/* server-side state of a RPC */ 184/* server-side state of a RPC */
@@ -186,73 +186,73 @@ struct srpc_server_rpc {
186 /* chain on srpc_service::*_rpcq */ 186 /* chain on srpc_service::*_rpcq */
187 struct list_head srpc_list; 187 struct list_head srpc_list;
188 struct srpc_service_cd *srpc_scd; 188 struct srpc_service_cd *srpc_scd;
189 swi_workitem_t srpc_wi; 189 swi_workitem_t srpc_wi;
190 srpc_event_t srpc_ev; /* bulk/reply event */ 190 srpc_event_t srpc_ev; /* bulk/reply event */
191 lnet_nid_t srpc_self; 191 lnet_nid_t srpc_self;
192 lnet_process_id_t srpc_peer; 192 lnet_process_id_t srpc_peer;
193 srpc_msg_t srpc_replymsg; 193 srpc_msg_t srpc_replymsg;
194 lnet_handle_md_t srpc_replymdh; 194 lnet_handle_md_t srpc_replymdh;
195 srpc_buffer_t *srpc_reqstbuf; 195 srpc_buffer_t *srpc_reqstbuf;
196 srpc_bulk_t *srpc_bulk; 196 srpc_bulk_t *srpc_bulk;
197 197
198 unsigned int srpc_aborted; /* being given up */ 198 unsigned int srpc_aborted; /* being given up */
199 int srpc_status; 199 int srpc_status;
200 void (*srpc_done)(struct srpc_server_rpc *); 200 void (*srpc_done)(struct srpc_server_rpc *);
201}; 201};
202 202
203/* client-side state of a RPC */ 203/* client-side state of a RPC */
204typedef struct srpc_client_rpc { 204typedef struct srpc_client_rpc {
205 struct list_head crpc_list; /* chain on user's lists */ 205 struct list_head crpc_list; /* chain on user's lists */
206 spinlock_t crpc_lock; /* serialize */ 206 spinlock_t crpc_lock; /* serialize */
207 int crpc_service; 207 int crpc_service;
208 atomic_t crpc_refcount; 208 atomic_t crpc_refcount;
209 int crpc_timeout; /* # seconds to wait for reply */ 209 int crpc_timeout; /* # seconds to wait for reply */
210 struct stt_timer crpc_timer; 210 struct stt_timer crpc_timer;
211 swi_workitem_t crpc_wi; 211 swi_workitem_t crpc_wi;
212 lnet_process_id_t crpc_dest; 212 lnet_process_id_t crpc_dest;
213 213
214 void (*crpc_done)(struct srpc_client_rpc *); 214 void (*crpc_done)(struct srpc_client_rpc *);
215 void (*crpc_fini)(struct srpc_client_rpc *); 215 void (*crpc_fini)(struct srpc_client_rpc *);
216 int crpc_status; /* completion status */ 216 int crpc_status; /* completion status */
217 void *crpc_priv; /* caller data */ 217 void *crpc_priv; /* caller data */
218 218
219 /* state flags */ 219 /* state flags */
220 unsigned int crpc_aborted:1; /* being given up */ 220 unsigned int crpc_aborted:1; /* being given up */
221 unsigned int crpc_closed:1; /* completed */ 221 unsigned int crpc_closed:1; /* completed */
222 222
223 /* RPC events */ 223 /* RPC events */
224 srpc_event_t crpc_bulkev; /* bulk event */ 224 srpc_event_t crpc_bulkev; /* bulk event */
225 srpc_event_t crpc_reqstev; /* request event */ 225 srpc_event_t crpc_reqstev; /* request event */
226 srpc_event_t crpc_replyev; /* reply event */ 226 srpc_event_t crpc_replyev; /* reply event */
227 227
228 /* bulk, request(reqst), and reply exchanged on wire */ 228 /* bulk, request(reqst), and reply exchanged on wire */
229 srpc_msg_t crpc_reqstmsg; 229 srpc_msg_t crpc_reqstmsg;
230 srpc_msg_t crpc_replymsg; 230 srpc_msg_t crpc_replymsg;
231 lnet_handle_md_t crpc_reqstmdh; 231 lnet_handle_md_t crpc_reqstmdh;
232 lnet_handle_md_t crpc_replymdh; 232 lnet_handle_md_t crpc_replymdh;
233 srpc_bulk_t crpc_bulk; 233 srpc_bulk_t crpc_bulk;
234} srpc_client_rpc_t; 234} srpc_client_rpc_t;
235 235
236#define srpc_client_rpc_size(rpc) \ 236#define srpc_client_rpc_size(rpc) \
237offsetof(srpc_client_rpc_t, crpc_bulk.bk_iovs[(rpc)->crpc_bulk.bk_niov]) 237offsetof(srpc_client_rpc_t, crpc_bulk.bk_iovs[(rpc)->crpc_bulk.bk_niov])
238 238
239#define srpc_client_rpc_addref(rpc) \ 239#define srpc_client_rpc_addref(rpc) \
240do { \ 240do { \
241 CDEBUG(D_NET, "RPC[%p] -> %s (%d)++\n", \ 241 CDEBUG(D_NET, "RPC[%p] -> %s (%d)++\n", \
242 (rpc), libcfs_id2str((rpc)->crpc_dest), \ 242 (rpc), libcfs_id2str((rpc)->crpc_dest), \
243 atomic_read(&(rpc)->crpc_refcount)); \ 243 atomic_read(&(rpc)->crpc_refcount)); \
244 LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0); \ 244 LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0); \
245 atomic_inc(&(rpc)->crpc_refcount); \ 245 atomic_inc(&(rpc)->crpc_refcount); \
246} while (0) 246} while (0)
247 247
248#define srpc_client_rpc_decref(rpc) \ 248#define srpc_client_rpc_decref(rpc) \
249do { \ 249do { \
250 CDEBUG(D_NET, "RPC[%p] -> %s (%d)--\n", \ 250 CDEBUG(D_NET, "RPC[%p] -> %s (%d)--\n", \
251 (rpc), libcfs_id2str((rpc)->crpc_dest), \ 251 (rpc), libcfs_id2str((rpc)->crpc_dest), \
252 atomic_read(&(rpc)->crpc_refcount)); \ 252 atomic_read(&(rpc)->crpc_refcount)); \
253 LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0); \ 253 LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0); \
254 if (atomic_dec_and_test(&(rpc)->crpc_refcount)) \ 254 if (atomic_dec_and_test(&(rpc)->crpc_refcount)) \
255 srpc_destroy_client_rpc(rpc); \ 255 srpc_destroy_client_rpc(rpc); \
256} while (0) 256} while (0)
257 257
258#define srpc_event_pending(rpc) (!(rpc)->crpc_bulkev.ev_fired || \ 258#define srpc_event_pending(rpc) (!(rpc)->crpc_bulkev.ev_fired || \
@@ -268,9 +268,9 @@ struct srpc_service_cd {
268 /** event buffer */ 268 /** event buffer */
269 srpc_event_t scd_ev; 269 srpc_event_t scd_ev;
270 /** free RPC descriptors */ 270 /** free RPC descriptors */
271 struct list_head scd_rpc_free; 271 struct list_head scd_rpc_free;
272 /** in-flight RPCs */ 272 /** in-flight RPCs */
273 struct list_head scd_rpc_active; 273 struct list_head scd_rpc_active;
274 /** workitem for posting buffer */ 274 /** workitem for posting buffer */
275 swi_workitem_t scd_buf_wi; 275 swi_workitem_t scd_buf_wi;
276 /** CPT id */ 276 /** CPT id */
@@ -278,7 +278,7 @@ struct srpc_service_cd {
278 /** error code for scd_buf_wi */ 278 /** error code for scd_buf_wi */
279 int scd_buf_err; 279 int scd_buf_err;
280 /** timestamp for scd_buf_err */ 280 /** timestamp for scd_buf_err */
281 time64_t scd_buf_err_stamp; 281 time64_t scd_buf_err_stamp;
282 /** total # request buffers */ 282 /** total # request buffers */
283 int scd_buf_total; 283 int scd_buf_total;
284 /** # posted request buffers */ 284 /** # posted request buffers */
@@ -290,16 +290,16 @@ struct srpc_service_cd {
290 /** increase/decrease some buffers */ 290 /** increase/decrease some buffers */
291 int scd_buf_adjust; 291 int scd_buf_adjust;
292 /** posted message buffers */ 292 /** posted message buffers */
293 struct list_head scd_buf_posted; 293 struct list_head scd_buf_posted;
294 /** blocked for RPC descriptor */ 294 /** blocked for RPC descriptor */
295 struct list_head scd_buf_blocked; 295 struct list_head scd_buf_blocked;
296}; 296};
297 297
298/* number of server workitems (mini-thread) for testing service */ 298/* number of server workitems (mini-thread) for testing service */
299#define SFW_TEST_WI_MIN 256 299#define SFW_TEST_WI_MIN 256
300#define SFW_TEST_WI_MAX 2048 300#define SFW_TEST_WI_MAX 2048
301/* extra buffers for tolerating buggy peers, or unbalanced number 301/* extra buffers for tolerating buggy peers, or unbalanced number
302 * of peers between partitions */ 302 * of peers between partitions */
303#define SFW_TEST_WI_EXTRA 64 303#define SFW_TEST_WI_EXTRA 64
304 304
305/* number of server workitems (mini-thread) for framework service */ 305/* number of server workitems (mini-thread) for framework service */
@@ -324,29 +324,29 @@ typedef struct srpc_service {
324 324
325typedef struct { 325typedef struct {
326 struct list_head sn_list; /* chain on fw_zombie_sessions */ 326 struct list_head sn_list; /* chain on fw_zombie_sessions */
327 lst_sid_t sn_id; /* unique identifier */ 327 lst_sid_t sn_id; /* unique identifier */
328 unsigned int sn_timeout; /* # seconds' inactivity to expire */ 328 unsigned int sn_timeout; /* # seconds' inactivity to expire */
329 int sn_timer_active; 329 int sn_timer_active;
330 unsigned int sn_features; 330 unsigned int sn_features;
331 struct stt_timer sn_timer; 331 struct stt_timer sn_timer;
332 struct list_head sn_batches; /* list of batches */ 332 struct list_head sn_batches; /* list of batches */
333 char sn_name[LST_NAME_SIZE]; 333 char sn_name[LST_NAME_SIZE];
334 atomic_t sn_refcount; 334 atomic_t sn_refcount;
335 atomic_t sn_brw_errors; 335 atomic_t sn_brw_errors;
336 atomic_t sn_ping_errors; 336 atomic_t sn_ping_errors;
337 unsigned long sn_started; 337 unsigned long sn_started;
338} sfw_session_t; 338} sfw_session_t;
339 339
340#define sfw_sid_equal(sid0, sid1) ((sid0).ses_nid == (sid1).ses_nid && \ 340#define sfw_sid_equal(sid0, sid1) ((sid0).ses_nid == (sid1).ses_nid && \
341 (sid0).ses_stamp == (sid1).ses_stamp) 341 (sid0).ses_stamp == (sid1).ses_stamp)
342 342
343typedef struct { 343typedef struct {
344 struct list_head bat_list; /* chain on sn_batches */ 344 struct list_head bat_list; /* chain on sn_batches */
345 lst_bid_t bat_id; /* batch id */ 345 lst_bid_t bat_id; /* batch id */
346 int bat_error; /* error code of batch */ 346 int bat_error; /* error code of batch */
347 sfw_session_t *bat_session; /* batch's session */ 347 sfw_session_t *bat_session; /* batch's session */
348 atomic_t bat_nactive; /* # of active tests */ 348 atomic_t bat_nactive; /* # of active tests */
349 struct list_head bat_tests; /* test instances */ 349 struct list_head bat_tests; /* test instances */
350} sfw_batch_t; 350} sfw_batch_t;
351 351
352typedef struct { 352typedef struct {
@@ -356,32 +356,32 @@ typedef struct {
356 * client */ 356 * client */
357 int (*tso_prep_rpc)(struct sfw_test_unit *tsu, 357 int (*tso_prep_rpc)(struct sfw_test_unit *tsu,
358 lnet_process_id_t dest, 358 lnet_process_id_t dest,
359 srpc_client_rpc_t **rpc); /* prep a tests rpc */ 359 srpc_client_rpc_t **rpc); /* prep a tests rpc */
360 void (*tso_done_rpc)(struct sfw_test_unit *tsu, 360 void (*tso_done_rpc)(struct sfw_test_unit *tsu,
361 srpc_client_rpc_t *rpc); /* done a test rpc */ 361 srpc_client_rpc_t *rpc); /* done a test rpc */
362} sfw_test_client_ops_t; 362} sfw_test_client_ops_t;
363 363
364typedef struct sfw_test_instance { 364typedef struct sfw_test_instance {
365 struct list_head tsi_list; /* chain on batch */ 365 struct list_head tsi_list; /* chain on batch */
366 int tsi_service; /* test type */ 366 int tsi_service; /* test type */
367 sfw_batch_t *tsi_batch; /* batch */ 367 sfw_batch_t *tsi_batch; /* batch */
368 sfw_test_client_ops_t *tsi_ops; /* test client operation 368 sfw_test_client_ops_t *tsi_ops; /* test client operation
369 */ 369 */
370 370
371 /* public parameter for all test units */ 371 /* public parameter for all test units */
372 unsigned int tsi_is_client:1; /* is test client */ 372 unsigned int tsi_is_client:1; /* is test client */
373 unsigned int tsi_stoptsu_onerr:1; /* stop tsu on error */ 373 unsigned int tsi_stoptsu_onerr:1; /* stop tsu on error */
374 int tsi_concur; /* concurrency */ 374 int tsi_concur; /* concurrency */
375 int tsi_loop; /* loop count */ 375 int tsi_loop; /* loop count */
376 376
377 /* status of test instance */ 377 /* status of test instance */
378 spinlock_t tsi_lock; /* serialize */ 378 spinlock_t tsi_lock; /* serialize */
379 unsigned int tsi_stopping:1; /* test is stopping */ 379 unsigned int tsi_stopping:1; /* test is stopping */
380 atomic_t tsi_nactive; /* # of active test 380 atomic_t tsi_nactive; /* # of active test
381 * unit */ 381 * unit */
382 struct list_head tsi_units; /* test units */ 382 struct list_head tsi_units; /* test units */
383 struct list_head tsi_free_rpcs; /* free rpcs */ 383 struct list_head tsi_free_rpcs; /* free rpcs */
384 struct list_head tsi_active_rpcs; /* active rpcs */ 384 struct list_head tsi_active_rpcs; /* active rpcs */
385 385
386 union { 386 union {
387 test_ping_req_t ping; /* ping parameter */ 387 test_ping_req_t ping; /* ping parameter */
@@ -392,24 +392,24 @@ typedef struct sfw_test_instance {
392 392
393/* XXX: trailing (PAGE_CACHE_SIZE % sizeof(lnet_process_id_t)) bytes at 393/* XXX: trailing (PAGE_CACHE_SIZE % sizeof(lnet_process_id_t)) bytes at
394 * the end of pages are not used */ 394 * the end of pages are not used */
395#define SFW_MAX_CONCUR LST_MAX_CONCUR 395#define SFW_MAX_CONCUR LST_MAX_CONCUR
396#define SFW_ID_PER_PAGE (PAGE_CACHE_SIZE / sizeof(lnet_process_id_packed_t)) 396#define SFW_ID_PER_PAGE (PAGE_CACHE_SIZE / sizeof(lnet_process_id_packed_t))
397#define SFW_MAX_NDESTS (LNET_MAX_IOV * SFW_ID_PER_PAGE) 397#define SFW_MAX_NDESTS (LNET_MAX_IOV * SFW_ID_PER_PAGE)
398#define sfw_id_pages(n) (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE) 398#define sfw_id_pages(n) (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE)
399 399
400typedef struct sfw_test_unit { 400typedef struct sfw_test_unit {
401 struct list_head tsu_list; /* chain on lst_test_instance */ 401 struct list_head tsu_list; /* chain on lst_test_instance */
402 lnet_process_id_t tsu_dest; /* id of dest node */ 402 lnet_process_id_t tsu_dest; /* id of dest node */
403 int tsu_loop; /* loop count of the test */ 403 int tsu_loop; /* loop count of the test */
404 sfw_test_instance_t *tsu_instance; /* pointer to test instance */ 404 sfw_test_instance_t *tsu_instance; /* pointer to test instance */
405 void *tsu_private; /* private data */ 405 void *tsu_private; /* private data */
406 swi_workitem_t tsu_worker; /* workitem of the test unit */ 406 swi_workitem_t tsu_worker; /* workitem of the test unit */
407} sfw_test_unit_t; 407} sfw_test_unit_t;
408 408
409typedef struct sfw_test_case { 409typedef struct sfw_test_case {
410 struct list_head tsc_list; /* chain on fw_tests */ 410 struct list_head tsc_list; /* chain on fw_tests */
411 srpc_service_t *tsc_srv_service; /* test service */ 411 srpc_service_t *tsc_srv_service; /* test service */
412 sfw_test_client_ops_t *tsc_cli_ops; /* ops of test client */ 412 sfw_test_client_ops_t *tsc_cli_ops; /* ops of test client */
413} sfw_test_case_t; 413} sfw_test_case_t;
414 414
415srpc_client_rpc_t * 415srpc_client_rpc_t *
@@ -511,7 +511,7 @@ srpc_destroy_client_rpc(srpc_client_rpc_t *rpc)
511 if (!rpc->crpc_fini) 511 if (!rpc->crpc_fini)
512 LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc)); 512 LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc));
513 else 513 else
514 (*rpc->crpc_fini) (rpc); 514 (*rpc->crpc_fini)(rpc);
515} 515}
516 516
517static inline void 517static inline void
diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c
index f9f37baa1311..8be52526ae5a 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.c
+++ b/drivers/staging/lustre/lnet/selftest/timer.c
@@ -57,13 +57,13 @@
57 (STTIMER_NSLOTS - 1))]) 57 (STTIMER_NSLOTS - 1))])
58 58
59static struct st_timer_data { 59static struct st_timer_data {
60 spinlock_t stt_lock; 60 spinlock_t stt_lock;
61 unsigned long stt_prev_slot; /* start time of the slot processed 61 unsigned long stt_prev_slot; /* start time of the slot processed
62 * previously */ 62 * previously */
63 struct list_head stt_hash[STTIMER_NSLOTS]; 63 struct list_head stt_hash[STTIMER_NSLOTS];
64 int stt_shuttingdown; 64 int stt_shuttingdown;
65 wait_queue_head_t stt_waitq; 65 wait_queue_head_t stt_waitq;
66 int stt_nthreads; 66 int stt_nthreads;
67} stt_data; 67} stt_data;
68 68
69void 69void
diff --git a/drivers/staging/lustre/lnet/selftest/timer.h b/drivers/staging/lustre/lnet/selftest/timer.h
index 39327bb7de1c..f1fbebd8a67c 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.h
+++ b/drivers/staging/lustre/lnet/selftest/timer.h
@@ -40,9 +40,9 @@
40 40
41struct stt_timer { 41struct stt_timer {
42 struct list_head stt_list; 42 struct list_head stt_list;
43 time64_t stt_expires; 43 time64_t stt_expires;
44 void (*stt_func)(void *); 44 void (*stt_func)(void *);
45 void *stt_data; 45 void *stt_data;
46}; 46};
47 47
48void stt_add_timer(struct stt_timer *timer); 48void stt_add_timer(struct stt_timer *timer);