return wrq->completion_notification != 0;
}
-static inline void
-kibnal_conn_addref (kib_conn_t *conn)
-{
- CDEBUG(D_NET, "++conn[%p] (%d)\n",
- conn, atomic_read(&conn->ibc_refcount));
- LASSERT(atomic_read(&conn->ibc_refcount) > 0);
- atomic_inc(&conn->ibc_refcount);
-}
-
-static inline void
-kibnal_conn_decref (kib_conn_t *conn)
-{
- unsigned long flags;
-
- CDEBUG(D_NET, "--conn[%p] (%d)\n",
- conn, atomic_read(&conn->ibc_refcount));
- LASSERT(atomic_read(&conn->ibc_refcount) > 0);
- if (atomic_dec_and_test(&conn->ibc_refcount)) {
- spin_lock_irqsave(&kibnal_data.kib_connd_lock, flags);
- list_add_tail(&conn->ibc_list, &kibnal_data.kib_connd_zombies);
- wake_up(&kibnal_data.kib_connd_waitq);
- spin_unlock_irqrestore(&kibnal_data.kib_connd_lock, flags);
- }
-}
-
-static inline void
-kibnal_peer_addref (kib_peer_t *peer)
-{
- CDEBUG(D_NET, "++peer[%p] -> "LPX64" (%d)\n",
- peer, peer->ibp_nid, atomic_read (&peer->ibp_refcount));
- LASSERT(atomic_read(&peer->ibp_refcount) > 0);
- atomic_inc(&peer->ibp_refcount);
-}
-
-static inline void
-kibnal_peer_decref (kib_peer_t *peer)
-{
- CDEBUG(D_NET, "--peer[%p] -> "LPX64" (%d)\n",
- peer, peer->ibp_nid, atomic_read (&peer->ibp_refcount));
-
- LASSERT(atomic_read(&peer->ibp_refcount) > 0);
- if (atomic_dec_and_test (&peer->ibp_refcount))
- kibnal_destroy_peer (peer);
-}
+#define kibnal_conn_addref(conn) \
+do { \
+ CDEBUG(D_NET, "conn[%p] (%d)++\n", \
+ (conn), atomic_read(&(conn)->ibc_refcount)); \
+ LASSERT(atomic_read(&(conn)->ibc_refcount) > 0); \
+ atomic_inc(&(conn)->ibc_refcount); \
+} while (0)
+
+#define kibnal_conn_decref(conn) \
+do { \
+ unsigned long flags; \
+ \
+ CDEBUG(D_NET, "conn[%p] (%d)--\n", \
+ (conn), atomic_read(&(conn)->ibc_refcount)); \
+ LASSERT(atomic_read(&(conn)->ibc_refcount) > 0); \
+ if (atomic_dec_and_test(&(conn)->ibc_refcount)) { \
+ spin_lock_irqsave(&kibnal_data.kib_connd_lock, flags); \
+ list_add_tail(&(conn)->ibc_list, \
+ &kibnal_data.kib_connd_zombies); \
+ wake_up(&kibnal_data.kib_connd_waitq); \
+ spin_unlock_irqrestore(&kibnal_data.kib_connd_lock, flags); \
+ } \
+} while (0)
+
+#define kibnal_peer_addref(peer) \
+do { \
+ CDEBUG(D_NET, "peer[%p] -> "LPX64" (%d)++\n", \
+ (peer), (peer)->ibp_nid, \
+ atomic_read (&(peer)->ibp_refcount)); \
+ LASSERT(atomic_read(&(peer)->ibp_refcount) > 0); \
+ atomic_inc(&(peer)->ibp_refcount); \
+} while (0)
+
+#define kibnal_peer_decref(peer) \
+do { \
+ CDEBUG(D_NET, "peer[%p] -> "LPX64" (%d)--\n", \
+ (peer), (peer)->ibp_nid, \
+ atomic_read (&(peer)->ibp_refcount)); \
+ LASSERT(atomic_read(&(peer)->ibp_refcount) > 0); \
+ if (atomic_dec_and_test(&(peer)->ibp_refcount)) \
+ kibnal_destroy_peer(peer); \
+} while (0)
static inline struct list_head *
kibnal_nid2peerlist (ptl_nid_t nid)
* stashed on ibc_active_txs, matched by an incoming PUT_ACK,
* and then re-queued here. It's (just) possible that
* tx_sending is non-zero if we've not done the tx_complete() from
- * the first send; hence the += rather than = below. */
+ * the first send; hence the ++ rather than = below. */
tx->tx_sending++;
list_add (&tx->tx_list, &conn->ibc_active_txs);
vvrc = vv_return_ok;
if (conn->ibc_state == IBNAL_CONN_ESTABLISHED) {
tx->tx_status = 0;
-#if 1
vvrc = vv_post_send_list(kibnal_data.kib_hca,
conn->ibc_qp,
tx->tx_nwrq,
tx->tx_wrq,
vv_operation_type_send_rc);
rc = (vvrc == vv_return_ok) ? 0 : -EIO;
-#else
- /* Only post 1 item at a time for now (so we know
- * exactly how many got posted successfully) */
- for (i = 0; i < tx->tx_nwrq; i++) {
- switch (tx->tx_wrq[i].wr_type) {
- case vv_wr_send:
- CDEBUG(D_NET, "[%d]posting send [%d %x %p]%s: %x\n",
- i,
- tx->tx_wrq[i].scatgat_list->length,
- tx->tx_wrq[i].scatgat_list->l_key,
- tx->tx_wrq[i].scatgat_list->v_address,
- tx->tx_wrq[i].type.send.send_qp_type.rc_type.fance_indicator ?
- "(fence)":"",
- tx->tx_msg->ibm_type);
- break;
- case vv_wr_rdma_write:
- CDEBUG(D_NET, "[%d]posting PUT [%d %x %p]->[%x "LPX64"]\n",
- i,
- tx->tx_wrq[i].scatgat_list->length,
- tx->tx_wrq[i].scatgat_list->l_key,
- tx->tx_wrq[i].scatgat_list->v_address,
- tx->tx_wrq[i].type.send.send_qp_type.rc_type.r_r_key,
- tx->tx_wrq[i].type.send.send_qp_type.rc_type.r_addr);
- break;
- case vv_wr_rdma_read:
- CDEBUG(D_NET, "[%d]posting GET [%d %x %p]->[%x "LPX64"]\n",
- i,
- tx->tx_wrq[i].scatgat_list->length,
- tx->tx_wrq[i].scatgat_list->l_key,
- tx->tx_wrq[i].scatgat_list->v_address,
- tx->tx_wrq[i].type.send.send_qp_type.rc_type.r_r_key,
- tx->tx_wrq[i].type.send.send_qp_type.rc_type.r_addr);
- break;
- default:
- LBUG();
- }
- vvrc = vv_post_send(kibnal_data.kib_hca,
- conn->ibc_qp,
- &tx->tx_wrq[i],
- vv_operation_type_send_rc);
- CDEBUG(D_NET, LPX64": post %d/%d\n",
- conn->ibc_peer->ibp_nid, i, tx->tx_nwrq);
- if (vvrc != vv_return_ok) {
- rc = -EIO;
- break;
- }
- }
-#endif
}
if (rc != 0) {
* gets to free it, which also drops its ref on 'conn'. */
tx->tx_sending--;
+ conn->ibc_nsends_posted--;
if (failed) {
tx->tx_waiting = 0;
kibnal_conn_addref(conn); /* 1 ref for me.... */
- if (tx->tx_sending == 0)
- conn->ibc_nsends_posted--;
-
spin_unlock(&conn->ibc_lock);
if (idle)