From ba0e08cfdc5cfc1b7f1fc368916ff14e229e0b29 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Thu, 18 Aug 2022 13:02:18 -0600 Subject: [PATCH] LU-16213 kfilnd: Add peer info to some debug statements Add kfilnd_peer pointer address to some debug statements. Use 0x%llx format consistently when printing kfilnd_peer::kp_addr Also add the message type to the TN debug macro. HPE-bug-id: LUS-11128 Test-Parameters: trivial Signed-off-by: Chris Horn Change-Id: I4410ca9215f9d0a6eb65e6d4f953234fa7fba5ea Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48781 Reviewed-by: Ron Gredvig Reviewed-by: Ian Ziemba Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lnet/klnds/kfilnd/kfilnd.h | 9 +++++---- lnet/klnds/kfilnd/kfilnd_peer.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lnet/klnds/kfilnd/kfilnd.h b/lnet/klnds/kfilnd/kfilnd.h index abf9adf..4f0fb9c 100644 --- a/lnet/klnds/kfilnd/kfilnd.h +++ b/lnet/klnds/kfilnd/kfilnd.h @@ -481,11 +481,12 @@ struct kfilnd_msg { !IS_ERR_OR_NULL((tn)->tn_kp) #define KFILND_TN_DIR_DEBUG(tn, fmt, dir, ...) \ - CDEBUG(D_NET, "Transaction ID %p: %s:%u %s %s:%llu " fmt "\n", \ + CDEBUG(D_NET, "%s Transaction ID %p: %s:%u %s %s(%p):0x%llx " fmt "\n", \ + msg_type_to_str(tn->msg_type), \ (tn), \ libcfs_nidstr(&(tn)->tn_ep->end_dev->kfd_ni->ni_nid), \ (tn)->tn_ep->end_context_id, dir, \ - libcfs_nid2str((tn)->tn_kp->kp_nid), \ + libcfs_nid2str((tn)->tn_kp->kp_nid), tn->tn_kp, \ KFILND_TN_PEER_VALID(tn) ? \ KFILND_RX_CONTEXT((tn)->tn_kp->kp_addr) : 0, \ ##__VA_ARGS__) @@ -499,11 +500,11 @@ struct kfilnd_msg { } while (0) #define KFILND_TN_DIR_ERROR(tn, fmt, dir, ...) \ - CNETERR("Transaction ID %p: %s:%u %s %s:%llu " fmt "\n", \ + CNETERR("Transaction ID %p: %s:%u %s %s(%p):0x%llx " fmt "\n", \ (tn), \ libcfs_nidstr(&(tn)->tn_ep->end_dev->kfd_ni->ni_nid), \ (tn)->tn_ep->end_context_id, dir, \ - libcfs_nid2str((tn)->tn_kp->kp_nid), \ + libcfs_nid2str((tn)->tn_kp->kp_nid), tn->tn_kp, \ KFILND_TN_PEER_VALID(tn) ? \ KFILND_RX_CONTEXT((tn)->tn_kp->kp_addr) : 0, \ ##__VA_ARGS__) diff --git a/lnet/klnds/kfilnd/kfilnd_peer.c b/lnet/klnds/kfilnd/kfilnd_peer.c index 84653ca..de780a3 100644 --- a/lnet/klnds/kfilnd/kfilnd_peer.c +++ b/lnet/klnds/kfilnd/kfilnd_peer.c @@ -47,8 +47,8 @@ static void kfilnd_peer_free(void *ptr, void *arg) { struct kfilnd_peer *kp = ptr; - CDEBUG(D_NET, "%s(0x%llx) peer entry freed\n", - libcfs_nid2str(kp->kp_nid), kp->kp_addr); + CDEBUG(D_NET, "%s(%p):0x%llx peer entry freed\n", + libcfs_nid2str(kp->kp_nid), kp, kp->kp_addr); kfi_av_remove(kp->kp_dev->kfd_av, &kp->kp_addr, 1, 0); @@ -65,8 +65,8 @@ void kfilnd_peer_down(struct kfilnd_peer *kp) struct lnet_nid peer_nid; lnet_nid4_to_nid(kp->kp_nid, &peer_nid); - CDEBUG(D_NET, "%s(0x%llx) marked for removal from peer cache\n", - libcfs_nidstr(&peer_nid), kp->kp_addr); + CDEBUG(D_NET, "%s(%p):0x%llx marked for removal from peer cache\n", + libcfs_nidstr(&peer_nid), kp, kp->kp_addr); lnet_notify(kp->kp_dev->kfd_ni, &peer_nid, false, false, kp->kp_last_alive); @@ -87,8 +87,8 @@ void kfilnd_peer_put(struct kfilnd_peer *kp) peer_cache_params); refcount_dec(&kp->kp_cnt); - CDEBUG(D_NET, "%s(0x%llx) removed from peer cache\n", - libcfs_nid2str(kp->kp_nid), kp->kp_addr); + CDEBUG(D_NET, "%s(%p):0x%llx removed from peer cache\n", + libcfs_nid2str(kp->kp_nid), kp, kp->kp_addr); } if (refcount_dec_and_test(&kp->kp_cnt)) @@ -198,8 +198,8 @@ again: kfilnd_peer_alive(kp); - CDEBUG(D_NET, "%s(0x%llx) peer entry allocated\n", - libcfs_nid2str(kp->kp_nid), kp->kp_addr); + CDEBUG(D_NET, "%s(%p):0x%llx peer entry allocated\n", + libcfs_nid2str(kp->kp_nid), kp, kp->kp_addr); return kp; -- 1.8.3.1