[lustre-devel] [PATCH 20/50] lnet: alter lnd_notify_peer_down() to take lnet_nid
James Simmons
jsimmons at infradead.org
Sun Mar 20 06:30:34 PDT 2022
From: Mr NeilBrown <neilb at suse.de>
The lnd_notify_peer_down() interface now takes a large nid.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 6a9bdf59e6306d49c ("LU-10391 lnet: alter lnd_notify_peer_down() to take lnet_nid")
Signed-off-by: Mr NeilBrown <neilb at suse.de>
Reviewed-on: https://review.whamcloud.com/43608
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
include/linux/lnet/lib-types.h | 2 +-
net/lnet/klnds/socklnd/socklnd.c | 12 +++++-------
net/lnet/lnet/router.c | 4 ++--
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/include/linux/lnet/lib-types.h b/include/linux/lnet/lib-types.h
index 40767e6..f7f0b0b 100644
--- a/include/linux/lnet/lib-types.h
+++ b/include/linux/lnet/lib-types.h
@@ -328,7 +328,7 @@ struct lnet_lnd {
struct lnet_msg *msg, void **new_privatep);
/* notification of peer down */
- void (*lnd_notify_peer_down)(lnet_nid_t peer);
+ void (*lnd_notify_peer_down)(struct lnet_nid *peer);
/* accept a new connection */
int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index 6d1f85c..e3201d1 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -1670,25 +1670,23 @@ struct ksock_peer_ni *
}
void
-ksocknal_notify_gw_down(lnet_nid_t gw_nid)
+ksocknal_notify_gw_down(struct lnet_nid *gw_nid)
{
- /*
- * The router is telling me she's been notified of a change in
+ /* The router is telling me she's been notified of a change in
* gateway state....
*/
struct lnet_processid id = {
.pid = LNET_PID_ANY,
+ .nid = *gw_nid,
};
- CDEBUG(D_NET, "gw %s down\n", libcfs_nid2str(gw_nid));
+ CDEBUG(D_NET, "gw %s down\n", libcfs_nidstr(gw_nid));
- lnet_nid4_to_nid(gw_nid, &id.nid);
/* If the gateway crashed, close all open connections... */
ksocknal_close_matching_conns(&id, 0);
return;
- /*
- * We can only establish new connections
+ /* We can only establish new connections
* if we have autroutes, and these connect on demand.
*/
}
diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c
index 97e5ab2..87ae1f9 100644
--- a/net/lnet/lnet/router.c
+++ b/net/lnet/lnet/router.c
@@ -1681,7 +1681,7 @@ bool lnet_router_checker_active(void)
}
static inline void
-lnet_notify_peer_down(struct lnet_ni *ni, lnet_nid_t nid)
+lnet_notify_peer_down(struct lnet_ni *ni, struct lnet_nid *nid)
{
if (ni->ni_net->net_lnd->lnd_notify_peer_down)
ni->ni_net->net_lnd->lnd_notify_peer_down(nid);
@@ -1796,7 +1796,7 @@ bool lnet_router_checker_active(void)
lnet_net_unlock(0);
if (ni && !alive)
- lnet_notify_peer_down(ni, lnet_nid_to_nid4(&lpni->lpni_nid));
+ lnet_notify_peer_down(ni, &lpni->lpni_nid);
cpt = lpni->lpni_cpt;
lnet_net_lock(cpt);
--
1.8.3.1
More information about the lustre-devel
mailing list