[Olsr-cvs] olsrd-current/src duplicate_set.c, 1.15, 1.16 hna_set.c, 1.21, 1.22 link_set.c, 1.72, 1.73 main.c, 1.99, 1.100 mid_set.c, 1.21, 1.22 mpr_selector_set.c, 1.17, 1.18 neighbor_table.c, 1.33, 1.34 scheduler.c, 1.42, 1.43 scheduler.h, 1.13, 1.14 tc_set.c, 1.29, 1.30

Bernd Petrovitsch (spam-protected)
Tue Sep 18 00:24:24 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22219/src

Modified Files:
	duplicate_set.c hna_set.c link_set.c main.c mid_set.c 
	mpr_selector_set.c neighbor_table.c scheduler.c scheduler.h 
	tc_set.c 
Log Message:
* applied 114-olsrd-timeoutlimit.patch

Index: tc_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** tc_set.c	13 Sep 2007 22:43:15 -0000	1.29
--- tc_set.c	17 Sep 2007 22:24:22 -0000	1.30
***************
*** 61,65 ****
    OLSR_PRINTF(5, "TC: init topo\n");
  
!   olsr_register_timeout_function(&olsr_time_out_tc_set);
  
    avl_init(&tc_tree, avl_comp_default);
--- 61,65 ----
    OLSR_PRINTF(5, "TC: init topo\n");
  
!   olsr_register_timeout_function(&olsr_time_out_tc_set, OLSR_TRUE);
  
    avl_init(&tc_tree, avl_comp_default);

Index: mid_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** mid_set.c	2 Aug 2007 21:50:22 -0000	1.21
--- mid_set.c	17 Sep 2007 22:24:22 -0000	1.22
***************
*** 70,74 ****
     * MID entries, the timeoutfunction is only ran once every second
     */
!   olsr_register_scheduler_event(&olsr_time_out_mid_set, NULL, 1, 0, NULL);
  
    for(idx=0;idx<HASHSIZE;idx++)
--- 70,74 ----
     * MID entries, the timeoutfunction is only ran once every second
     */
!   olsr_register_scheduler_event_dijkstra(&olsr_time_out_mid_set, NULL, 1, 0, NULL);
  
    for(idx=0;idx<HASHSIZE;idx++)

Index: hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** hna_set.c	5 Sep 2007 16:11:10 -0000	1.21
--- hna_set.c	17 Sep 2007 22:24:22 -0000	1.22
***************
*** 70,74 ****
     * HNA entries, the timeoutfunction is only ran once every second
     */
!   olsr_register_scheduler_event(&olsr_time_out_hna_set, NULL, 1, 0, NULL);
  
    for(idx=0;idx<HASHSIZE;idx++)
--- 70,74 ----
     * HNA entries, the timeoutfunction is only ran once every second
     */
!   olsr_register_scheduler_event_dijkstra(&olsr_time_out_hna_set, NULL, 1, 0, NULL);
  
    for(idx=0;idx<HASHSIZE;idx++)

Index: mpr_selector_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** mpr_selector_set.c	25 Apr 2007 22:08:09 -0000	1.17
--- mpr_selector_set.c	17 Sep 2007 22:24:22 -0000	1.18
***************
*** 62,66 ****
    ansn = 0;
  
!   olsr_register_timeout_function(&olsr_time_out_mprs_set);
    
    mprs_list.next = &mprs_list;
--- 62,66 ----
    ansn = 0;
  
!   olsr_register_timeout_function(&olsr_time_out_mprs_set, OLSR_TRUE);
    
    mprs_list.next = &mprs_list;

Index: duplicate_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/duplicate_set.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** duplicate_set.c	25 Apr 2007 22:08:07 -0000	1.15
--- duplicate_set.c	17 Sep 2007 22:24:22 -0000	1.16
***************
*** 67,71 ****
     * entries the timeoutfunction is only ran every 2 seconds
     */
!   olsr_register_scheduler_event(&olsr_time_out_duplicate_table, NULL, 2, 0, NULL);
    
    for(i = 0; i < HASHSIZE; i++)
--- 67,71 ----
     * entries the timeoutfunction is only ran every 2 seconds
     */
!   olsr_register_scheduler_event_dijkstra(&olsr_time_out_duplicate_table, NULL, 2, 0, NULL);
    
    for(i = 0; i < HASHSIZE; i++)

Index: scheduler.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** scheduler.c	19 Aug 2007 23:00:21 -0000	1.42
--- scheduler.c	17 Sep 2007 22:24:22 -0000	1.43
***************
*** 327,331 ****
  	 (entry->param == par) &&
  	 (entry->trigger == trigger) &&
! 	 (entry->interval == interval))
  	{
  	  if(entry == event_functions)
--- 327,331 ----
  	 (entry->param == par) &&
  	 (entry->trigger == trigger) &&
! 	 (0.0 > interval || entry->interval == interval))
  	{
  	  if(entry == event_functions)
***************
*** 348,357 ****
  }
  
  
  int
! olsr_register_timeout_function(void (*time_out_function)(void))
  {
    struct timeout_entry *new_entry;
  
    /* check that this entry is not added already */
    new_entry = timeout_functions;
--- 348,393 ----
  }
  
+ /*
+  * Sven-Ola, 2007: Since the original timing and flagging is changed (which
+  * saves lots of CPU time - see LinkQualityDijkstraLimit) the original timeout
+  * functions called every olsr_cnf->polltime uses too much CPU now. Because the
+  * changes_xxx handling is switched off with LQDL, it should be OK to call
+  * all timeout handlers at a much lower rate. To overcome UDP packet loss,
+  * a very low pollrate is used.
+  */
+ 
+ static float dijkstra_initial = 0.0;
  
  int
