__swab64s(&msg->ibm_dststamp);
}
+ if (msg->ibm_srcnid == PTL_NID_ANY) {
+ CERROR("Bad src nid: "LPX64"\n", msg->ibm_srcnid);
+ return -EPROTO;
+ }
+
switch (msg->ibm_type) {
default:
CERROR("Unknown message type %x\n", msg->ibm_type);
long pid;
int rc;
- CDEBUG(D_WARNING, "Starting listener\n");
+ CDEBUG(D_NET, "Starting listener\n");
/* Called holding kib_nid_mutex: listener stopped */
LASSERT (kibnal_data.kib_listener_sock == NULL);
rc = kibnal_data.kib_listener_shutdown;
LASSERT ((rc != 0) == (kibnal_data.kib_listener_sock == NULL));
- CDEBUG(D_WARNING, "Listener %ld started OK\n", pid);
+ CDEBUG((rc == 0) ? D_WARNING : D_ERROR,
+ "Listener %s: pid:%ld port:%d backlog:%d\n",
+ (rc == 0) ? "started OK" : "startup failed",
+ pid, kibnal_tunables.kib_port, kibnal_tunables.kib_backlog);
+
return rc;
}
kib_acceptsock_t *as;
unsigned long flags;
- CDEBUG(D_WARNING, "Stopping listener\n");
+ CDEBUG(D_NET, "Stopping listener\n");
/* Called holding kib_nid_mutex: listener running */
LASSERT (kibnal_data.kib_listener_sock != NULL);
down(&kibnal_data.kib_listener_signal);
LASSERT (kibnal_data.kib_listener_sock == NULL);
- CDEBUG(D_WARNING, "Listener stopped\n");
+ CWARN("Listener stopped\n");
if (!clear_acceptq)
return;
}
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
int
kibnal_listener_procint(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp)
+#else
+int
+kibnal_listener_procint(ctl_table *table, int write, struct file *filp,
+ void *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
int *tunable = (int *)table->data;
int old_val;
tunable == &kibnal_tunables.kib_backlog);
old_val = *tunable;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
rc = proc_dointvec(table, write, filp, buffer, lenp);
-
+#else
+ rc = proc_dointvec(table, write, filp, buffer, lenp, ppos);
+#endif
if (write &&
(*tunable != old_val ||
kibnal_data.kib_listener_sock == NULL)) {
kibnal_stop_ip_listener(0);
rc = kibnal_start_ip_listener();
-
if (rc != 0) {
CERROR("Unable to restart listener with new tunable:"
" reverting to old value\n");
INIT_LIST_HEAD (&peer->ibp_list); /* not in the peer table yet */
INIT_LIST_HEAD (&peer->ibp_conns);
INIT_LIST_HEAD (&peer->ibp_tx_queue);
+ INIT_LIST_HEAD (&peer->ibp_connd_list); /* not queued for connecting */
peer->ibp_reconnect_time = jiffies;
peer->ibp_reconnect_interval = IBNAL_MIN_RECONNECT_INTERVAL;
LASSERT (peer->ibp_persistence == 0);
LASSERT (!kibnal_peer_active(peer));
LASSERT (peer->ibp_connecting == 0);
+ LASSERT (list_empty (&peer->ibp_connd_list));
LASSERT (list_empty (&peer->ibp_conns));
LASSERT (list_empty (&peer->ibp_tx_queue));
kibnal_get_peer (ptl_nid_t nid)
{
kib_peer_t *peer;
+ unsigned long flags;
- read_lock (&kibnal_data.kib_global_lock);
+ read_lock_irqsave(&kibnal_data.kib_global_lock, flags);
peer = kibnal_find_peer_locked (nid);
if (peer != NULL) /* +1 ref for caller? */
atomic_inc (&peer->ibp_refcount);
- read_unlock (&kibnal_data.kib_global_lock);
+ read_unlock_irqrestore(&kibnal_data.kib_global_lock, flags);
return (peer);
}
{
kib_peer_t *peer;
struct list_head *ptmp;
+ unsigned long flags;
int i;
- read_lock (&kibnal_data.kib_global_lock);
+ read_lock_irqsave(&kibnal_data.kib_global_lock, flags);
for (i = 0; i < kibnal_data.kib_peer_hash_size; i++) {
*portp = peer->ibp_port;
*persistencep = peer->ibp_persistence;
- read_unlock (&kibnal_data.kib_global_lock);
+ read_unlock_irqrestore(&kibnal_data.kib_global_lock,
+ flags);
return (0);
}
}
- read_unlock (&kibnal_data.kib_global_lock);
+ read_unlock_irqrestore(&kibnal_data.kib_global_lock, flags);
return (-ENOENT);
}
struct list_head *ptmp;
kib_conn_t *conn;
struct list_head *ctmp;
+ unsigned long flags;
int i;
- read_lock (&kibnal_data.kib_global_lock);
+ read_lock_irqsave(&kibnal_data.kib_global_lock, flags);
for (i = 0; i < kibnal_data.kib_peer_hash_size; i++) {
list_for_each (ptmp, &kibnal_data.kib_peers[i]) {
conn, conn->ibc_state, conn->ibc_peer->ibp_nid,
atomic_read (&conn->ibc_refcount));
atomic_inc (&conn->ibc_refcount);
- read_unlock (&kibnal_data.kib_global_lock);
+ read_unlock_irqrestore(&kibnal_data.kib_global_lock,
+ flags);
return (conn);
}
}
}
- read_unlock (&kibnal_data.kib_global_lock);
+ read_unlock_irqrestore(&kibnal_data.kib_global_lock, flags);
return (NULL);
}
if (conn->ibc_incarnation == incarnation)
continue;
- CDEBUG(D_NET, "Closing stale conn nid:"LPX64" incarnation:"LPX64"("LPX64")\n",
+ CDEBUG(D_NET, "Closing stale conn %p nid:"LPX64
+ " incarnation:"LPX64"("LPX64")\n", conn,
peer->ibp_nid, conn->ibc_incarnation, incarnation);
count++;