void lnet_mt_event_handler(struct lnet_event *event);
-int lnet_notify(struct lnet_ni *ni, lnet_nid_t peer, bool alive, bool reset,
- time64_t when);
+int lnet_notify(struct lnet_ni *ni, struct lnet_nid *peer, bool alive,
+ bool reset, time64_t when);
void lnet_notify_locked(struct lnet_peer_ni *lp, int notifylnd, int alive,
time64_t when);
int lnet_add_route(__u32 net, __u32 hops, struct lnet_nid *gateway,
up_read(&kgnilnd_data.kgn_net_rw_sem);
for (i = 0; i < nnets; i++) {
- lnet_nid_t peer_nid;
+ struct lnet_nid peer_nid;
net = nets[i];
- peer_nid = kgnilnd_lnd2lnetnid(
- lnet_nid_to_nid4(&net->gnn_ni->ni_nid),
- peer->gnp_nid);
+ lnet_nid4_to_nid(kgnilnd_lnd2lnetnid(
+ lnet_nid_to_nid4(&net->gnn_ni->ni_nid),
+ peer->gnp_nid),
+ &peer_nid);
CDEBUG(D_NET, "peer 0x%p->%s last_alive %lld (%llds ago)\n",
peer, libcfs_nid2str(peer_nid), peer->gnp_last_alive,
ktime_get_seconds() - peer->gnp_last_alive);
- lnet_notify(net->gnn_ni, peer_nid, alive, true,
+ lnet_notify(net->gnn_ni, &peer_nid, alive, true,
peer->gnp_last_alive);
kgnilnd_net_decref(net);
{
kgn_conn_t *conn = dgram->gndg_conn;
lnet_nid_t her_nid = dgram->gndg_conn_in.gncr_srcnid;
+ struct lnet_nid peer_nid;
kgn_peer_t *new_peer, *peer = NULL;
kgn_tx_t *tx;
kgn_tx_t *txn;
/* Notify LNET that we now have a working connection to this peer.
* This is a Cray extension to the "standard" LND behavior.
*/
- lnet_notify(peer->gnp_net->gnn_ni, peer->gnp_nid, true, true,
+ lnet_nid4_to_nid(peer->gnp_nid, &peer_nid);
+ lnet_notify(peer->gnp_net->gnn_ni, &peed_nid, true, true,
ktime_get_seconds());
/* drop our 'hold' ref */
void kfilnd_peer_down(struct kfilnd_peer *peer)
{
if (atomic_cmpxchg(&peer->remove_peer, 0, 1) == 0) {
+ struct lnet_nid peer_nid;
+
+ lnet_nid4_to_nid(peer->nid, &peer_nid);
CDEBUG(D_NET, "%s(0x%llx) marked for removal from peer cache\n",
- libcfs_nid2str(peer->nid), peer->addr);
+ libcfs_nidstr(&peer_nid), peer->addr);
- lnet_notify(peer->dev->kfd_ni, peer->nid, false, false,
+ lnet_notify(peer->dev->kfd_ni, &peer_nid, false, false,
peer->last_alive);
}
}
static void
kiblnd_peer_notify(struct kib_peer_ni *peer_ni)
{
- int error = 0;
+ int error = 0;
time64_t last_alive = 0;
unsigned long flags;
read_unlock_irqrestore(&kiblnd_data.kib_global_lock, flags);
- if (error != 0)
- lnet_notify(peer_ni->ibp_ni,
- peer_ni->ibp_nid, false, false, last_alive);
+ if (error != 0) {
+ struct lnet_nid nid;
+
+ lnet_nid4_to_nid(peer_ni->ibp_nid, &nid);
+ lnet_notify(peer_ni->ibp_ni, &nid,
+ false, false, last_alive);
+ }
}
void
if (notify)
lnet_notify(peer_ni->ksnp_ni,
- lnet_nid_to_nid4(&peer_ni->ksnp_id.nid),
+ &peer_ni->ksnp_id.nid,
false, false, last_alive);
}
* that deadline to the wall clock.
*/
deadline += ktime_get_seconds();
- return lnet_notify(NULL, data->ioc_nid, data->ioc_flags, false,
+ lnet_nid4_to_nid(data->ioc_nid, &nid);
+ return lnet_notify(NULL, &nid, data->ioc_flags, false,
deadline);
}
* when: notificaiton time.
*/
int
-lnet_notify(struct lnet_ni *ni, lnet_nid_t nid4, bool alive, bool reset,
+lnet_notify(struct lnet_ni *ni, struct lnet_nid *nid, bool alive, bool reset,
time64_t when)
{
struct lnet_peer_ni *lpni = NULL;
struct lnet_route *route;
struct lnet_peer *lp;
time64_t now = ktime_get_seconds();
- struct lnet_nid nid;
int cpt;
- lnet_nid4_to_nid(nid4, &nid);
LASSERT(!in_interrupt());
CDEBUG(D_NET, "%s notifying %s: %s\n",
(ni == NULL) ? "userspace" : libcfs_nidstr(&ni->ni_nid),
- libcfs_nidstr(&nid), alive ? "up" : "down");
+ libcfs_nidstr(nid), alive ? "up" : "down");
if (ni != NULL &&
- LNET_NID_NET(&ni->ni_nid) != LNET_NID_NET(&nid)) {
+ LNET_NID_NET(&ni->ni_nid) != LNET_NID_NET(nid)) {
CWARN("Ignoring notification of %s %s by %s (different net)\n",
- libcfs_nidstr(&nid), alive ? "birth" : "death",
+ libcfs_nidstr(nid), alive ? "birth" : "death",
libcfs_nidstr(&ni->ni_nid));
return -EINVAL;
}
if (when > now) {
CWARN("Ignoring prediction from %s of %s %s %lld seconds in the future\n",
ni ? libcfs_nidstr(&ni->ni_nid) : "userspace",
- libcfs_nidstr(&nid), alive ? "up" : "down", when - now);
+ libcfs_nidstr(nid), alive ? "up" : "down", when - now);
return -EINVAL;
}
return -ESHUTDOWN;
}
- lpni = lnet_peer_ni_find_locked(&nid);
+ lpni = lnet_peer_ni_find_locked(nid);
if (lpni == NULL) {
/* nid not found */
lnet_net_unlock(0);
- CDEBUG(D_NET, "%s not found\n", libcfs_nidstr(&nid));
+ CDEBUG(D_NET, "%s not found\n", libcfs_nidstr(nid));
return 0;
}