! olsr_register_scheduler_event_dijkstra(void (*event_function)(void *), 
! 			      void *par,
! 			      float interval, 
! 			      float initial, 
! 			      olsr_u8_t *trigger)
! {
!   if (1 < olsr_cnf->lq_level && 0.0 < olsr_cnf->lq_dinter)
!   {
!     dijkstra_initial += olsr_cnf->lq_dinter / 10.0;
!     return olsr_register_scheduler_event(event_function, par, olsr_cnf->lq_dinter, dijkstra_initial, trigger);
!   }
!   return olsr_register_scheduler_event(event_function, par, interval, initial, trigger);
! }
! 
! int
! olsr_register_timeout_function(void (*time_out_function)(void), olsr_bool dijkstra_limit_ok)
  {
    struct timeout_entry *new_entry;
  
+   if (dijkstra_limit_ok && 1 < olsr_cnf->lq_level && 0.0 < olsr_cnf->lq_dinter)
+   {
+     dijkstra_initial += olsr_cnf->lq_dinter / 10.0;
+     return olsr_register_scheduler_event(
+       (void *)time_out_function,
+       NULL,
+       olsr_cnf->lq_dinter,
+       dijkstra_initial,
+       NULL);
+   }
+   
    /* check that this entry is not added already */
    new_entry = timeout_functions;
***************
*** 380,387 ****
  
  int
! olsr_remove_timeout_function(void (*time_out_function)(void))
  {
    struct timeout_entry *entry, *prev;
  
    /* check that this entry is not added already */
    entry = timeout_functions;
--- 416,433 ----
  
  int
! olsr_remove_timeout_function(void (*time_out_function)(void), olsr_bool dijkstra_limit_ok)
  {
    struct timeout_entry *entry, *prev;
  
+   if (dijkstra_limit_ok && 1 < olsr_cnf->lq_level && 0.0 < olsr_cnf->lq_dinter)
+   {
+     return olsr_remove_scheduler_event(
+       (void *)time_out_function,
+       NULL,
+       -1.0,
+       -1.0,
+       NULL);
+   }
+   
    /* check that this entry is not added already */
    entry = timeout_functions;

Index: link_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** link_set.c	16 Sep 2007 21:45:25 -0000	1.72
--- link_set.c	17 Sep 2007 22:24:22 -0000	1.73
***************
*** 98,110 ****
    hold_time_neighbor = (NEIGHB_HOLD_TIME*1000) / olsr_cnf->system_tick_divider;
  
!   olsr_register_timeout_function(&olsr_time_out_link_set);
    if(olsr_cnf->use_hysteresis)
      {
!       olsr_register_timeout_function(&olsr_time_out_hysteresis);
      }
  
    if (olsr_cnf->lq_level > 0)
      {
!       olsr_register_timeout_function(&olsr_time_out_packet_loss);
      }
  }
--- 98,110 ----
    hold_time_neighbor = (NEIGHB_HOLD_TIME*1000) / olsr_cnf->system_tick_divider;
  
!   olsr_register_timeout_function(&olsr_time_out_link_set, OLSR_TRUE);
    if(olsr_cnf->use_hysteresis)
      {
!       olsr_register_timeout_function(&olsr_time_out_hysteresis, OLSR_TRUE);
      }
  
    if (olsr_cnf->lq_level > 0)
      {
!       olsr_register_timeout_function(&olsr_time_out_packet_loss, OLSR_TRUE);
      }
  }

Index: scheduler.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** scheduler.h	20 Apr 2007 13:46:04 -0000	1.13
--- scheduler.h	17 Sep 2007 22:24:22 -0000	1.14
***************
*** 73,80 ****
  
  int
! olsr_register_timeout_function(void (*)(void));
  
  int
! olsr_remove_timeout_function(void (*)(void));
  
  int
--- 73,83 ----
  
  int
! olsr_register_timeout_function(void (*)(void), olsr_bool);
  
  int
! olsr_remove_timeout_function(void (*)(void), olsr_bool);
! 
! int
! olsr_register_scheduler_event_dijkstra(void (*)(void *), void *, float, float, olsr_u8_t *);
  
  int

Index: main.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -d -r1.99 -r1.100
*** main.c	16 Sep 2007 21:20:16 -0000	1.99
--- main.c	17 Sep 2007 22:24:22 -0000	1.100
***************
*** 420,424 ****
  
    /* Register socket poll event */
!   olsr_register_timeout_function(&poll_sockets);
  
    /* Starting scheduler */
--- 420,424 ----
  
    /* Register socket poll event */
!   olsr_register_timeout_function(&poll_sockets, OLSR_FALSE);
  
    /* Starting scheduler */

Index: neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** neighbor_table.c	2 Aug 2007 21:57:06 -0000	1.33
--- neighbor_table.c	17 Sep 2007 22:24:22 -0000	1.34
***************
*** 61,65 ****
    int i;
  
!   olsr_register_timeout_function(&olsr_time_out_neighborhood_tables);
    for(i = 0; i < HASHSIZE; i++)
      {
--- 61,65 ----
    int i;
  
!   olsr_register_timeout_function(&olsr_time_out_neighborhood_tables, OLSR_TRUE);
    for(i = 0; i < HASHSIZE; i++)
      {





More information about the Olsr-cvs mailing list