@@ -1907,7 +1907,6 @@ struct lnet_ni *
struct lnet_peer **gw_peer)
{
int rc;
- u32 local_lnet;
struct lnet_peer *gw;
struct lnet_peer *lp;
struct lnet_peer_net *lpn;
@@ -1936,10 +1935,8 @@ struct lnet_ni *
if (gwni) {
gw = gwni->lpni_peer_net->lpn_peer;
lnet_peer_ni_decref_locked(gwni);
- if (gw->lp_rtr_refcount) {
- local_lnet = LNET_NIDNET(sd->sd_rtr_nid);
+ if (gw->lp_rtr_refcount)
route_found = true;
- }
} else {
CWARN("No peer NI for gateway %s. Attempting to find an alternative route.\n",
libcfs_nid2str(sd->sd_rtr_nid));
@@ -2054,31 +2051,26 @@ struct lnet_ni *
gw = best_route->lr_gateway;
LASSERT(gw == gwni->lpni_peer_net->lpn_peer);
- local_lnet = best_route->lr_lnet;
}
/* Discover this gateway if it hasn't already been discovered.
* This means we might delay the message until discovery has
* completed
*/
- sd->sd_msg->msg_src_nid_param = sd->sd_src_nid;
rc = lnet_initiate_peer_discovery(gwni, sd->sd_msg, sd->sd_cpt);
if (rc)
return rc;
if (!sd->sd_best_ni) {
- struct lnet_peer_net *lpeer;
-
- lpeer = lnet_peer_get_net_locked(gw, local_lnet);
- sd->sd_best_ni = lnet_find_best_ni_on_spec_net(NULL, gw, lpeer,
+ lpn = gwni->lpni_peer_net;
+ sd->sd_best_ni = lnet_find_best_ni_on_spec_net(NULL, gw, lpn,
sd->sd_md_cpt);
- }
-
- if (!sd->sd_best_ni) {
- CERROR("Internal Error. Expected local ni on %s but non found :%s\n",
- libcfs_net2str(local_lnet),
- libcfs_nid2str(sd->sd_src_nid));
- return -EFAULT;
+ if (!sd->sd_best_ni) {
+ CERROR("Internal Error. Expected local ni on %s but non found :%s\n",
+ libcfs_net2str(lpn->lpn_net_id),
+ libcfs_nid2str(sd->sd_src_nid));
+ return -EFAULT;
+ }
}
*gw_lpni = gwni;