conn->ibc_credits += credits;
- /* This ensures the credit taken by NOOP can be returned */
- if (msg->ibm_type == IBLND_MSG_NOOP &&
- !IBLND_OOB_CAPABLE(conn->ibc_version)) /* v1 only */
- conn->ibc_outstanding_credits++;
+ /* This ensures the credit taken by NOOP can be returned */
+ if (msg->ibm_type == IBLND_MSG_NOOP &&
+ !IBLND_OOB_CAPABLE(conn->ibc_version)) /* v1 only */
+ conn->ibc_outstanding_credits++;
kiblnd_check_sends_locked(conn);
spin_unlock(&conn->ibc_lock);
switch (msg->ibm_type) {
default:
- CERROR("Bad IBLND message type %x from %s\n",
- msg->ibm_type, libcfs_nidstr(&conn->ibc_peer->ibp_nid));
+ rc = -EPROTO;
+ CERROR("Bad IBLND message type %x from %s: rc = %d\n",
+ msg->ibm_type, libcfs_nidstr(&conn->ibc_peer->ibp_nid),
+ rc);
post_credit = IBLND_POSTRX_NO_CREDIT;
- rc = -EPROTO;
break;
case IBLND_MSG_NOOP:
list_del(&tx->tx_list);
spin_unlock(&conn->ibc_lock);
- if (tx == NULL) {
- CERROR("Unmatched PUT_ACK from %s\n",
- libcfs_nidstr(&conn->ibc_peer->ibp_nid));
- rc = -EPROTO;
- break;
- }
+ if (tx == NULL) {
+ rc = -EPROTO;
+ CERROR("Unmatched PUT_ACK from %s: rc = %d\n",
+ libcfs_nidstr(&conn->ibc_peer->ibp_nid), rc);
+ break;
+ }
+
+ if (!tx->tx_waiting) {
+ rc = -EPROTO;
+ CERROR("Matching PUT_ACK from %s is not waiting: rc = %d\n",
+ libcfs_nidstr(&conn->ibc_peer->ibp_nid), rc);
+ break;
+ }
- LASSERT (tx->tx_waiting);
/* CAVEAT EMPTOR: I could be racing with tx_complete, but...
* (a) I can overwrite tx_msg since my peer_ni has received it!
* (b) tx_waiting set tells tx_complete() it's not done. */
&msg->ibm_u.putack.ibpam_rd,
msg->ibm_u.putack.ibpam_dst_cookie);
if (rc2 < 0)
- CERROR("Can't setup rdma for PUT to %s: %d\n",
+ CERROR("Can't setup rdma for PUT to %s: rc = %d\n",
libcfs_nidstr(&conn->ibc_peer->ibp_nid), rc2);
spin_lock(&conn->ibc_lock);
struct kib_rx *rx;
LASSERT(!in_interrupt());
- LASSERT(conn->ibc_state >= IBLND_CONN_ESTABLISHED);
+ if (conn->ibc_state < IBLND_CONN_ESTABLISHED) {
+ CERROR("conn %p: bad state %d\n", conn, conn->ibc_state);
+ return;
+ }
write_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
while ((rx = list_first_entry_or_null(&conn->ibc_early_rxs,
CNETERR("%s: UNREACHABLE %d cm_id %p conn %p ibc_state: %d\n",
libcfs_nidstr(&conn->ibc_peer->ibp_nid),
event->status, cmid, conn, conn->ibc_state);
- LASSERT(conn->ibc_state != IBLND_CONN_INIT);
if (conn->ibc_state != IBLND_CONN_ACTIVE_CONNECT &&
conn->ibc_state != IBLND_CONN_PASSIVE_WAIT)