]> rtime.felk.cvut.cz Git - frescor/fna.git/commitdiff
error in mapping function corrected using ceil... packets constant moved to config...
authorsangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Tue, 6 May 2008 18:26:41 +0000 (18:26 +0000)
committersangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Tue, 6 May 2008 18:26:41 +0000 (18:26 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fna/trunk@1153 35b4ef3e-fd22-0410-ab77-dab3279adceb

src_frescan/frescan_bwres_analysis.c
src_frescan/frescan_bwres_fna.c
src_frescan/frescan_config.h
src_frescan/frescan_packets.c
src_frescan/frescan_packets.h
src_frescan/frescan_queues.c
src_frescan/frescan_servers_replenishments.c_posix

index 00d5fe61cc1278684e27a682e89345a7693e48b7..85a66bae3a7f2dd66f5ae4d2aca0f518f5835b16 100644 (file)
@@ -225,7 +225,7 @@ int frescan_sa_sched_test(frescan_sa_scenario_t *scenario,
         int num_contracts;
         double utilization, max_utilization, budget, period;
 
-        WARNING("simplified ub test (no blocks, prio ordered)\n");
+        // WARNING("simplified ub test (no blocks, prio ordered)\n");
 
         utilization = 0.0;
         num_contracts = 0;
index 2262ac68332a06e9c83a9bedf88dc0cc96266b56..103bce09b3728d6d7b048111ec30346a14c10b29 100644 (file)
@@ -13,6 +13,8 @@
  *
  */
 
+#include <math.h> /* ceil */
+
 #include "frsh.h" /* frsh_resource_id_t, .. */
 #include "frescan.h" /* frescan_init, ... */
 #include "frescan_data.h" /* frescan_contract_t, ... */
@@ -891,7 +893,7 @@ int frescan_fna_network_bytes_to_budget
         }
 
         // we measure the budget in number of FRESCAN frames (8 bytes)
-        number_of_packets = nbytes / 8 + 1;
+        number_of_packets = (int) ceil((double)nbytes / 8.0);
 
         // we store the budget in number of packets instead of in time. We
         // use a field in the timespec structure.
index d853d6378d85d7b9ff93d49351633cfd4af52f0b..9c8470e499b4668115b3e755911d1db10054a21c 100644 (file)
@@ -27,7 +27,7 @@
 #include "fosa_threads_and_signals.h" // FOSA_SIGNAL_MIN
 #include <sys/kernel.h>  // kernel_enter_critic_section
 
-#define FRESCAN_MX_REPL_OPS       100
+#define FRESCAN_MX_PACKETS        200
 #define FRESCAN_MX_NETWORKS       2
 #define FRESCAN_BROADCAST_ADDR    0xF
 #define FRESCAN_MX_IDS            255
@@ -47,7 +47,8 @@
 #define FRESCAN_NEG_CHANNEL       0
 #define FRESCAN_MX_NODES          2
 #define FRESCAN_MX_CONTRACTS      (FRESCAN_MX_NODES*FRESCAN_MX_IDS)
-#define FRESCAN_FRAME_TX_TIME     0.01  // TODO: must be measured
+#define FRESCAN_MX_REPL_OPS       FRESCAN_MX_IDS*10
+#define FRESCAN_FRAME_TX_TIME     0.000200  // measured transmission time of an 8byte frame
 
 #define FRESCAN_MLOCK_T            unsigned
 #define FRESCAN_CREATE_LOCK(l)
index 55744b70d13683c155f2452d1646ef738048b190..3294b3577f51ab094035204a00e7dc9fd1e29ed4 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "frescan_packets.h"
 #include "frescan_debug.h"
+#include "frescan_config.h"
 #include <misc/freelist.h>
 
 /**
index 37e01f3fcb59b0b822df03d0d1a87766ee04e250..6f1f188aa72967f63e4415639d1a59ac8af16801 100644 (file)
@@ -84,8 +84,6 @@ typedef struct {
         int pool_pos;
 } frescan_packet_t;
 
-#define FRESCAN_MX_PACKETS      100
-
 /**
  * frescan_packets_init
  *
index b6ae28a2b08d017264db76ca989c9231d05c9f77..059827b4fd9f17676dc2f99b801006a364dafc6e 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <stdlib.h>
 #include <time.h>
-#include <misc/timespec_operations.h>
 
 #include "frescan_queues.h"
 #include "frescan_packets.h"
index 2b8e36b5c12e2e0609175128c9b9e26cf445bc38..32d54a59c9a9a5370d2a74f57db46d2c8f005fc5 100644 (file)
@@ -55,7 +55,7 @@ static int frescan_repl_op_init()
         return freelist_init(&the_repl_op_pool_freelist, FRESCAN_MX_REPL_OPS);
 }
 
-static frescan_repl_op_t *frescan_repl_op_alloc()
+frescan_repl_op_t *frescan_repl_op_alloc()
 {
         int pos;
 
@@ -68,7 +68,7 @@ static frescan_repl_op_t *frescan_repl_op_alloc()
         return &the_repl_op_pool[pos];
 }
 
-static int frescan_repl_op_free(frescan_repl_op_t *repl_op)
+int frescan_repl_op_free(frescan_repl_op_t *repl_op)
 {
         return freelist_free(&the_repl_op_pool_freelist, repl_op->pool_pos);
 }