Now that ksocknal can send hello messages with 16-byte address, we can
change lnet_send_ping() to ping hosts with large-address nids.
Note that this doesn't change the addresses in the ping message sent,
only the sending and receiving of the message.
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 <neilb@suse.de>
Change-Id: I6f591c2f053698876195575c71da42f64788637e
Reviewed-on: https://review.whamcloud.com/43612
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
unsigned int len);
int lnet_send(struct lnet_nid *nid, struct lnet_msg *msg,
struct lnet_nid *rtr_nid);
unsigned int len);
int lnet_send(struct lnet_nid *nid, struct lnet_msg *msg,
struct lnet_nid *rtr_nid);
-int lnet_send_ping(lnet_nid_t dest_nid, struct lnet_handle_md *mdh, int nnis,
- void *user_ptr, lnet_handler_t handler, bool recovery);
+int lnet_send_ping(struct lnet_nid *dest_nid, struct lnet_handle_md *mdh,
+ int nnis, void *user_ptr, lnet_handler_t handler,
+ bool recovery);
void lnet_return_tx_credits_locked(struct lnet_msg *msg);
void lnet_return_rx_credits_locked(struct lnet_msg *msg);
void lnet_schedule_blocked_locked(struct lnet_rtrbufpool *rbp);
void lnet_return_tx_credits_locked(struct lnet_msg *msg);
void lnet_return_rx_credits_locked(struct lnet_msg *msg);
void lnet_schedule_blocked_locked(struct lnet_rtrbufpool *rbp);
struct lnet_mt_event_info {
enum lnet_mt_event_type mt_type;
struct lnet_mt_event_info {
enum lnet_mt_event_type mt_type;
+ struct lnet_nid mt_nid;
};
/* called with res_lock held */
};
/* called with res_lock held */
struct lnet_handle_md mdh;
struct lnet_ni *tmp;
struct lnet_ni *ni;
struct lnet_handle_md mdh;
struct lnet_ni *tmp;
struct lnet_ni *ni;
int healthv;
int rc;
time64_t now;
int healthv;
int rc;
time64_t now;
* We'll unlink the mdh in this case below.
*/
LNetInvalidateMDHandle(&ni->ni_ping_mdh);
* We'll unlink the mdh in this case below.
*/
LNetInvalidateMDHandle(&ni->ni_ping_mdh);
- /* FIXME need to handle large-addr nid */
- nid = lnet_nid_to_nid4(&ni->ni_nid);
/*
* remove the NI from the local queue and drop the
/*
* remove the NI from the local queue and drop the
ev_info->mt_type = MT_TYPE_LOCAL_NI;
ev_info->mt_nid = nid;
ev_info->mt_type = MT_TYPE_LOCAL_NI;
ev_info->mt_nid = nid;
- rc = lnet_send_ping(nid, &mdh, LNET_INTERFACES_MIN,
+ rc = lnet_send_ping(&nid, &mdh, LNET_INTERFACES_MIN,
ev_info, the_lnet.ln_mt_handler,
true);
/* lookup the nid again */
lnet_net_lock(0);
ev_info, the_lnet.ln_mt_handler,
true);
/* lookup the nid again */
lnet_net_lock(0);
- ni = lnet_nid2ni_locked(nid, 0);
+ ni = lnet_nid_to_ni_locked(&nid, 0);
if (!ni) {
/*
* the NI has been deleted when we dropped
if (!ni) {
/*
* the NI has been deleted when we dropped
struct lnet_handle_md mdh;
struct lnet_peer_ni *lpni;
struct lnet_peer_ni *tmp;
struct lnet_handle_md mdh;
struct lnet_peer_ni *lpni;
struct lnet_peer_ni *tmp;
int healthv;
int rc;
time64_t now;
int healthv;
int rc;
time64_t now;
/* look at the comments in lnet_recover_local_nis() */
mdh = lpni->lpni_recovery_ping_mdh;
/* look at the comments in lnet_recover_local_nis() */
mdh = lpni->lpni_recovery_ping_mdh;
LNetInvalidateMDHandle(&lpni->lpni_recovery_ping_mdh);
LNetInvalidateMDHandle(&lpni->lpni_recovery_ping_mdh);
- /* FIXME handle large-addr nid */
- nid = lnet_nid_to_nid4(&lpni->lpni_nid);
lnet_net_lock(0);
list_del_init(&lpni->lpni_recovery);
lnet_peer_ni_decref_locked(lpni);
lnet_net_lock(0);
list_del_init(&lpni->lpni_recovery);
lnet_peer_ni_decref_locked(lpni);
ev_info->mt_type = MT_TYPE_PEER_NI;
ev_info->mt_nid = nid;
ev_info->mt_type = MT_TYPE_PEER_NI;
ev_info->mt_nid = nid;
- rc = lnet_send_ping(nid, &mdh, LNET_INTERFACES_MIN,
+ rc = lnet_send_ping(&nid, &mdh, LNET_INTERFACES_MIN,
ev_info, the_lnet.ln_mt_handler,
true);
lnet_net_lock(0);
ev_info, the_lnet.ln_mt_handler,
true);
lnet_net_lock(0);
* lnet_find_peer_ni_locked() grabs a refcount for
* us. No need to take it explicitly.
*/
* lnet_find_peer_ni_locked() grabs a refcount for
* us. No need to take it explicitly.
*/
- lpni = lnet_find_peer_ni_locked(nid);
+ lpni = lnet_peer_ni_find_locked(&nid);
if (!lpni) {
lnet_net_unlock(0);
LNetMDUnlink(mdh);
if (!lpni) {
lnet_net_unlock(0);
LNetMDUnlink(mdh);
* Returns < 0 if LNetGet fails
*/
int
* Returns < 0 if LNetGet fails
*/
int
-lnet_send_ping(lnet_nid_t dest_nid,
+lnet_send_ping(struct lnet_nid *dest_nid,
struct lnet_handle_md *mdh, int nnis,
void *user_data, lnet_handler_t handler, bool recovery)
{
struct lnet_handle_md *mdh, int nnis,
void *user_data, lnet_handler_t handler, bool recovery)
{
struct lnet_ping_buffer *pbuf;
int rc;
struct lnet_ping_buffer *pbuf;
int rc;
- if (dest_nid == LNET_NID_ANY) {
+ if (LNET_NID_IS_ANY(dest_nid)) {
rc = -EHOSTUNREACH;
goto fail_error;
}
rc = -EHOSTUNREACH;
goto fail_error;
}
goto fail_error;
}
id.pid = LNET_PID_LUSTRE;
goto fail_error;
}
id.pid = LNET_PID_LUSTRE;
+ id.nid = lnet_nid_to_nid4(dest_nid);
rc = LNetGet(LNET_NID_ANY, *mdh, id,
LNET_RESERVED_PORTAL,
rc = LNetGet(LNET_NID_ANY, *mdh, id,
LNET_RESERVED_PORTAL,
lnet_handle_recovery_reply(struct lnet_mt_event_info *ev_info,
int status, bool send, bool unlink_event)
{
lnet_handle_recovery_reply(struct lnet_mt_event_info *ev_info,
int status, bool send, bool unlink_event)
{
- lnet_nid_t nid = ev_info->mt_nid;
+ struct lnet_nid *nid = &ev_info->mt_nid;
if (ev_info->mt_type == MT_TYPE_LOCAL_NI) {
struct lnet_ni *ni;
lnet_net_lock(0);
if (ev_info->mt_type == MT_TYPE_LOCAL_NI) {
struct lnet_ni *ni;
lnet_net_lock(0);
- ni = lnet_nid2ni_locked(nid, 0);
+ ni = lnet_nid_to_ni_locked(nid, 0);
if (!ni) {
lnet_net_unlock(0);
return;
if (!ni) {
lnet_net_unlock(0);
return;
if (status != 0) {
CERROR("local NI (%s) recovery failed with %d\n",
if (status != 0) {
CERROR("local NI (%s) recovery failed with %d\n",
- libcfs_nid2str(nid), status);
+ libcfs_nidstr(nid), status);
int cpt;
cpt = lnet_net_lock_current();
int cpt;
cpt = lnet_net_lock_current();
- lpni = lnet_find_peer_ni_locked(nid);
+ lpni = lnet_peer_ni_find_locked(nid);
if (!lpni) {
lnet_net_unlock(cpt);
return;
if (!lpni) {
lnet_net_unlock(cpt);
return;
if (status != 0)
CERROR("peer NI (%s) recovery failed with %d\n",
if (status != 0)
CERROR("peer NI (%s) recovery failed with %d\n",
- libcfs_nid2str(nid), status);
+ libcfs_nidstr(nid), status);
switch (event->type) {
case LNET_EVENT_UNLINK:
CDEBUG(D_NET, "%s recovery ping unlinked\n",
switch (event->type) {
case LNET_EVENT_UNLINK:
CDEBUG(D_NET, "%s recovery ping unlinked\n",
- libcfs_nid2str(ev_info->mt_nid));
+ libcfs_nidstr(&ev_info->mt_nid));
/* fallthrough */
case LNET_EVENT_REPLY:
lnet_handle_recovery_reply(ev_info, event->status, false,
/* fallthrough */
case LNET_EVENT_REPLY:
lnet_handle_recovery_reply(ev_info, event->status, false,
break;
case LNET_EVENT_SEND:
CDEBUG(D_NET, "%s recovery message sent %s:%d\n",
break;
case LNET_EVENT_SEND:
CDEBUG(D_NET, "%s recovery message sent %s:%d\n",
- libcfs_nid2str(ev_info->mt_nid),
+ libcfs_nidstr(&ev_info->mt_nid),
(event->status) ? "unsuccessfully" :
"successfully", event->status);
lnet_handle_recovery_reply(ev_info, event->status, true, false);
(event->status) ? "unsuccessfully" :
"successfully", event->status);
lnet_handle_recovery_reply(ev_info, event->status, true, false);
nnis = max(lp->lp_data_nnis, LNET_INTERFACES_MIN);
nnis = max(lp->lp_data_nnis, LNET_INTERFACES_MIN);
- rc = lnet_send_ping(lnet_nid_to_nid4(&lp->lp_primary_nid),
- &lp->lp_ping_mdh, nnis, lp,
+ rc = lnet_send_ping(&lp->lp_primary_nid, &lp->lp_ping_mdh, nnis, lp,
the_lnet.ln_dc_handler, false);
/*
the_lnet.ln_dc_handler, false);
/*