From: Amir Shehata Date: Fri, 19 Oct 2018 23:23:40 +0000 (-0700) Subject: LU-10153 lnet: remove route add restriction X-Git-Tag: 2.12.55~25^2~29 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=79ea6af86f57741bdd0b6bb49b380d8be454bf91;hp=69d1535ebdac139c6b19db2bca5f65663fe88467 LU-10153 lnet: remove route add restriction Remove restriction with adding routes to the same remote network via two different gateways. Test-Parameters: forbuildonly Signed-off-by: Amir Shehata Change-Id: Iefc5aa10f73e9e7bdd283f5e933fbb8ee819df50 Reviewed-on: https://review.whamcloud.com/33447 Reviewed-by: Sonia Sharma Reviewed-by: Chris Horn Reviewed-by: Olaf Weber Tested-by: Jenkins --- diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 05a36be..0ef75c2 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -584,7 +584,6 @@ void lnet_notify_locked(struct lnet_peer_ni *lp, int notifylnd, int alive, time64_t when); int lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway_nid, unsigned int priority); -int lnet_check_routes(void); int lnet_del_route(__u32 net, lnet_nid_t gw_nid); void lnet_destroy_routes(void); int lnet_get_route(int idx, __u32 *net, __u32 *hops, diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 3695d9f..99ccfd7 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -2575,10 +2575,6 @@ LNetNIInit(lnet_pid_t requested_pid) if (rc != 0) goto err_shutdown_lndnis; - rc = lnet_check_routes(); - if (rc != 0) - goto err_destroy_routes; - rc = lnet_rtrpools_alloc(im_a_router); if (rc != 0) goto err_destroy_routes; @@ -3527,12 +3523,6 @@ LNetCtl(unsigned int cmd, void *arg) config->cfg_nid, config->cfg_config_u.cfg_route. rtr_priority); - if (rc == 0) { - rc = lnet_check_routes(); - if (rc != 0) - lnet_del_route(config->cfg_net, - config->cfg_nid); - } mutex_unlock(&the_lnet.ln_api_mutex); return rc; diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 4b41feb..84929ef 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -429,63 +429,6 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway, } int -lnet_check_routes(void) -{ - struct lnet_remotenet *rnet; - struct lnet_route *route; - struct lnet_route *route2; - struct list_head *e1; - struct list_head *e2; - int cpt; - struct list_head *rn_list; - int i; - - cpt = lnet_net_lock_current(); - - for (i = 0; i < LNET_REMOTE_NETS_HASH_SIZE; i++) { - rn_list = &the_lnet.ln_remote_nets_hash[i]; - list_for_each(e1, rn_list) { - rnet = list_entry(e1, struct lnet_remotenet, lrn_list); - - route2 = NULL; - list_for_each(e2, &rnet->lrn_routes) { - lnet_nid_t nid1; - lnet_nid_t nid2; - int net; - - route = list_entry(e2, struct lnet_route, - lr_list); - - if (route2 == NULL) { - route2 = route; - continue; - } - - if (route->lr_gateway->lpni_net == - route2->lr_gateway->lpni_net) - continue; - - nid1 = route->lr_gateway->lpni_nid; - nid2 = route2->lr_gateway->lpni_nid; - net = rnet->lrn_net; - - lnet_net_unlock(cpt); - - CERROR("Routes to %s via %s and %s not " - "supported\n", - libcfs_net2str(net), - libcfs_nid2str(nid1), - libcfs_nid2str(nid2)); - return -EINVAL; - } - } - } - - lnet_net_unlock(cpt); - return 0; -} - -int lnet_del_route(__u32 net, lnet_nid_t gw_nid) { struct lnet_peer_ni *gateway;