[hipl-commit] [tiny] Rev 3582: Fixed performance measurement for CLOSE packets.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Fri, 26 Feb 2010 13:23:06 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Fri Feb 26 12:22:52 2010 +0100
Revision: 3582
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Fixed performance measurement for CLOSE packets.

Modified:
  M  hipd/close.c
  M  hipd/init.c

=== modified file 'hipd/close.c'
--- hipd/close.c        2010-02-24 15:12:39 +0000
+++ hipd/close.c        2010-02-26 11:22:52 +0000
@@ -177,14 +177,14 @@
                      const uint32_t ha_state,
                      struct hip_packet_context *ctx)
 {
-#ifdef CONFIG_HIP_PERFORMANCE
-    HIP_DEBUG("Start PERF_HANDLE_CLOSE\n");
-    hip_perf_start_benchmark( perf_set, PERF_HANDLE_CLOSE );
-#endif
     uint16_t mask = HIP_PACKET_CTRL_ANON;
     int err = 0, echo_len;
     struct hip_common *close_ack = NULL;
     struct hip_echo_request *request;
+#ifdef CONFIG_HIP_PERFORMANCE
+    HIP_DEBUG("Start PERF_HANDLE_CLOSE\n");
+    hip_perf_start_benchmark( perf_set, PERF_HANDLE_CLOSE );
+#endif
 
     HIP_IFEL(ipv6_addr_any(&(ctx->msg)->hitr), -1,
              "Received NULL receiver HIT in CLOSE. Dropping\n");
@@ -273,17 +273,17 @@
 
     HIP_IFEL(hip_del_peer_info(&(ctx->hadb_entry)->hit_our, 
&(ctx->hadb_entry)->hit_peer), -1,
              "Deleting peer info failed.\n");
+out_err:
+
+    if (close_ack) {
+        HIP_FREE(close_ack);
+    }
+
 #ifdef CONFIG_HIP_PERFORMANCE
     HIP_DEBUG("Stop and write PERF_HANDLE_CLOSE\n");
     hip_perf_stop_benchmark( perf_set, PERF_HANDLE_CLOSE );
     hip_perf_write_benchmark( perf_set, PERF_HANDLE_CLOSE );
 #endif
-out_err:
-
-    if (close_ack) {
-        HIP_FREE(close_ack);
-    }
-
     return err;
 }
 

=== modified file 'hipd/init.c'
--- hipd/init.c 2010-02-26 11:21:20 +0000
+++ hipd/init.c 2010-02-26 11:22:52 +0000
@@ -473,17 +473,6 @@
     hip_register_handle_function(HIP_CLOSE, HIP_STATE_CLOSED,       
&hip_drop_packet, 0);
     hip_register_handle_function(HIP_CLOSE, HIP_STATE_NONE,         
&hip_drop_packet, 0);
 
-    /** @todo Register performance measurement functions as handle functions */
-#if 0
-#ifdef CONFIG_HIP_PERFORMANCE
-    HIP_DEBUG("Start PERF_HANDLE_CLOSE\n");
-    hip_perf_start_benchmark(perf_set, PERF_HANDLE_CLOSE);
-    HIP_DEBUG("Stop and write PERF_HANDLE_CLOSE");
-    hip_perf_stop_benchmark(perf_set, PERF_HANDLE_CLOSE);
-    hip_perf_write_benchmark(perf_set, PERF_HANDLE_CLOSE);
-#endif
-#endif
-
     hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_UNASSOCIATED, 
&hip_drop_packet, 0);
     hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_I1_SENT,      
&hip_drop_packet, 0);
     hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_I2_SENT,      
&hip_drop_packet, 0);

Other related posts:

  • » [hipl-commit] [tiny] Rev 3582: Fixed performance measurement for CLOSE packets. - Tim Just