--- embedaddon/quagga/ospfd/ospf_ase.c 2012/10/09 09:22:29 1.1.1.2 +++ embedaddon/quagga/ospfd/ospf_ase.c 2016/11/02 10:09:12 1.1.1.3 @@ -636,6 +636,7 @@ ospf_ase_calculate_timer (struct thread *t) struct route_node *rn; struct listnode *node; struct ospf_area *area; + struct timeval start_time, stop_time; ospf = THREAD_ARG (t); ospf->t_ase_calc = NULL; @@ -644,6 +645,8 @@ ospf_ase_calculate_timer (struct thread *t) { ospf->ase_calc = 0; + quagga_gettime(QUAGGA_CLK_MONOTONIC, &start_time); + /* Calculate external route for each AS-external-LSA */ LSDB_LOOP (EXTERNAL_LSDB (ospf), rn, lsa) ospf_ase_calculate_route (ospf, lsa); @@ -673,6 +676,12 @@ ospf_ase_calculate_timer (struct thread *t) ospf_route_table_free (ospf->old_external_route); ospf->old_external_route = ospf->new_external_route; ospf->new_external_route = route_table_init (); + + quagga_gettime(QUAGGA_CLK_MONOTONIC, &stop_time); + + zlog_info ("SPF Processing Time(usecs): External Routes: %lld\n", + (stop_time.tv_sec - start_time.tv_sec)*1000000LL+ + (stop_time.tv_usec - start_time.tv_usec)); } return 0; } @@ -714,6 +723,8 @@ ospf_ase_register_external_lsa (struct ospf_lsa *lsa, rn = route_node_get (top->external_lsas, (struct prefix *) &p); if ((lst = rn->info) == NULL) rn->info = lst = list_new(); + else + route_unlock_node (rn); /* We assume that if LSA is deleted from DB is is also deleted from this RT */ @@ -734,13 +745,13 @@ ospf_ase_unregister_external_lsa (struct ospf_lsa *lsa p.prefixlen = ip_masklen (al->mask); apply_mask_ipv4 (&p); - rn = route_node_get (top->external_lsas, (struct prefix *) &p); - lst = rn->info; + rn = route_node_lookup (top->external_lsas, (struct prefix *) &p); - /* XXX lst can be NULL */ - if (lst) { + if (rn) { + lst = rn->info; listnode_delete (lst, lsa); ospf_lsa_unlock (&lsa); /* external_lsas list */ + route_unlock_node (rn); } } @@ -812,6 +823,7 @@ ospf_ase_incremental_update (struct ospf *ospf, struct { rn2 = route_node_get (tmp_old, (struct prefix *) &p); rn2->info = rn->info; + route_unlock_node (rn); } /* install changes to zebra */ @@ -835,7 +847,6 @@ ospf_ase_incremental_update (struct ospf *ospf, struct if (rn) { rn->info = NULL; - route_unlock_node (rn); route_unlock_node (rn); } }