Commit 188acc61 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging:lustre: LNet header code cleanup - indentation etc

Handle all the style issues reported by checkpatch.pl.
Remove general white spaces, spaces in function calls,
alignments etc.
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a9cf72b6
......@@ -48,14 +48,14 @@ extern lnet_t the_lnet; /* THE network */
#if (BITS_PER_LONG == 32)
/* 2 CPTs, allowing more CPTs might make us under memory pressure */
# define LNET_CPT_MAX_BITS 1
#define LNET_CPT_MAX_BITS 1
#else /* 64-bit system */
/*
* 256 CPTs for thousands of CPUs, allowing more CPTs might make us
* under risk of consuming all lh_cookie.
*/
# define LNET_CPT_MAX_BITS 8
#define LNET_CPT_MAX_BITS 8
#endif /* BITS_PER_LONG == 32 */
/* max allowed CPT number */
......@@ -530,7 +530,9 @@ void lnet_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
unsigned int offset, unsigned int mlen, unsigned int rlen);
lnet_msg_t *lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *get_msg);
void lnet_set_reply_msg_len(lnet_ni_t *ni, lnet_msg_t *msg, unsigned int len);
void lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int rc);
void lnet_drop_delayed_msg_list(struct list_head *head, char *reason);
void lnet_recv_delayed_msg_list(struct list_head *head);
......@@ -679,12 +681,12 @@ void lnet_peer_tables_destroy(void);
int lnet_peer_tables_create(void);
void lnet_debug_peer(lnet_nid_t nid);
static inline void lnet_peer_set_alive(lnet_peer_t *lp)
static inline void
lnet_peer_set_alive(lnet_peer_t *lp)
{
lp->lp_last_alive = lp->lp_last_query = get_seconds();
if (!lp->lp_alive)
lnet_notify_locked(lp, 0, 1, lp->lp_last_alive);
}
#endif
......@@ -92,7 +92,8 @@ typedef struct lnet_msg {
unsigned int msg_receiving:1; /* being received */
unsigned int msg_txcredit:1; /* taken an NI send credit */
unsigned int msg_peertxcredit:1; /* taken a peer send credit */
unsigned int msg_rtrcredit:1; /* taken a global router credit */
unsigned int msg_rtrcredit:1; /* taken a global
router credit */
unsigned int msg_peerrtrcredit:1; /* taken a peer router credit */
unsigned int msg_onactivelist:1; /* on the activelist */
......@@ -222,7 +223,8 @@ typedef struct lnet_lnd {
int (*lnd_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
int delayed, unsigned int niov,
struct kvec *iov, lnet_kiov_t *kiov,
unsigned int offset, unsigned int mlen, unsigned int rlen);
unsigned int offset, unsigned int mlen,
unsigned int rlen);
/* lnet_parse() has had to delay processing of this message
* (e.g. waiting for a forwarding buffer or send credits). Give the
......@@ -230,18 +232,18 @@ typedef struct lnet_lnd {
* for success and do NOT give back a receive credit; that has to wait
* until lnd_recv() gets called. On failure return < 0 and
* release resources; lnd_recv() will not be called. */
int (*lnd_eager_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
void **new_privatep);
int (*lnd_eager_recv)(struct lnet_ni *ni, void *private,
lnet_msg_t *msg, void **new_privatep);
/* notification of peer health */
void (*lnd_notify)(struct lnet_ni *ni, lnet_nid_t peer, int alive);
/* query of peer aliveness */
void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, unsigned long *when);
void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer,
unsigned long *when);
/* accept a new connection */
int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
} lnd_t;
struct lnet_tx_queue {
......@@ -269,7 +271,7 @@ typedef struct lnet_ni {
lnd_t *ni_lnd; /* procedural interface */
struct lnet_tx_queue **ni_tx_queues; /* percpt TX queues */
int **ni_refs; /* percpt reference count */
long ni_last_alive; /* when I was last alive */
long ni_last_alive;/* when I was last alive */
lnet_ni_status_t *ni_status; /* my health status */
/* equivalent interfaces to use */
char *ni_interfaces[LNET_MAX_INTERFACES];
......@@ -299,8 +301,10 @@ typedef struct {
typedef struct lnet_peer {
struct list_head lp_hashlist; /* chain on peer hash */
struct list_head lp_txq; /* messages blocking for tx credits */
struct list_head lp_rtrq; /* messages blocking for router credits */
struct list_head lp_txq; /* messages blocking for
tx credits */
struct list_head lp_rtrq; /* messages blocking for
router credits */
struct list_head lp_rtr_list; /* chain on router list */
int lp_txcredits; /* # tx credits available */
int lp_mintxcredits; /* low water mark */
......@@ -308,16 +312,24 @@ typedef struct lnet_peer {
int lp_minrtrcredits; /* low water mark */
unsigned int lp_alive:1; /* alive/dead? */
unsigned int lp_notify:1; /* notification outstanding? */
unsigned int lp_notifylnd:1; /* outstanding notification for LND? */
unsigned int lp_notifying:1; /* some thread is handling notification */
unsigned int lp_ping_notsent; /* SEND event outstanding from ping */
int lp_alive_count; /* # times router went dead<->alive */
unsigned int lp_notifylnd:1;/* outstanding notification
for LND? */
unsigned int lp_notifying:1; /* some thread is handling
notification */
unsigned int lp_ping_notsent;/* SEND event outstanding
from ping */
int lp_alive_count; /* # times router went
dead<->alive */
long lp_txqnob; /* bytes queued for sending */
unsigned long lp_timestamp; /* time of last aliveness news */
unsigned long lp_ping_timestamp; /* time of last ping attempt */
unsigned long lp_ping_deadline; /* != 0 if ping reply expected */
unsigned long lp_timestamp; /* time of last aliveness
news */
unsigned long lp_ping_timestamp;/* time of last ping
attempt */
unsigned long lp_ping_deadline; /* != 0 if ping reply
expected */
unsigned long lp_last_alive; /* when I was last alive */
unsigned long lp_last_query; /* when lp_ni was queried last time */
unsigned long lp_last_query; /* when lp_ni was queried
last time */
lnet_ni_t *lp_ni; /* interface peer is on */
lnet_nid_t lp_nid; /* peer's NID */
int lp_refcount; /* # refs */
......@@ -363,7 +375,8 @@ typedef struct {
#define LNET_REMOTE_NETS_HASH_SIZE (1 << the_lnet.ln_remote_nets_hbits)
typedef struct {
struct list_head lrn_list; /* chain on ln_remote_nets_hash */
struct list_head lrn_list; /* chain on
ln_remote_nets_hash */
struct list_head lrn_routes; /* routes to me */
__u32 lrn_net; /* my net number */
} lnet_remotenet_t;
......@@ -375,10 +388,12 @@ typedef struct {
typedef struct {
struct list_head rbp_bufs; /* my free buffer pool */
struct list_head rbp_msgs; /* messages blocking for a buffer */
struct list_head rbp_msgs; /* messages blocking
for a buffer */
int rbp_npages; /* # pages in each buffer */
int rbp_nbuffers; /* # buffers */
int rbp_credits; /* # free buffers / blocked messages */
int rbp_credits; /* # free buffers /
blocked messages */
int rbp_mincredits; /* low water mark */
} lnet_rtrbufpool_t;
......@@ -408,7 +423,8 @@ enum {
/* Options for lnet_portal_t::ptl_options */
#define LNET_PTL_LAZY (1 << 0)
#define LNET_PTL_MATCH_UNIQUE (1 << 1) /* unique match, for RDMA */
#define LNET_PTL_MATCH_WILDCARD (1 << 2) /* wildcard match, request portal */
#define LNET_PTL_MATCH_WILDCARD (1 << 2) /* wildcard match,
request portal */
/* parameter for matching operations (GET, PUT) */
struct lnet_match_info {
......@@ -575,7 +591,8 @@ typedef struct {
struct mutex ln_api_mutex;
struct mutex ln_lnd_mutex;
int ln_init; /* lnet_init() called? */
int ln_init; /* lnet_init()
called? */
/* Have I called LNetNIInit myself? */
int ln_niinit_self;
/* LNetNIInit/LNetNIFini counter */
......
......@@ -57,7 +57,8 @@
#define LSTIO_SESSION_INFO 0xC03 /* query session */
#define LSTIO_GROUP_ADD 0xC10 /* add group */
#define LSTIO_GROUP_LIST 0xC11 /* list all groups in session */
#define LSTIO_GROUP_INFO 0xC12 /* query default information of specified group */
#define LSTIO_GROUP_INFO 0xC12 /* query default information of
* specified group */
#define LSTIO_GROUP_DEL 0xC13 /* delete group */
#define LSTIO_NODES_ADD 0xC14 /* add nodes to specified group */
#define LSTIO_GROUP_UPDATE 0xC15 /* update group */
......@@ -105,17 +106,21 @@ typedef struct {
int tse_type; /* test type */
int tse_loop; /* loop count */
int tse_concur; /* concurrency of test */
} lstcon_test_ent_t; /*** test summary entry, for list_batch command */
} lstcon_test_ent_t; /*** test summary entry, for
*** list_batch command */
typedef struct {
int bae_state; /* batch status */
int bae_timeout; /* batch timeout */
int bae_ntest; /* # of tests in the batch */
} lstcon_batch_ent_t; /*** batch summary entry, for list_batch command */
} lstcon_batch_ent_t; /*** batch summary entry, for
*** list_batch command */
typedef struct {
lstcon_ndlist_ent_t tbe_cli_nle; /* client (group) node_list entry */
lstcon_ndlist_ent_t tbe_srv_nle; /* server (group) node_list entry */
lstcon_ndlist_ent_t tbe_cli_nle; /* client (group) node_list
* entry */
lstcon_ndlist_ent_t tbe_srv_nle; /* server (group) node_list
* entry */
union {
lstcon_test_ent_t tbe_test; /* test entry */
lstcon_batch_ent_t tbe_batch; /* batch entry */
......@@ -137,7 +142,10 @@ typedef struct {
} lstcon_rpc_ent_t;
typedef struct {
int trs_rpc_stat[4]; /* RPCs stat (0: total, 1: failed, 2: finished, 4: reserved */
int trs_rpc_stat[4]; /* RPCs stat (0: total
1: failed
2: finished
4: reserved */
int trs_rpc_errno; /* RPC errno */
int trs_fwk_stat[8]; /* framework stat */
int trs_fwk_errno; /* errno of the first remote error */
......@@ -270,15 +278,23 @@ typedef struct {
typedef struct {
int lstio_dbg_key; /* IN: session key */
int lstio_dbg_type; /* IN: debug sessin|batch|group|nodes list */
int lstio_dbg_flags; /* IN: reserved debug flags */
int lstio_dbg_timeout; /* IN: timeout of debug */
int lstio_dbg_type; /* IN: debug
session|batch|
group|nodes
list */
int lstio_dbg_flags; /* IN: reserved debug
flags */
int lstio_dbg_timeout; /* IN: timeout of
debug */
int lstio_dbg_nmlen; /* IN: len of name */
char *lstio_dbg_namep; /* IN: name of group|batch */
int lstio_dbg_count; /* IN: # of test nodes to debug */
lnet_process_id_t *lstio_dbg_idsp; /* IN: id of test nodes */
struct list_head *lstio_dbg_resultp; /* OUT: list head of result buffer */
char *lstio_dbg_namep; /* IN: name of
group|batch */
int lstio_dbg_count; /* IN: # of test nodes
to debug */
lnet_process_id_t *lstio_dbg_idsp; /* IN: id of test
nodes */
struct list_head *lstio_dbg_resultp; /* OUT: list head of
result buffer */
} lstio_debug_args_t;
typedef struct {
......@@ -294,7 +310,8 @@ typedef struct {
} lstio_group_del_args_t;
#define LST_GROUP_CLEAN 1 /* remove inactive nodes in the group */
#define LST_GROUP_REFRESH 2 /* refresh inactive nodes in the group */
#define LST_GROUP_REFRESH 2 /* refresh inactive nodes
* in the group */
#define LST_GROUP_RMND 3 /* delete nodes from the group */
typedef struct {
......@@ -305,7 +322,8 @@ typedef struct {
char *lstio_grp_namep; /* IN: group name */
int lstio_grp_count; /* IN: # of nodes id */
lnet_process_id_t *lstio_grp_idsp; /* IN: array of nodes */
struct list_head *lstio_grp_resultp; /* OUT: list head of result buffer */
struct list_head *lstio_grp_resultp; /* OUT: list head of
result buffer */
} lstio_group_update_args_t;
typedef struct {
......@@ -316,7 +334,8 @@ typedef struct {
/** OUT: session features */
unsigned *lstio_grp_featp;
lnet_process_id_t *lstio_grp_idsp; /* IN: nodes */
struct list_head *lstio_grp_resultp; /* OUT: list head of result buffer */
struct list_head *lstio_grp_resultp; /* OUT: list head of
result buffer */
} lstio_group_nodes_args_t;
typedef struct {
......@@ -330,8 +349,8 @@ typedef struct {
int lstio_grp_key; /* IN: session key */
int lstio_grp_nmlen; /* IN: name len */
char *lstio_grp_namep; /* IN: name */
lstcon_ndlist_ent_t *lstio_grp_entp; /* OUT: description of group */
lstcon_ndlist_ent_t *lstio_grp_entp; /* OUT: description of
group */
int *lstio_grp_idxp; /* IN/OUT: node index */
int *lstio_grp_ndentp; /* IN/OUT: # of nodent */
lstcon_node_ent_t *lstio_grp_dentsp; /* OUT: nodent array */
......@@ -353,28 +372,35 @@ typedef struct {
typedef struct {
int lstio_bat_key; /* IN: session key */
int lstio_bat_timeout; /* IN: timeout for the batch */
int lstio_bat_timeout; /* IN: timeout for
the batch */
int lstio_bat_nmlen; /* IN: name length */
char *lstio_bat_namep; /* IN: batch name */
struct list_head *lstio_bat_resultp; /* OUT: list head of result buffer */
struct list_head *lstio_bat_resultp; /* OUT: list head of
result buffer */
} lstio_batch_run_args_t;
typedef struct {
int lstio_bat_key; /* IN: session key */
int lstio_bat_force; /* IN: abort unfinished test RPC */
int lstio_bat_force; /* IN: abort unfinished
test RPC */
int lstio_bat_nmlen; /* IN: name length */
char *lstio_bat_namep; /* IN: batch name */
struct list_head *lstio_bat_resultp; /* OUT: list head of result buffer */
struct list_head *lstio_bat_resultp; /* OUT: list head of
result buffer */
} lstio_batch_stop_args_t;
typedef struct {
int lstio_bat_key; /* IN: session key */
int lstio_bat_testidx; /* IN: test index */
int lstio_bat_client; /* IN: is test client? */
int lstio_bat_timeout; /* IN: timeout for waiting */
int lstio_bat_client; /* IN: we testing
client? */
int lstio_bat_timeout; /* IN: timeout for
waiting */
int lstio_bat_nmlen; /* IN: name length */
char *lstio_bat_namep; /* IN: batch name */
struct list_head *lstio_bat_resultp; /* OUT: list head of result buffer */
struct list_head *lstio_bat_resultp; /* OUT: list head of
result buffer */
} lstio_batch_query_args_t;
typedef struct {
......@@ -388,7 +414,8 @@ typedef struct {
int lstio_bat_key; /* IN: session key */
int lstio_bat_nmlen; /* IN: name length */
char *lstio_bat_namep; /* IN: name */
int lstio_bat_server; /* IN: query server or not */
int lstio_bat_server; /* IN: query server
or not */
int lstio_bat_testidx; /* IN: test index */
lstcon_test_batch_ent_t *lstio_bat_entp; /* OUT: batch ent */
......@@ -400,12 +427,15 @@ typedef struct {
/* add stat in session */
typedef struct {
int lstio_sta_key; /* IN: session key */
int lstio_sta_timeout; /* IN: timeout for stat request */
int lstio_sta_nmlen; /* IN: group name length */
int lstio_sta_timeout; /* IN: timeout for
stat request */
int lstio_sta_nmlen; /* IN: group name
length */
char *lstio_sta_namep; /* IN: group name */
int lstio_sta_count; /* IN: # of pid */
lnet_process_id_t *lstio_sta_idsp; /* IN: pid */
struct list_head *lstio_sta_resultp; /* OUT: list head of result buffer */
struct list_head *lstio_sta_resultp; /* OUT: list head of
result buffer */
} lstio_stat_args_t;
typedef enum {
......@@ -425,20 +455,27 @@ typedef struct {
int lstio_tes_loop; /* IN: loop count */
int lstio_tes_concur; /* IN: concurrency */
int lstio_tes_dist; /* IN: node distribution in destination groups */
int lstio_tes_span; /* IN: node span in destination groups */
int lstio_tes_sgrp_nmlen; /* IN: source group name length */
int lstio_tes_dist; /* IN: node distribution in
destination groups */
int lstio_tes_span; /* IN: node span in
destination groups */
int lstio_tes_sgrp_nmlen; /* IN: source group
name length */
char *lstio_tes_sgrp_name; /* IN: group name */
int lstio_tes_dgrp_nmlen; /* IN: destination group name length */
int lstio_tes_dgrp_nmlen; /* IN: destination group
name length */
char *lstio_tes_dgrp_name; /* IN: group name */
int lstio_tes_param_len; /* IN: param buffer len */
void *lstio_tes_param; /* IN: parameter for specified test:
void *lstio_tes_param; /* IN: parameter for specified
test:
lstio_bulk_param_t,
lstio_ping_param_t,
... more */
int *lstio_tes_retp; /* OUT: private returned value */
struct list_head *lstio_tes_resultp; /* OUT: list head of result buffer */
int *lstio_tes_retp; /* OUT: private returned
value */
struct list_head *lstio_tes_resultp; /* OUT: list head of
result buffer */
} lstio_test_args_t;
typedef enum {
......
......@@ -79,7 +79,8 @@ typedef struct {
__u32 ksm_csum; /* checksum if != 0 */
__u64 ksm_zc_cookies[2]; /* Zero-Copy request/ACK cookie */
union {
ksock_lnet_msg_t lnetmsg; /* lnet message, it's empty if it's NOOP */
ksock_lnet_msg_t lnetmsg;/* lnet message, it's empty if
* it's NOOP */
} WIRE_ATTR ksm_u;
} WIRE_ATTR ksock_msg_t;
......@@ -91,8 +92,8 @@ socklnd_init_msg(ksock_msg_t *msg, int type)
msg->ksm_zc_cookies[0] = msg->ksm_zc_cookies[1] = 0;
}
#define KSOCK_MSG_NOOP 0xc0 /* ksm_u empty */
#define KSOCK_MSG_LNET 0xc1 /* lnet msg */
#define KSOCK_MSG_NOOP 0xC0 /* ksm_u empty */
#define KSOCK_MSG_LNET 0xC1 /* lnet msg */
/* We need to know this number to parse hello msg from ksocklnd in
* other LND (usocklnd, for example) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment