Whamcloud - gitweb
LU-10153 lnet: remove route add restriction 47/33447/23
authorAmir Shehata <ashehata@whamcloud.com>
Fri, 19 Oct 2018 23:23:40 +0000 (16:23 -0700)
committerAmir Shehata <ashehata@whamcloud.com>
Fri, 7 Jun 2019 18:10:58 +0000 (18:10 +0000)
Remove restriction with adding routes to the same remote network
via two different gateways.

Test-Parameters: forbuildonly
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Iefc5aa10f73e9e7bdd283f5e933fbb8ee819df50
Reviewed-on: https://review.whamcloud.com/33447
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Tested-by: Jenkins
lnet/include/lnet/lib-lnet.h
lnet/lnet/api-ni.c
lnet/lnet/router.c

index 05a36be..0ef75c2 100644 (file)
@@ -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);
                        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,
 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,
index 3695d9f..99ccfd7 100644 (file)
@@ -2575,10 +2575,6 @@ LNetNIInit(lnet_pid_t requested_pid)
                if (rc != 0)
                        goto err_shutdown_lndnis;
 
                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;
                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);
                                    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;
 
                mutex_unlock(&the_lnet.ln_api_mutex);
                return rc;
 
index 4b41feb..84929ef 100644 (file)
@@ -429,63 +429,6 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
 }
 
 int
 }
 
 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;
 lnet_del_route(__u32 net, lnet_nid_t gw_nid)
 {
        struct lnet_peer_ni     *gateway;