From 7e89b556ea7dc4b4cf5e6bce3b1da6bed0190e8b Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Mon, 6 Apr 2020 13:11:33 +1000 Subject: [PATCH] LU-10391 lnet: change tp_nid to 16byte in lnet_test_peer. This updates 'struct lnet_test_peer' to store a large address nid. Test-Parameters: trivial Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests Test-Parameters: clientversion=2.12 testlist=runtests Signed-off-by: Mr NeilBrown Change-Id: Id2f97a841bb0738503b0e87e7a9e2f8bebc4c3ec Reviewed-on: https://review.whamcloud.com/43595 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Chris Horn Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- lnet/include/lnet/lib-types.h | 2 +- lnet/lnet/lib-move.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index ddcc68d..d375c3e 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -236,7 +236,7 @@ struct lnet_libmd { struct lnet_test_peer { /* info about peers we are trying to fail */ struct list_head tp_list; /* ln_test_peers */ - lnet_nid_t tp_nid; /* matching nid */ + struct lnet_nid tp_nid; /* matching nid */ unsigned int tp_threshold; /* # failures to simulate */ }; diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 3b07768..cdd84d6 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -190,13 +190,15 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, } int -lnet_fail_nid(lnet_nid_t nid, unsigned int threshold) +lnet_fail_nid(lnet_nid_t nid4, unsigned int threshold) { struct lnet_test_peer *tp; struct list_head *el; struct list_head *next; + struct lnet_nid nid; LIST_HEAD(cull); + lnet_nid4_to_nid(nid4, &nid); /* NB: use lnet_net_lock(0) to serialize operations on test peers */ if (threshold != 0) { /* Adding a new entry */ @@ -219,8 +221,8 @@ lnet_fail_nid(lnet_nid_t nid, unsigned int threshold) tp = list_entry(el, struct lnet_test_peer, tp_list); if (tp->tp_threshold == 0 || /* needs culling anyway */ - nid == LNET_NID_ANY || /* removing all entries */ - tp->tp_nid == nid) { /* matched this one */ + LNET_NID_IS_ANY(&nid) || /* removing all entries */ + nid_same(&tp->tp_nid, &nid)) { /* matched this one */ list_move(&tp->tp_list, &cull); } } @@ -237,14 +239,16 @@ lnet_fail_nid(lnet_nid_t nid, unsigned int threshold) } static int -fail_peer (lnet_nid_t nid, int outgoing) +fail_peer(lnet_nid_t nid4, int outgoing) { struct lnet_test_peer *tp; struct list_head *el; struct list_head *next; + struct lnet_nid nid; LIST_HEAD(cull); int fail = 0; + lnet_nid4_to_nid(nid4, &nid); /* NB: use lnet_net_lock(0) to serialize operations on test peers */ lnet_net_lock(0); @@ -262,8 +266,8 @@ fail_peer (lnet_nid_t nid, int outgoing) continue; } - if (tp->tp_nid == LNET_NID_ANY || /* fail every peer */ - nid == tp->tp_nid) { /* fail this peer */ + if (LNET_NID_IS_ANY(&tp->tp_nid) || /* fail every peer */ + nid_same(&nid, &tp->tp_nid)) { /* fail this peer */ fail = 1; if (tp->tp_threshold != LNET_MD_THRESH_INF) { -- 1.8.3.1