@@ -233,7 +233,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 */
};
@@ -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) {
/* Adding a new entry */
@@ -218,9 +220,9 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
list_for_each_safe(el, next, &the_lnet.ln_test_peers) {
tp = list_entry(el, struct lnet_test_peer, tp_list);
- if (!tp->tp_threshold || /* needs culling anyway */
- nid == LNET_NID_ANY || /* removing all entries */
- tp->tp_nid == nid) { /* matched this one */
+ if (!tp->tp_threshold || /* needs culling anyway */
+ 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 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
}
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);
@@ -264,8 +268,8 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
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) {