Commit 97d10d0a authored by Mike Shuey's avatar Mike Shuey Committed by Greg Kroah-Hartman

staging: lustre: lnet: socklnd: code cleanup - align spacing

Unify variable declarations to use a single space.  Also include several
miscellaneous whitespace cleanups, particularly in socklnd.h.
Signed-off-by: default avatarMike Shuey <shuey@purdue.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec3d17c0
......@@ -60,13 +60,11 @@ typedef struct /* per scheduler state */
{
spinlock_t kss_lock; /* serialise */
struct list_head kss_rx_conns; /* conn waiting to be read */
/* conn waiting to be written */
struct list_head kss_tx_conns;
/* zombie noop tx list */
struct list_head kss_zombie_noop_txs;
struct list_head kss_tx_conns; /* conn waiting to be written */
struct list_head kss_zombie_noop_txs; /* zombie noop tx list */
wait_queue_head_t kss_waitq; /* where scheduler sleeps */
/* # connections assigned to this scheduler */
int kss_nconns;
int kss_nconns; /* # connections assigned to
* this scheduler */
struct ksock_sched_info *kss_info; /* owner of it */
struct page *kss_rx_scratch_pgs[LNET_MAX_IOV];
struct kvec kss_scratch_iov[LNET_MAX_IOV];
......@@ -94,35 +92,48 @@ typedef struct /* in-use interface */
} ksock_interface_t;
typedef struct {
/* "stuck" socket timeout (seconds) */
int *ksnd_timeout;
/* # scheduler threads in each pool while starting */
int *ksnd_nscheds;
int *ksnd_timeout; /* "stuck" socket timeout
* (seconds) */
int *ksnd_nscheds; /* # scheduler threads in each
* pool while starting */
int *ksnd_nconnds; /* # connection daemons */
int *ksnd_nconnds_max; /* max # connection daemons */
int *ksnd_min_reconnectms; /* first connection retry after (ms)... */
int *ksnd_max_reconnectms; /* ...exponentially increasing to this */
int *ksnd_min_reconnectms; /* first connection retry after
* (ms)... */
int *ksnd_max_reconnectms; /* ...exponentially increasing to
* this */
int *ksnd_eager_ack; /* make TCP ack eagerly? */
int *ksnd_typed_conns; /* drive sockets by type? */
int *ksnd_min_bulk; /* smallest "large" message */
int *ksnd_tx_buffer_size; /* socket tx buffer size */
int *ksnd_rx_buffer_size; /* socket rx buffer size */
int *ksnd_nagle; /* enable NAGLE? */
int *ksnd_round_robin; /* round robin for multiple interfaces */
int *ksnd_keepalive; /* # secs for sending keepalive NOOP */
int *ksnd_keepalive_idle; /* # idle secs before 1st probe */
int *ksnd_round_robin; /* round robin for multiple
* interfaces */
int *ksnd_keepalive; /* # secs for sending keepalive
* NOOP */
int *ksnd_keepalive_idle; /* # idle secs before 1st probe
*/
int *ksnd_keepalive_count; /* # probes */
int *ksnd_keepalive_intvl; /* time between probes */
int *ksnd_credits; /* # concurrent sends */
int *ksnd_peertxcredits; /* # concurrent sends to 1 peer */
int *ksnd_peerrtrcredits; /* # per-peer router buffer credits */
int *ksnd_peertimeout; /* seconds to consider peer dead */
int *ksnd_peertxcredits; /* # concurrent sends to 1 peer
*/
int *ksnd_peerrtrcredits; /* # per-peer router buffer
* credits */
int *ksnd_peertimeout; /* seconds to consider peer dead
*/
int *ksnd_enable_csum; /* enable check sum */
int *ksnd_inject_csum_error; /* set non-zero to inject checksum error */
int *ksnd_nonblk_zcack; /* always send zc-ack on non-blocking connection */
unsigned int *ksnd_zc_min_payload; /* minimum zero copy payload size */
int *ksnd_zc_recv; /* enable ZC receive (for Chelsio TOE) */
int *ksnd_zc_recv_min_nfrags; /* minimum # of fragments to enable ZC receive */
int *ksnd_inject_csum_error; /* set non-zero to inject
* checksum error */
int *ksnd_nonblk_zcack; /* always send zc-ack on
* non-blocking connection */
unsigned int *ksnd_zc_min_payload; /* minimum zero copy payload
* size */
int *ksnd_zc_recv; /* enable ZC receive (for
* Chelsio TOE) */
int *ksnd_zc_recv_min_nfrags; /* minimum # of fragments to
* enable ZC receive */
} ksock_tunables_t;
typedef struct {
......@@ -141,49 +152,61 @@ typedef struct {
#define SOCKNAL_CONND_RESV 1
typedef struct {
int ksnd_init; /* initialisation state */
int ksnd_init; /* initialisation state
*/
int ksnd_nnets; /* # networks set up */
struct list_head ksnd_nets; /* list of nets */
/* stabilize peer/conn ops */
rwlock_t ksnd_global_lock;
/* hash table of all my known peers */
struct list_head *ksnd_peers;
rwlock_t ksnd_global_lock; /* stabilize peer/conn
* ops */
struct list_head *ksnd_peers; /* hash table of all my
* known peers */
int ksnd_peer_hash_size; /* size of ksnd_peers */
int ksnd_nthreads; /* # live threads */
int ksnd_shuttingdown; /* tell threads to exit */
/* schedulers information */
struct ksock_sched_info **ksnd_sched_info;
int ksnd_shuttingdown; /* tell threads to exit
*/
struct ksock_sched_info **ksnd_sched_info; /* schedulers info */
atomic_t ksnd_nactive_txs; /* #active txs */
struct list_head ksnd_deathrow_conns; /* conns to close: reaper_lock*/
struct list_head ksnd_zombie_conns; /* conns to free: reaper_lock */
struct list_head ksnd_enomem_conns; /* conns to retry: reaper_lock*/
struct list_head ksnd_deathrow_conns; /* conns to close:
* reaper_lock*/
struct list_head ksnd_zombie_conns; /* conns to free:
* reaper_lock */
struct list_head ksnd_enomem_conns; /* conns to retry:
* reaper_lock*/
wait_queue_head_t ksnd_reaper_waitq; /* reaper sleeps here */
unsigned long ksnd_reaper_waketime;/* when reaper will wake */
unsigned long ksnd_reaper_waketime; /* when reaper will wake
*/
spinlock_t ksnd_reaper_lock; /* serialise */
int ksnd_enomem_tx; /* test ENOMEM sender */
int ksnd_stall_tx; /* test sluggish sender */
int ksnd_stall_rx; /* test sluggish receiver */
int ksnd_stall_tx; /* test sluggish sender
*/
int ksnd_stall_rx; /* test sluggish
* receiver */
struct list_head ksnd_connd_connreqs; /* incoming connection requests */
struct list_head ksnd_connd_routes; /* routes waiting to be connected */
struct list_head ksnd_connd_connreqs; /* incoming connection
* requests */
struct list_head ksnd_connd_routes; /* routes waiting to be
* connected */
wait_queue_head_t ksnd_connd_waitq; /* connds sleep here */
int ksnd_connd_connecting;/* # connds connecting */
/** time stamp of the last failed connecting attempt */
long ksnd_connd_failed_stamp;
/** # starting connd */
unsigned ksnd_connd_starting;
/** time stamp of the last starting connd */
long ksnd_connd_starting_stamp;
/** # running connd */
unsigned ksnd_connd_running;
int ksnd_connd_connecting; /* # connds connecting
*/
long ksnd_connd_failed_stamp;/* time stamp of the
* last failed
* connecting attempt */
unsigned ksnd_connd_starting; /* # starting connd */
long ksnd_connd_starting_stamp;/* time stamp of the
* last starting connd
*/
unsigned ksnd_connd_running; /* # running connd */
spinlock_t ksnd_connd_lock; /* serialise */
struct list_head ksnd_idle_noop_txs; /* list head for freed noop tx */
spinlock_t ksnd_tx_lock; /* serialise, g_lock unsafe */
struct list_head ksnd_idle_noop_txs; /* list head for freed
* noop tx */
spinlock_t ksnd_tx_lock; /* serialise, g_lock
* unsafe */
} ksock_nal_data_t;
......@@ -207,7 +230,8 @@ struct ksock_proto; /* forward ref */
typedef struct /* transmit packet */
{
struct list_head tx_list; /* queue on conn for transmission etc */
struct list_head tx_list; /* queue on conn for transmission etc
*/
struct list_head tx_zc_list; /* queue on peer for ZC request */
atomic_t tx_refcount; /* tx reference count */
int tx_nob; /* # packet bytes */
......@@ -221,7 +245,8 @@ typedef struct /* transmit packet */
unsigned short tx_nonblk:1; /* it's a non-blocking ACK */
lnet_kiov_t *tx_kiov; /* packet page frags */
struct ksock_conn *tx_conn; /* owning conn */
lnet_msg_t *tx_lnetmsg; /* lnet message for lnet_finalize() */
lnet_msg_t *tx_lnetmsg; /* lnet message for lnet_finalize()
*/
unsigned long tx_deadline; /* when (in jiffies) tx times out */
ksock_msg_t tx_msg; /* socklnd message buffer */
int tx_desc_size; /* size of this descriptor */
......@@ -259,37 +284,44 @@ typedef struct ksock_conn {
struct ksock_route *ksnc_route; /* owning route */
struct list_head ksnc_list; /* stash on peer's conn list */
struct socket *ksnc_sock; /* actual socket */
void *ksnc_saved_data_ready; /* socket's original data_ready() callback */
void *ksnc_saved_write_space; /* socket's original write_space() callback */
atomic_t ksnc_conn_refcount; /* conn refcount */
atomic_t ksnc_sock_refcount; /* sock refcount */
ksock_sched_t *ksnc_scheduler; /* who schedules this connection */
void *ksnc_saved_data_ready; /* socket's original
* data_ready() callback */
void *ksnc_saved_write_space; /* socket's original
* write_space() callback */
atomic_t ksnc_conn_refcount;/* conn refcount */
atomic_t ksnc_sock_refcount;/* sock refcount */
ksock_sched_t *ksnc_scheduler; /* who schedules this connection
*/
__u32 ksnc_myipaddr; /* my IP */
__u32 ksnc_ipaddr; /* peer's IP */
int ksnc_port; /* peer's port */
signed int ksnc_type:3; /* type of connection,
* should be signed value */
signed int ksnc_type:3; /* type of connection, should be
* signed value */
unsigned int ksnc_closing:1; /* being shut down */
unsigned int ksnc_flip:1; /* flip or not, only for V2.x */
unsigned int ksnc_zc_capable:1; /* enable to ZC */
struct ksock_proto *ksnc_proto; /* protocol for the connection */
/* reader */
struct list_head ksnc_rx_list; /* where I enq waiting input or a forwarding descriptor */
unsigned long ksnc_rx_deadline; /* when (in jiffies) receive times out */
struct list_head ksnc_rx_list; /* where I enq waiting input or a
* forwarding descriptor */
unsigned long ksnc_rx_deadline; /* when (in jiffies) receive times
* out */
__u8 ksnc_rx_started; /* started receiving a message */
__u8 ksnc_rx_ready; /* data ready to read */
__u8 ksnc_rx_scheduled;/* being progressed */
__u8 ksnc_rx_scheduled; /* being progressed */
__u8 ksnc_rx_state; /* what is being read */
int ksnc_rx_nob_left; /* # bytes to next hdr/body */
int ksnc_rx_nob_wanted; /* bytes actually wanted */
int ksnc_rx_nob_wanted;/* bytes actually wanted */
int ksnc_rx_niov; /* # iovec frags */
struct kvec *ksnc_rx_iov; /* the iovec frags */
int ksnc_rx_nkiov; /* # page frags */
lnet_kiov_t *ksnc_rx_kiov; /* the page frags */
ksock_rxiovspace_t ksnc_rx_iov_space;/* space for frag descriptors */
__u32 ksnc_rx_csum; /* partial checksum for incoming data */
void *ksnc_cookie; /* rx lnet_finalize passthru arg */
ksock_rxiovspace_t ksnc_rx_iov_space; /* space for frag descriptors */
__u32 ksnc_rx_csum; /* partial checksum for incoming
* data */
void *ksnc_cookie; /* rx lnet_finalize passthru arg
*/
ksock_msg_t ksnc_msg; /* incoming message buffer:
* V2.x message takes the
* whole struct
......@@ -298,15 +330,19 @@ typedef struct ksock_conn {
* ksnc_msg.ksm_u.lnetmsg */
/* WRITER */
struct list_head ksnc_tx_list; /* where I enq waiting for output space */
struct list_head ksnc_tx_list; /* where I enq waiting for output
* space */
struct list_head ksnc_tx_queue; /* packets waiting to be sent */
ksock_tx_t *ksnc_tx_carrier; /* next TX that can carry a LNet message or ZC-ACK */
unsigned long ksnc_tx_deadline; /* when (in jiffies) tx times out */
ksock_tx_t *ksnc_tx_carrier; /* next TX that can carry a LNet
* message or ZC-ACK */
unsigned long ksnc_tx_deadline; /* when (in jiffies) tx times out
*/
int ksnc_tx_bufnob; /* send buffer marker */
atomic_t ksnc_tx_nob; /* # bytes queued */
int ksnc_tx_ready; /* write space */
int ksnc_tx_scheduled; /* being progressed */
unsigned long ksnc_tx_last_post; /* time stamp of the last posted TX */
unsigned long ksnc_tx_last_post; /* time stamp of the last posted
* TX */
} ksock_conn_t;
typedef struct ksock_route {
......@@ -314,42 +350,52 @@ typedef struct ksock_route {
struct list_head ksnr_connd_list; /* chain on ksnr_connd_routes */
struct ksock_peer *ksnr_peer; /* owning peer */
atomic_t ksnr_refcount; /* # users */
unsigned long ksnr_timeout; /* when (in jiffies) reconnection can happen next */
unsigned long ksnr_timeout; /* when (in jiffies) reconnection
* can happen next */
long ksnr_retry_interval; /* how long between retries */
__u32 ksnr_myipaddr; /* my IP */
__u32 ksnr_ipaddr; /* IP address to connect to */
int ksnr_port; /* port to connect to */
unsigned int ksnr_scheduled:1; /* scheduled for attention */
unsigned int ksnr_connecting:1;/* connection establishment in progress */
unsigned int ksnr_connected:4; /* connections established by type */
unsigned int ksnr_connecting:1; /* connection establishment in
* progress */
unsigned int ksnr_connected:4; /* connections established by
* type */
unsigned int ksnr_deleted:1; /* been removed from peer? */
unsigned int ksnr_share_count; /* created explicitly? */
int ksnr_conn_count; /* # conns established by this route */
int ksnr_conn_count; /* # conns established by this
* route */
} ksock_route_t;
#define SOCKNAL_KEEPALIVE_PING 1 /* cookie for keepalive ping */
typedef struct ksock_peer {
struct list_head ksnp_list; /* stash on global peer list */
unsigned long ksnp_last_alive; /* when (in jiffies) I was last alive */
unsigned long ksnp_last_alive; /* when (in jiffies) I was last
* alive */
lnet_process_id_t ksnp_id; /* who's on the other end(s) */
atomic_t ksnp_refcount; /* # users */
int ksnp_sharecount; /* lconf usage counter */
int ksnp_closing; /* being closed */
int ksnp_accepting;/* # passive connections pending */
int ksnp_accepting; /* # passive connections pending
*/
int ksnp_error; /* errno on closing last conn */
__u64 ksnp_zc_next_cookie;/* ZC completion cookie */
__u64 ksnp_incarnation; /* latest known peer incarnation */
__u64 ksnp_zc_next_cookie; /* ZC completion cookie */
__u64 ksnp_incarnation; /* latest known peer incarnation
*/
struct ksock_proto *ksnp_proto; /* latest known peer protocol */
struct list_head ksnp_conns; /* all active connections */
struct list_head ksnp_routes; /* routes */
struct list_head ksnp_tx_queue; /* waiting packets */
spinlock_t ksnp_lock; /* serialize, g_lock unsafe */
struct list_head ksnp_zc_req_list; /* zero copy requests wait for ACK */
struct list_head ksnp_zc_req_list; /* zero copy requests wait for
* ACK */
unsigned long ksnp_send_keepalive; /* time to send keepalive */
lnet_ni_t *ksnp_ni; /* which network */
int ksnp_n_passive_ips; /* # of... */
__u32 ksnp_passive_ips[LNET_MAX_INTERFACES]; /* preferred local interfaces */
/* preferred local interfaces */
__u32 ksnp_passive_ips[LNET_MAX_INTERFACES];
} ksock_peer_t;
typedef struct ksock_connreq {
......@@ -363,23 +409,43 @@ extern ksock_tunables_t ksocknal_tunables;
#define SOCKNAL_MATCH_NO 0 /* TX can't match type of connection */
#define SOCKNAL_MATCH_YES 1 /* TX matches type of connection */
#define SOCKNAL_MATCH_MAY 2 /* TX can be sent on the connection, but not preferred */
#define SOCKNAL_MATCH_MAY 2 /* TX can be sent on the connection, but not
* preferred */
typedef struct ksock_proto {
int pro_version; /* version number of protocol */
int (*pro_send_hello)(ksock_conn_t *, ksock_hello_msg_t *); /* handshake function */
int (*pro_recv_hello)(ksock_conn_t *, ksock_hello_msg_t *, int);/* handshake function */
void (*pro_pack)(ksock_tx_t *); /* message pack */
void (*pro_unpack)(ksock_msg_t *); /* message unpack */
ksock_tx_t *(*pro_queue_tx_msg)(ksock_conn_t *, ksock_tx_t *); /* queue tx on the connection */
int (*pro_queue_tx_zcack)(ksock_conn_t *, ksock_tx_t *, __u64); /* queue ZC ack on the connection */
int (*pro_handle_zcreq)(ksock_conn_t *, __u64, int); /* handle ZC request */
int (*pro_handle_zcack)(ksock_conn_t *, __u64, __u64); /* handle ZC ACK */
int (*pro_match_tx)(ksock_conn_t *, ksock_tx_t *, int); /* msg type matches the connection type:
/* version number of protocol */
int pro_version;
/* handshake function */
int (*pro_send_hello)(ksock_conn_t *, ksock_hello_msg_t *);
/* handshake function */
int (*pro_recv_hello)(ksock_conn_t *, ksock_hello_msg_t *, int);
/* message pack */
void (*pro_pack)(ksock_tx_t *);
/* message unpack */
void (*pro_unpack)(ksock_msg_t *);
/* queue tx on the connection */
ksock_tx_t *(*pro_queue_tx_msg)(ksock_conn_t *, ksock_tx_t *);
/* queue ZC ack on the connection */
int (*pro_queue_tx_zcack)(ksock_conn_t *, ksock_tx_t *, __u64);
/* handle ZC request */
int (*pro_handle_zcreq)(ksock_conn_t *, __u64, int);
/* handle ZC ACK */
int (*pro_handle_zcack)(ksock_conn_t *, __u64, __u64);
/* msg type matches the connection type:
* return value:
* return MATCH_NO : no
* return MATCH_YES : matching type
* return MATCH_MAY : can be backup */
int (*pro_match_tx)(ksock_conn_t *, ksock_tx_t *, int);
} ksock_proto_t;
extern ksock_proto_t ksocknal_protocol_v1x;
......
......@@ -114,7 +114,7 @@ ksocknal_send_iov (ksock_conn_t *conn, ksock_tx_t *tx)
int nob;
int rc;
LASSERT (tx->tx_niov > 0);
LASSERT(tx->tx_niov > 0);
/* Never touch tx->tx_iov inside ksocknal_lib_send_iov() */
rc = ksocknal_lib_send_iov(conn, tx);
......@@ -128,7 +128,7 @@ ksocknal_send_iov (ksock_conn_t *conn, ksock_tx_t *tx)
/* "consume" iov */
do {
LASSERT (tx->tx_niov > 0);
LASSERT(tx->tx_niov > 0);
if (nob < (int) iov->iov_len) {
iov->iov_base = (void *)((char *)iov->iov_base + nob);
......@@ -151,8 +151,8 @@ ksocknal_send_kiov (ksock_conn_t *conn, ksock_tx_t *tx)
int nob;
int rc;
LASSERT (tx->tx_niov == 0);
LASSERT (tx->tx_nkiov > 0);
LASSERT(tx->tx_niov == 0);
LASSERT(tx->tx_nkiov > 0);
/* Never touch tx->tx_kiov inside ksocknal_lib_send_kiov() */
rc = ksocknal_lib_send_kiov(conn, tx);
......@@ -193,7 +193,7 @@ ksocknal_transmit (ksock_conn_t *conn, ksock_tx_t *tx)
schedule_timeout(cfs_time_seconds(ksocknal_data.ksnd_stall_tx));
}
LASSERT (tx->tx_resid != 0);
LASSERT(tx->tx_resid != 0);
rc = ksocknal_connsock_addref(conn);
if (rc != 0) {
......@@ -255,7 +255,7 @@ ksocknal_recv_iov (ksock_conn_t *conn)
int nob;
int rc;
LASSERT (conn->ksnc_rx_niov > 0);
LASSERT(conn->ksnc_rx_niov > 0);
/* Never touch conn->ksnc_rx_iov or change connection
* status inside ksocknal_lib_recv_iov */
......@@ -277,7 +277,7 @@ ksocknal_recv_iov (ksock_conn_t *conn)
conn->ksnc_rx_nob_left -= nob;
do {
LASSERT (conn->ksnc_rx_niov > 0);
LASSERT(conn->ksnc_rx_niov > 0);
if (nob < (int)iov->iov_len) {
iov->iov_len -= nob;
......@@ -299,7 +299,7 @@ ksocknal_recv_kiov (ksock_conn_t *conn)
lnet_kiov_t *kiov = conn->ksnc_rx_kiov;
int nob;
int rc;
LASSERT (conn->ksnc_rx_nkiov > 0);
LASSERT(conn->ksnc_rx_nkiov > 0);
/* Never touch conn->ksnc_rx_kiov or change connection
* status inside ksocknal_lib_recv_iov */
......@@ -321,7 +321,7 @@ ksocknal_recv_kiov (ksock_conn_t *conn)
conn->ksnc_rx_nob_left -= nob;
do {
LASSERT (conn->ksnc_rx_nkiov > 0);
LASSERT(conn->ksnc_rx_nkiov > 0);
if (nob < (int) kiov->kiov_len) {
kiov->kiov_offset += nob;
......@@ -410,7 +410,7 @@ ksocknal_txlist_done (lnet_ni_t *ni, struct list_head *txlist, int error)
ksock_tx_t *tx;
while (!list_empty (txlist)) {
tx = list_entry (txlist->next, ksock_tx_t, tx_list);
tx = list_entry(txlist->next, ksock_tx_t, tx_list);
if (error && tx->tx_lnetmsg != NULL) {
CNETERR("Deleting packet type %d len %d %s->%s\n",
......@@ -422,10 +422,10 @@ ksocknal_txlist_done (lnet_ni_t *ni, struct list_head *txlist, int error)
CNETERR("Deleting noop packet\n");
}
list_del (&tx->tx_list);
list_del(&tx->tx_list);
LASSERT (atomic_read(&tx->tx_refcount) == 1);
ksocknal_tx_done (ni, tx);
LASSERT(atomic_read(&tx->tx_refcount) == 1);
ksocknal_tx_done(ni, tx);
}
}
......@@ -441,8 +441,8 @@ ksocknal_check_zc_req(ksock_tx_t *tx)
* she has received this message to tell us we can signal completion.
* tx_msg.ksm_zc_cookies[0] remains non-zero while tx is on
* ksnp_zc_req_list. */
LASSERT (tx->tx_msg.ksm_type != KSOCK_MSG_NOOP);
LASSERT (tx->tx_zc_capable);
LASSERT(tx->tx_msg.ksm_type != KSOCK_MSG_NOOP);
LASSERT(tx->tx_zc_capable);
tx->tx_zc_checked = 1;
......@@ -461,7 +461,7 @@ ksocknal_check_zc_req(ksock_tx_t *tx)
tx->tx_deadline =
cfs_time_shift(*ksocknal_tunables.ksnd_timeout);
LASSERT (tx->tx_msg.ksm_zc_cookies[0] == 0);
LASSERT(tx->tx_msg.ksm_zc_cookies[0] == 0);
tx->tx_msg.ksm_zc_cookies[0] = peer->ksnp_zc_next_cookie++;
......@@ -509,7 +509,7 @@ ksocknal_process_transmit (ksock_conn_t *conn, ksock_tx_t *tx)
rc = ksocknal_transmit (conn, tx);
CDEBUG (D_NET, "send(%d) %d\n", tx->tx_resid, rc);
CDEBUG(D_NET, "send(%d) %d\n", tx->tx_resid, rc);
if (tx->tx_resid == 0) {
/* Sent everything OK */
......@@ -546,7 +546,7 @@ ksocknal_process_transmit (ksock_conn_t *conn, ksock_tx_t *tx)
}
/* Actual error */
LASSERT (rc < 0);
LASSERT(rc < 0);
if (!conn->ksnc_closing) {
switch (rc) {
......@@ -582,9 +582,9 @@ ksocknal_launch_connection_locked (ksock_route_t *route)
/* called holding write lock on ksnd_global_lock */
LASSERT (!route->ksnr_scheduled);
LASSERT (!route->ksnr_connecting);
LASSERT ((ksocknal_route_mask() & ~route->ksnr_connected) != 0);
LASSERT(!route->ksnr_scheduled);
LASSERT(!route->ksnr_connecting);
LASSERT((ksocknal_route_mask() & ~route->ksnr_connected) != 0);
route->ksnr_scheduled = 1; /* scheduling conn for connd */
ksocknal_route_addref(route); /* extra ref for connd */
......@@ -630,8 +630,8 @@ ksocknal_find_conn_locked(ksock_peer_t *peer, ksock_tx_t *tx, int nonblk)
c->ksnc_sock->sk->sk_wmem_queued;
int rc;
LASSERT (!c->ksnc_closing);
LASSERT (c->ksnc_proto != NULL &&
LASSERT(!c->ksnc_closing);
LASSERT(c->ksnc_proto != NULL &&
c->ksnc_proto->pro_match_tx != NULL);
rc = c->ksnc_proto->pro_match_tx(c, tx, nonblk);
......@@ -708,11 +708,11 @@ ksocknal_queue_tx_locked (ksock_tx_t *tx, ksock_conn_t *conn)
*
* We always expect at least 1 mapped fragment containing the
* complete ksocknal message header. */
LASSERT (lnet_iov_nob (tx->tx_niov, tx->tx_iov) +
LASSERT(lnet_iov_nob (tx->tx_niov, tx->tx_iov) +
lnet_kiov_nob(tx->tx_nkiov, tx->tx_kiov) ==
(unsigned int)tx->tx_nob);
LASSERT (tx->tx_niov >= 1);
LASSERT (tx->tx_resid == tx->tx_nob);
LASSERT(tx->tx_niov >= 1);
LASSERT(tx->tx_resid == tx->tx_nob);
CDEBUG (D_NET, "Packet %p type %d, nob %d niov %d nkiov %d\n",
tx, (tx->tx_lnetmsg != NULL) ? tx->tx_lnetmsg->msg_hdr.type:
......@@ -739,8 +739,8 @@ ksocknal_queue_tx_locked (ksock_tx_t *tx, ksock_conn_t *conn)
if (msg->ksm_type == KSOCK_MSG_NOOP) {
/* The packet is noop ZC ACK, try to piggyback the ack_cookie
* on a normal packet so I don't need to send it */
LASSERT (msg->ksm_zc_cookies[1] != 0);
LASSERT (conn->ksnc_proto->pro_queue_tx_zcack != NULL);
LASSERT(msg->ksm_zc_cookies[1] != 0);
LASSERT(conn->ksnc_proto->pro_queue_tx_zcack != NULL);
if (conn->ksnc_proto->pro_queue_tx_zcack(conn, tx, 0))
ztx = tx; /* ZC ACK piggybacked on ztx release tx later */
......@@ -748,8 +748,8 @@ ksocknal_queue_tx_locked (ksock_tx_t *tx, ksock_conn_t *conn)
} else {
/* It's a normal packet - can it piggback a noop zc-ack that
* has been queued already? */
LASSERT (msg->ksm_zc_cookies[1] == 0);
LASSERT (conn->ksnc_proto->pro_queue_tx_msg != NULL);
LASSERT(msg->ksm_zc_cookies[1] == 0);
LASSERT(conn->ksnc_proto->pro_queue_tx_msg != NULL);
ztx = conn->ksnc_proto->pro_queue_tx_msg(conn, tx);
/* ztx will be released later */
......@@ -784,7 +784,7 @@ ksocknal_find_connectable_route_locked (ksock_peer_t *peer)
list_for_each (tmp, &peer->ksnp_routes) {
route = list_entry (tmp, ksock_route_t, ksnr_list);
LASSERT (!route->ksnr_connecting || route->ksnr_scheduled);
LASSERT(!route->ksnr_connecting || route->ksnr_scheduled);
if (route->ksnr_scheduled) /* connections being established */
continue;
......@@ -819,7 +819,7 @@ ksocknal_find_connecting_route_locked (ksock_peer_t *peer)
list_for_each (tmp, &peer->ksnp_routes) {
route = list_entry (tmp, ksock_route_t, ksnr_list);
LASSERT (!route->ksnr_connecting || route->ksnr_scheduled);
LASSERT(!route->ksnr_connecting || route->ksnr_scheduled);
if (route->ksnr_scheduled)
return route;
......@@ -837,7 +837,7 @@ ksocknal_launch_packet (lnet_ni_t *ni, ksock_tx_t *tx, lnet_process_id_t id)
int retry;
int rc;
LASSERT (tx->tx_conn == NULL);
LASSERT(tx->tx_conn == NULL);
g_lock = &ksocknal_data.ksnd_global_lock;
......@@ -940,8 +940,8 @@ ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
CDEBUG(D_NET, "sending %u bytes in %d frags to %s\n",
payload_nob, payload_niov, libcfs_id2str(target));
LASSERT (payload_nob == 0 || payload_niov > 0);
LASSERT (payload_niov <= LNET_MAX_IOV);
LASSERT(payload_nob == 0 || payload_niov > 0);
LASSERT(payload_niov <= LNET_MAX_IOV);
/* payload is either all vaddrs or all pages */
LASSERT (!(payload_kiov != NULL && payload_iov != NULL));
LASSERT (!in_interrupt ());
......@@ -1116,7 +1116,7 @@ ksocknal_process_receive (ksock_conn_t *conn)
/* NB: sched lock NOT held */
/* SOCKNAL_RX_LNET_HEADER is here for backward compatibility */
LASSERT (conn->ksnc_rx_state == SOCKNAL_RX_KSM_HEADER ||
LASSERT(conn->ksnc_rx_state == SOCKNAL_RX_KSM_HEADER ||
conn->ksnc_rx_state == SOCKNAL_RX_LNET_PAYLOAD ||
conn->ksnc_rx_state == SOCKNAL_RX_LNET_HEADER ||
conn->ksnc_rx_state == SOCKNAL_RX_SLOP);
......@@ -1305,7 +1305,7 @@ ksocknal_process_receive (ksock_conn_t *conn)
}
/* Not Reached */
LBUG ();
LBUG();
return -EINVAL; /* keep gcc happy */
}
......@@ -1317,8 +1317,8 @@ ksocknal_recv (lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
ksock_conn_t *conn = (ksock_conn_t *)private;
ksock_sched_t *sched = conn->ksnc_scheduler;
LASSERT (mlen <= rlen);
LASSERT (niov <= LNET_MAX_IOV);
LASSERT(mlen <= rlen);
LASSERT(niov <= LNET_MAX_IOV);
conn->ksnc_cookie = msg;
conn->ksnc_rx_nob_wanted = mlen;
......@@ -1340,11 +1340,11 @@ ksocknal_recv (lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
niov, kiov, offset, mlen);
}
LASSERT (mlen ==
lnet_iov_nob (conn->ksnc_rx_niov, conn->ksnc_rx_iov) +
lnet_kiov_nob (conn->ksnc_rx_nkiov, conn->ksnc_rx_kiov));
LASSERT(mlen ==
lnet_iov_nob(conn->ksnc_rx_niov, conn->ksnc_rx_iov) +
lnet_kiov_nob(conn->ksnc_rx_nkiov, conn->ksnc_rx_kiov));
LASSERT (conn->ksnc_rx_scheduled);
LASSERT(conn->ksnc_rx_scheduled);
spin_lock_bh(&sched->kss_lock);
......@@ -1455,7 +1455,7 @@ int ksocknal_scheduler(void *arg)
}
if (!list_empty (&sched->kss_tx_conns)) {
LIST_HEAD (zlist);
LIST_HEAD(zlist);
if (!list_empty(&sched->kss_zombie_noop_txs)) {
list_add(&zlist,
......@@ -1513,9 +1513,9 @@ int ksocknal_scheduler(void *arg)
/* Do nothing; after a short timeout, this
* conn will be reposted on kss_tx_conns. */
} else if (conn->ksnc_tx_ready &&
!list_empty (&conn->ksnc_tx_queue)) {
!list_empty(&conn->ksnc_tx_queue)) {
/* reschedule for tx */
list_add_tail (&conn->ksnc_tx_list,
list_add_tail(&conn->ksnc_tx_list,
&sched->kss_tx_conns);
} else {
conn->ksnc_tx_scheduled = 0;
......@@ -1634,7 +1634,7 @@ ksocknal_parse_proto_version (ksock_hello_msg_t *hello)
if (hello->kshm_magic == le32_to_cpu(LNET_PROTO_TCP_MAGIC)) {
lnet_magicversion_t *hmv = (lnet_magicversion_t *)hello;
CLASSERT (sizeof (lnet_magicversion_t) ==
CLASSERT(sizeof (lnet_magicversion_t) ==
offsetof (ksock_hello_msg_t, kshm_src_nid));
if (hmv->version_major == cpu_to_le16 (KSOCK_PROTO_V1_MAJOR) &&
......@@ -1652,10 +1652,10 @@ ksocknal_send_hello (lnet_ni_t *ni, ksock_conn_t *conn,
/* CAVEAT EMPTOR: this byte flips 'ipaddrs' */
ksock_net_t *net = (ksock_net_t *)ni->ni_data;
LASSERT (hello->kshm_nips <= LNET_MAX_INTERFACES);
LASSERT(hello->kshm_nips <= LNET_MAX_INTERFACES);
/* rely on caller to hold a ref on socket so it wouldn't disappear */
LASSERT (conn->ksnc_proto != NULL);
LASSERT(conn->ksnc_proto != NULL);
hello->kshm_src_nid = ni->ni_nid;
hello->kshm_dst_nid = peer_nid;
......@@ -1702,7 +1702,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
lnet_process_id_t recv_id;
/* socket type set on active connections - not set on passive */
LASSERT (!active == !(conn->ksnc_type != SOCKLND_CONN_NONE));
LASSERT(!active == !(conn->ksnc_type != SOCKLND_CONN_NONE));
timeout = active ? *ksocknal_tunables.ksnd_timeout :
lnet_acceptor_timeout();
......@@ -1731,7 +1731,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
if (rc != 0) {
CERROR("Error %d reading HELLO from %pI4h\n",
rc, &conn->ksnc_ipaddr);
LASSERT (rc < 0);
LASSERT(rc < 0);
return rc;
}
......@@ -1765,7 +1765,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
if (rc != 0) {
CERROR("Error %d reading or checking hello from from %pI4h\n",
rc, &conn->ksnc_ipaddr);
LASSERT (rc < 0);
LASSERT(rc < 0);
return rc;
}
......@@ -1830,7 +1830,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
static int
ksocknal_connect (ksock_route_t *route)
{
LIST_HEAD (zombies);
LIST_HEAD(zombies);
ksock_peer_t *peer = route->ksnr_peer;
int type;
int wanted;
......@@ -1844,8 +1844,8 @@ ksocknal_connect (ksock_route_t *route)
write_lock_bh(&ksocknal_data.ksnd_global_lock);
LASSERT (route->ksnr_scheduled);
LASSERT (!route->ksnr_connecting);
LASSERT(route->ksnr_scheduled);
LASSERT(!route->ksnr_connecting);
route->ksnr_connecting = 1;
......@@ -2130,7 +2130,7 @@ ksocknal_connd (void *arg)
int nloops = 0;
int cons_retry = 0;
cfs_block_allsigs ();
cfs_block_allsigs();
init_waitqueue_entry(&wait, current);
......@@ -2244,7 +2244,7 @@ ksocknal_find_timed_out_conn (ksock_peer_t *peer)
conn = list_entry (ctmp, ksock_conn_t, ksnc_list);
/* Don't need the {get,put}connsock dance to deref ksnc_sock */
LASSERT (!conn->ksnc_closing);
LASSERT(!conn->ksnc_closing);
/* SOCK_ERROR will reset error code of socket in
* some platform (like Darwin8.x) */
......@@ -2314,7 +2314,7 @@ static inline void
ksocknal_flush_stale_txs(ksock_peer_t *peer)
{
ksock_tx_t *tx;
LIST_HEAD (stale_txs);
LIST_HEAD(stale_txs);
write_lock_bh(&ksocknal_data.ksnd_global_lock);
......@@ -2509,7 +2509,7 @@ ksocknal_reaper (void *arg)
int peer_index = 0;
unsigned long deadline = cfs_time_current();
cfs_block_allsigs ();
cfs_block_allsigs();
INIT_LIST_HEAD(&enomem_conns);
init_waitqueue_entry(&wait, current);
......
......@@ -357,10 +357,10 @@ ksocknal_lib_recv_kiov(ksock_conn_t *conn)
for (i = 0, sum = rc; sum > 0; i++, sum -= fragnob) {
LASSERT(i < niov);
/* Dang! have to kmap again because I have nowhere to stash the
* mapped address. But by doing it while the page is still
* mapped, the kernel just bumps the map count and returns me
* the address it stashed. */
/* Dang! have to kmap again because I have nowhere to
* stash the mapped address. But by doing it while the
* page is still mapped, the kernel just bumps the map
* count and returns me the address it stashed. */
base = kmap(kiov[i].kiov_page) + kiov[i].kiov_offset;
fragnob = kiov[i].kiov_len;
if (fragnob > sum)
......
......@@ -145,7 +145,6 @@ ksock_tunables_t ksocknal_tunables;
int ksocknal_tunables_init(void)
{
/* initialize ksocknal_tunables structure */
ksocknal_tunables.ksnd_timeout = &sock_timeout;
ksocknal_tunables.ksnd_nscheds = &nscheds;
......@@ -175,8 +174,6 @@ int ksocknal_tunables_init(void)
ksocknal_tunables.ksnd_zc_recv = &zc_recv;
ksocknal_tunables.ksnd_zc_recv_min_nfrags = &zc_recv_min_nfrags;
#if SOCKNAL_VERSION_DEBUG
ksocknal_tunables.ksnd_protocol = &protocol;
#endif
......
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