LASSERT (tx->tx_msg.ksm_zc_cookies[0] != 0);
tx->tx_msg.ksm_zc_cookies[0] = 0;
+ if (tx->tx_resid == 0)
+ tx->tx_resid = -1; /* mark it as not-acked */
cfs_list_del(&tx->tx_zc_list);
cfs_list_add(&tx->tx_zc_list, &zlist);
}
void
ksocknal_destroy_conn (ksock_conn_t *conn)
{
+ cfs_time_t last_rcv;
+
/* Final coup-de-grace of the reaper */
CDEBUG (D_NET, "connection %p\n", conn);
/* complete current receive if any */
switch (conn->ksnc_rx_state) {
case SOCKNAL_RX_LNET_PAYLOAD:
- CERROR("Completing partial receive from %s"
- ", ip %d.%d.%d.%d:%d, with error\n",
- libcfs_id2str(conn->ksnc_peer->ksnp_id),
- HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port);
+ last_rcv = conn->ksnc_rx_deadline -
+ cfs_time_seconds(*ksocknal_tunables.ksnd_timeout);
+ CERROR("Completing partial receive from %s[%d]"
+ ", ip %d.%d.%d.%d:%d, with error, wanted: %d, left: %d, "
+ "last alive is %ld secs ago\n",
+ libcfs_id2str(conn->ksnc_peer->ksnp_id), conn->ksnc_type,
+ HIPQUAD(conn->ksnc_ipaddr), conn->ksnc_port,
+ conn->ksnc_rx_nob_wanted, conn->ksnc_rx_nob_left,
+ cfs_duration_sec(cfs_time_sub(cfs_time_current(),
+ last_rcv)));
lnet_finalize (conn->ksnc_peer->ksnp_ni,
conn->ksnc_cookie, -EIO);
break;
{
int connect = 1;
cfs_time_t last_alive = 0;
+ cfs_time_t now = cfs_time_current();
ksock_peer_t *peer = NULL;
cfs_rwlock_t *glock = &ksocknal_data.ksnd_global_lock;
lnet_process_id_t id = {.nid = nid, .pid = LUSTRE_SRV_LNET_PID};
/* something got ACKed */
conn->ksnc_tx_deadline =
cfs_time_shift(*ksocknal_tunables.ksnd_timeout);
- peer->ksnp_last_alive = cfs_time_current();
+ peer->ksnp_last_alive = now;
conn->ksnc_tx_bufnob = bufnob;
}
}
if (last_alive != 0)
*when = last_alive;
+ CDEBUG(D_NET, "Peer %s %p, alive %ld secs ago, connect %d\n",
+ libcfs_nid2str(nid), peer,
+ last_alive ? cfs_duration_sec(now - last_alive) : -1,
+ connect);
+
if (!connect)
return;