struct cfs_hash_bd bds[2];
int bits = 0;
- LASSERTF(hlist_unhashed(hnode), "hnode = %p\n", hnode);
+ LASSERTF(hlist_unhashed(hnode), "hnode = %px\n", hnode);
cfs_hash_lock(hs, 0);
cfs_hash_dual_bd_get_and_lock(hs, key, bds, 1);
{
unsigned int size;
- LASSERTF(md->md_rspt_ptr == NULL, "md %p rsp %p\n", md, md->md_rspt_ptr);
+ LASSERTF(!md->md_rspt_ptr, "md %px rsp %px\n", md, md->md_rspt_ptr);
size = offsetof(struct lnet_libmd, md_kiov[md->md_niov]);
/* kgnilnd_finish_connect doesn't put connections on the
* peer list until they are actually established */
LASSERTF(conn->gnc_state >= GNILND_CONN_ESTABLISHED,
- "found conn %p state %s on peer %p (%s)\n",
+ "found conn %px state %s on peer %px (%s)\n",
conn, kgnilnd_conn_state2str(conn), peer,
libcfs_nid2str(peer->gnp_nid));
if (conn->gnc_state != GNILND_CONN_ESTABLISHED)
}
LASSERTF(conn->gnc_state == GNILND_CONN_ESTABLISHED,
- "conn %p to %s with bogus state %s\n", conn,
+ "conn %px to %s with bogus state %s\n", conn,
libcfs_nid2str(conn->gnc_peer->gnp_nid),
kgnilnd_conn_state2str(conn));
LASSERT(!list_empty(&conn->gnc_hashlist));
"peer 0x%p->%s dirty eps %d\n",
peer, libcfs_nid2str(peer->gnp_nid),
atomic_read(&peer->gnp_dirty_eps));
- LASSERTF(peer->gnp_net != NULL, "peer %p (%s) with NULL net\n",
+ LASSERTF(peer->gnp_net != NULL, "peer %px (%s) with NULL net\n",
peer, libcfs_nid2str(peer->gnp_nid));
LASSERTF(!kgnilnd_peer_active(peer),
"peer 0x%p->%s\n",
/* NB - the caller should own conn by removing him from the
* scheduler thread when finishing the close */
- LASSERTF(peer != NULL, "conn %p with NULL peer\n", conn);
+ LASSERTF(peer != NULL, "conn %px with NULL peer\n", conn);
/* If this is still true, need to add the calls to unlink back in and
* figure out how to close the hole on loopback conns */
- LASSERTF(kgnilnd_peer_active(peer), "can't use inactive peer %s (%p)"
- " we'll never recover the resources\n",
- libcfs_nid2str(peer->gnp_nid), peer);
+ LASSERTF(kgnilnd_peer_active(peer),
+ "can't use inactive peer %s (%px) we'll never recover the resources\n",
+ libcfs_nid2str(peer->gnp_nid), peer);
CDEBUG(D_NET, "conn %p peer %p dev %p\n", conn, peer,
conn->gnc_device);
* peer.
*/
- LASSERTF(conn->gnc_state == GNILND_CONN_DONE, "Conn in invalid state %p@%s \n",
- conn, kgnilnd_conn_state2str(conn));
+ LASSERTF(conn->gnc_state == GNILND_CONN_DONE,
+ "Conn in invalid state %px@%s\n",
+ conn, kgnilnd_conn_state2str(conn));
/* move from peer to the delayed release list */
list_add_tail(&conn->gnc_list, conn_list);
list_for_each_entry_safe(peer, pnxt, &kgnilnd_data.kgn_peers[i],
gnp_list) {
LASSERTF(peer->gnp_net != NULL,
- "peer %p (%s) with NULL net\n",
+ "peer %px (%s) with NULL net\n",
peer, libcfs_nid2str(peer->gnp_nid));
if (net != NULL && peer->gnp_net != net)
}
LASSERTF(ni == net->gnn_ni,
- "ni %p gnn_ni %p\n", net, net->gnn_ni);
+ "ni %px gnn_ni %px\n", net, net->gnn_ni);
ni->ni_data = NULL;
LASSERT(!net->gnn_shutdown);
LASSERTF(atomic_read(&net->gnn_refcount) != 0,
- "net %p refcount %d\n",
+ "net %px refcount %d\n",
net, atomic_read(&net->gnn_refcount));
if (!list_empty(&net->gnn_list)) {
/* not locking, this can't race with writers */
LASSERTF(atomic_read(&net->gnn_refcount) == 0,
- "net %p refcount %d\n",
+ "net %px refcount %d\n",
net, atomic_read(&net->gnn_refcount));
LIBCFS_FREE(net, sizeof(*net));
#define kgnilnd_net_addref(net) \
do { \
int val = atomic_inc_return(&net->gnn_refcount); \
- LASSERTF(val > 1, "net %p refcount %d\n", net, val); \
+ LASSERTF(val > 1, "net %px refcount %d\n", net, val); \
CDEBUG(D_NETTRACE, "net %p->%s++ (%d)\n", net, \
libcfs_nidstr(&net->gnn_ni->ni_nid), val); \
} while (0)
#define kgnilnd_net_decref(net) \
do { \
int val = atomic_dec_return(&net->gnn_refcount); \
- LASSERTF(val >= 0, "net %p refcount %d\n", net, val); \
+ LASSERTF(val >= 0, "net %px refcount %d\n", net, val); \
CDEBUG(D_NETTRACE, "net %p->%s-- (%d)\n", net, \
libcfs_nidstr(&net->gnn_ni->ni_nid), val); \
} while (0)
-#define kgnilnd_peer_addref(peer) \
-do { \
- int val = atomic_inc_return(&peer->gnp_refcount); \
- LASSERTF(val > 1, "peer %p refcount %d\n", peer, val); \
- CDEBUG(D_NETTRACE, "peer %p->%s++ (%d)\n", peer, \
- libcfs_nid2str(peer->gnp_nid), val); \
+#define kgnilnd_peer_addref(peer) \
+do { \
+ int val = atomic_inc_return(&peer->gnp_refcount); \
+ LASSERTF(val > 1, "peer %px refcount %d\n", peer, val); \
+ CDEBUG(D_NETTRACE, "peer %p->%s++ (%d)\n", peer, \
+ libcfs_nid2str(peer->gnp_nid), val); \
} while (0)
-#define kgnilnd_peer_decref(peer) \
-do { \
- int val = atomic_dec_return(&peer->gnp_refcount); \
- LASSERTF(val >= 0, "peer %p refcount %d\n", peer, val); \
- CDEBUG(D_NETTRACE, "peer %p->%s--(%d)\n", peer, \
- libcfs_nid2str(peer->gnp_nid), val); \
- if (val == 0) \
- kgnilnd_destroy_peer(peer); \
+#define kgnilnd_peer_decref(peer) \
+do { \
+ int val = atomic_dec_return(&peer->gnp_refcount); \
+ LASSERTF(val >= 0, "peer %px refcount %d\n", peer, val); \
+ CDEBUG(D_NETTRACE, "peer %p->%s--(%d)\n", peer, \
+ libcfs_nid2str(peer->gnp_nid), val); \
+ if (val == 0) \
+ kgnilnd_destroy_peer(peer); \
} while(0)
-#define kgnilnd_conn_addref(conn) \
-do { \
- int val; \
+#define kgnilnd_conn_addref(conn) \
+do { \
+ int val; \
\
- smp_wmb(); \
- val = atomic_inc_return(&conn->gnc_refcount); \
- LASSERTF(val > 1 && conn->gnc_magic == GNILND_CONN_MAGIC, \
- "conn %p refc %d to %s\n", \
- conn, val, \
- conn->gnc_peer \
- ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
- : "<?>"); \
- CDEBUG(D_NETTRACE, "conn %p->%s++ (%d)\n", conn, \
- conn->gnc_peer \
- ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
- : "<?>", \
- val); \
+ smp_wmb(); \
+ val = atomic_inc_return(&conn->gnc_refcount); \
+ LASSERTF(val > 1 && conn->gnc_magic == GNILND_CONN_MAGIC, \
+ "conn %px refc %d to %s\n", \
+ conn, val, \
+ conn->gnc_peer \
+ ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
+ : "<?>"); \
+ CDEBUG(D_NETTRACE, "conn %p->%s++ (%d)\n", conn, \
+ conn->gnc_peer \
+ ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
+ : "<?>", \
+ val); \
} while (0)
/* we hijack conn_decref && gnc_refcount = 1 to allow us to push the conn
* Clearly, we are totally safe. Clearly.
*/
-#define kgnilnd_conn_decref(conn) \
-do { \
- int val; \
+#define kgnilnd_conn_decref(conn) \
+do { \
+ int val; \
\
- smp_wmb(); \
- val = atomic_dec_return(&conn->gnc_refcount); \
- LASSERTF(val >= 0, "conn %p refc %d to %s\n", \
- conn, val, \
- conn->gnc_peer \
- ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
- : "<?>"); \
- CDEBUG(D_NETTRACE, "conn %p->%s-- (%d)\n", conn, \
- conn->gnc_peer \
- ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
- : "<?>", \
- val); \
- smp_rmb(); \
- if ((val == 1) && \
- (conn->gnc_ephandle != NULL) && \
- (conn->gnc_state != GNILND_CONN_DESTROY_EP)) { \
- set_mb(conn->gnc_state, GNILND_CONN_DESTROY_EP); \
- kgnilnd_schedule_conn(conn); \
- } else if (val == 0) { \
- kgnilnd_destroy_conn(conn); \
- } \
+ smp_wmb(); \
+ val = atomic_dec_return(&conn->gnc_refcount); \
+ LASSERTF(val >= 0, "conn %px refc %d to %s\n", \
+ conn, val, \
+ conn->gnc_peer \
+ ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
+ : "<?>"); \
+ CDEBUG(D_NETTRACE, "conn %p->%s-- (%d)\n", conn, \
+ conn->gnc_peer \
+ ? libcfs_nid2str(conn->gnc_peer->gnp_nid) \
+ : "<?>", \
+ val); \
+ smp_rmb(); \
+ if ((val == 1) && \
+ (conn->gnc_ephandle != NULL) && \
+ (conn->gnc_state != GNILND_CONN_DESTROY_EP)) { \
+ set_mb(conn->gnc_state, GNILND_CONN_DESTROY_EP); \
+ kgnilnd_schedule_conn(conn); \
+ } else if (val == 0) { \
+ kgnilnd_destroy_conn(conn); \
+ } \
} while (0)
static inline struct list_head *
GNITX_ASSERTF(tx, tx->tx_id.txe_idx == ev_id->txe_idx,
"conn 0x%p->%s tx_ref_table hosed: wanted txe_idx %d "
- "found tx %p txe_idx %d",
+ "found tx %px txe_idx %d",
conn, libcfs_nid2str(conn->gnc_peer->gnp_nid),
ev_id->txe_idx, tx, tx->tx_id.txe_idx);
conn_sched = xchg(&conn->gnc_scheduled, GNILND_CONN_IDLE);
LASSERTF(conn_sched == GNILND_CONN_WANTS_SCHED ||
conn_sched == GNILND_CONN_PROCESS,
- "conn %p after process in bad state: %d\n",
+ "conn %px after process in bad state: %d\n",
conn, conn_sched);
if (sched_intent >= 0) {
*/
kgnilnd_conn_addref(conn);
}
- LASSERTF(list_empty(&conn->gnc_schedlist), "conn %p already sched state %d\n",
+ LASSERTF(list_empty(&conn->gnc_schedlist),
+ "conn %px already sched state %d\n",
conn, sched);
CDEBUG(D_INFO, "scheduling conn 0x%p caller %s:%d\n", conn, caller, line);
LASSERTF((tx->tx_list_p == NULL &&
tx->tx_list_state == GNILND_TX_ALLOCD) &&
list_empty(&tx->tx_list),
- "tx %p with bad state %s (list_p %p) tx_list %s\n",
+ "tx %px with bad state %s (list_p %px) tx_list %s\n",
tx, kgnilnd_tx_state2str(tx->tx_list_state), tx->tx_list_p,
list_empty(&tx->tx_list) ? "empty" : "not empty");
}
LASSERTF(niov > 0 && niov < GNILND_MAX_IMMEDIATE/PAGE_SIZE,
- "bad niov %d msg %p kiov %p offset %d nob%d\n",
+ "bad niov %d msg %px kiov %px offset %d nob%d\n",
niov, msg, kiov, offset, nob);
for (i = 0; i < niov; i++) {
* that our concurrency doesn't result in the kgn_device_t
* getting nuked while we are in here */
- LASSERTF(conn != NULL, "tx %p with NULL conn, someone forgot"
+ LASSERTF(conn != NULL, "tx %px with NULL conn, someone forgot"
" to set tx_conn before calling %s\n", tx, __FUNCTION__);
if (unlikely(CFS_FAIL_CHECK(CFS_FAIL_GNI_MAP_TX)))
LASSERTF(test_and_clear_bit(tx->tx_id.txe_idx,
(volatile unsigned long *)&conn->gnc_tx_bits),
- "conn %p tx %p bit %d already cleared\n",
+ "conn %px tx %px bit %d already cleared\n",
conn, tx, tx->tx_id.txe_idx);
LASSERTF(conn->gnc_tx_ref_table[tx->tx_id.txe_idx] != NULL,
* failure on any problems */
GNITX_ASSERTF(tx, tx->tx_conn == NULL,
- "tx already has connection %p", tx->tx_conn);
+ "tx already has connection %px", tx->tx_conn);
/* do all of the peer & conn searching in one swoop - this avoids
* nastiness when dropping locks and needing to maintain a sane state
void *desc_buffer = tx->tx_buffer;
gni_mem_handle_t desc_map_key = tx->tx_map_key;
LASSERTF(kgnilnd_tx_mapped(tx),
- "unmapped tx %p\n", tx);
+ "unmapped tx %px\n", tx);
LASSERTF(conn != NULL,
- "NULL conn on tx %p, naughty, naughty\n", tx);
+ "NULL conn on tx %px, naughty, naughty\n", tx);
LASSERTF(nob <= sink->gnrd_nob,
- "nob %u > sink->gnrd_nob %d (%p)\n",
+ "nob %u > sink->gnrd_nob %d (%px)\n",
nob, sink->gnrd_nob, sink);
LASSERTF(nob <= tx->tx_nob,
- "nob %d > tx(%p)->tx_nob %d\n",
+ "nob %d > tx(%px)->tx_nob %d\n",
nob, tx, tx->tx_nob);
switch (type) {
}
/* Don't lie (CLOSE == RDMA idle) */
- LASSERTF(!conn->gnc_close_sent, "tx %p on conn %p after close sent %d\n",
+ LASSERTF(!conn->gnc_close_sent,
+ "tx %px on conn %px after close sent %d\n",
tx, conn, conn->gnc_close_sent);
GNIDBG_TX(D_NET, tx, "Post RDMA type 0x%02x conn %p dlvr_mode "
type, nob, niov, libcfs_idstr(target));
LASSERTF(nob == 0 || niov > 0,
- "lntmsg %p nob %d niov %d\n", lntmsg, nob, niov);
+ "lntmsg %px nob %d niov %d\n", lntmsg, nob, niov);
if (msg_vmflush)
mpflag = memalloc_noreclaim_save();
LBUG();
case LNET_MSG_ACK:
- LASSERTF(nob == 0, "lntmsg %p nob %d\n",
+ LASSERTF(nob == 0, "lntmsg %px nob %d\n",
lntmsg, nob);
break;
tx->tx_msg.gnm_type == GNILND_MSG_GET_DONE ||
tx->tx_msg.gnm_type == GNILND_MSG_PUT_DONE_REV ||
tx->tx_msg.gnm_type == GNILND_MSG_GET_DONE_REV,
- "tx %p with type %d\n", tx, tx->tx_msg.gnm_type);
+ "tx %px with type %d\n", tx, tx->tx_msg.gnm_type);
GNIDBG_TX(D_NET, tx, "RDMA completion for %d bytes", tx->tx_nob);
if (conn->gnc_ephandle == NULL)
return;
- LASSERTF(!conn->gnc_close_sent, "Conn %p close was sent\n", conn);
+ LASSERTF(!conn->gnc_close_sent, "Conn %px close was sent\n", conn);
spin_lock(&conn->gnc_list_lock);
GNITX_ASSERTF(tx, ((tx->tx_id.txe_idx == ev_id.txe_idx) &&
(tx->tx_id.txe_cookie = cookie)),
- "conn 0x%p->%s tx_ref_table hosed: wanted "
- "txe_cookie %#llx txe_idx %d "
- "found tx %p cookie %#llx txe_idx %d\n",
+ "conn 0x%p->%s tx_ref_table hosed: wanted txe_cookie %#llx txe_idx %d found tx %px cookie %#llx txe_idx %d\n",
conn, libcfs_nid2str(conn->gnc_peer->gnp_nid),
cookie, ev_id.txe_idx,
tx, tx->tx_id.txe_cookie, tx->tx_id.txe_idx);
}
LASSERTF(rrc == GNI_RC_SUCCESS,
- "bad rc %d on conn %p from peer %s\n",
+ "bad rc %d on conn %px from peer %s\n",
rrc, conn, libcfs_nid2str(peer->gnp_nid));
msg = (kgn_msg_t *)prefix;
LASSERTF(conn_sched != GNILND_CONN_IDLE &&
conn_sched != GNILND_CONN_PROCESS,
- "conn %p on ready list but in bad state: %d\n",
+ "conn %px on ready list but in bad state: %d\n",
conn, conn_sched);
CDEBUG(D_INFO, "conn %p@%s for processing\n",
fma_blk->gnm_hold_timeout = 0;
/* make sure we are mapping a clean block */
- LASSERTF(fma_blk->gnm_hndl.qword1 == 0UL, "fma_blk %p dirty\n", fma_blk);
+ LASSERTF(fma_blk->gnm_hndl.qword1 == 0UL,
+ "fma_blk %px dirty\n", fma_blk);
rrc = kgnilnd_mem_register(device->gnd_handle, (__u64)fma_blk->gnm_block,
fma_blk->gnm_blk_size, device->gnd_rcv_fma_cqh,
fma_blk->gnm_mbox_size, fma_blk->gnm_hold_timeout);
LASSERTF(rrc == GNI_RC_SUCCESS,
- "tried to double unmap or something bad, fma_blk %p (rrc %d)\n",
+ "tried to double unmap or something bad, fma_blk %px (rrc %d)\n",
fma_blk, rrc);
if (fma_blk->gnm_hold_timeout &&
kgnilnd_free_fmablk_locked(kgn_device_t *dev, kgn_fma_memblock_t *fma_blk)
{
LASSERTF(fma_blk->gnm_avail_mboxs == fma_blk->gnm_num_mboxs,
- "fma_blk %p@%d free in bad state (%d): blk total %d avail %d held %d\n",
+ "fma_blk %px@%d free in bad state (%d): blk total %d avail %d held %d\n",
fma_blk, fma_blk->gnm_state, fma_blk->gnm_hold_timeout, fma_blk->gnm_num_mboxs,
fma_blk->gnm_avail_mboxs, fma_blk->gnm_held_mboxs);
/* We'll set the hndl to zero for PHYS blocks unmapped during stack
* reset and re-use the same fma_blk after stack reset. This ensures we've
* properly mapped it before we use it */
- LASSERTF(fma_blk->gnm_hndl.qword1 != 0UL, "unmapped fma_blk %p, state %d\n",
+ LASSERTF(fma_blk->gnm_hndl.qword1 != 0UL,
+ "unmapped fma_blk %px, state %d\n",
fma_blk, fma_blk->gnm_state);
CDEBUG(D_NET, "conn %p smsg %p fmablk %p "
break;
}
}
- LASSERTF(found, "unable to find conn 0x%p with gnc_fma_blk %p "
- "anywhere in the world\n", conn, conn->gnc_fma_blk);
+ LASSERTF(found,
+ "unable to find conn 0x%p with gnc_fma_blk %px anywhere in the world\n",
+ conn, conn->gnc_fma_blk);
LASSERTF(id < fma_blk->gnm_num_mboxs,
"bad id %d max %d\n",
* not worry about state so much in kgnilnd_destroy_conn
* and makes the guaranteed cleanup of the resources easier */
LASSERTF(test_and_clear_bit(id, fma_blk->gnm_bit_array),
- "conn %p bit %d already cleared in fma_blk %p\n",
+ "conn %px bit %d already cleared in fma_blk %px\n",
conn, id, fma_blk);
conn->gnc_fma_blk = NULL;
mbox->mbx_nallocs--;
LASSERTF(conn_sched != GNILND_CONN_IDLE &&
conn_sched != GNILND_CONN_PROCESS,
- "conn %p on ready list but in bad state: %d\n",
+ "conn %px on ready list but in bad state: %d\n",
conn, conn_sched);
list_del_init(&conn->gnc_schedlist);
if (rpcev != &crpc->crpc_reqstev &&
rpcev != &crpc->crpc_replyev &&
rpcev != &crpc->crpc_bulkev) {
- CERROR("rpcev %p, crpc %p, reqstev %p, replyev %p, bulkev %p\n",
+ CERROR("rpcev %px, crpc %px, reqstev %px, replyev %px, bulkev %px\n",
rpcev, crpc, &crpc->crpc_reqstev,
&crpc->crpc_replyev, &crpc->crpc_bulkev);
CERROR("Bad event: status %d, type %d, lnet %d\n",