requiring it to be over the limit before switching FPS regimes.
Print a small amount of data in LOG_WARN mode so that we can track progress.
Change an assert to a log to prevent crashing.
#include "ratetypes.h" /* needs util and pthread.h */
#include "logging.h"
#include "ratetypes.h" /* needs util and pthread.h */
#include "logging.h"
-static int underlimit_flowcount_count = 0;
-static int underlimit_normal_count = 0;
extern uint8_t system_loglevel;
extern uint8_t system_loglevel;
+static int printcounter = 8;
/**
* Called for each identity each estimate interval. Uses flow table information
/**
* Called for each identity each estimate interval. Uses flow table information
if (local_rate <= 0) {
idealweight = 0;
if (local_rate <= 0) {
idealweight = 0;
- } else if (dampen_increase == 0 && (ident->locallimit <= 0 || local_rate < ident->locallimit || ident->flowstart)) {
+ } else if (dampen_increase == 0 &&
+ (ident->locallimit <= 0 || local_rate < (ident->locallimit * CLOSE_ENOUGH) || ident->flowstart)) {
/* We're under the limit - all flows are bottlenecked. */
idealweight = allocate_fps_under_limit(ident, local_rate, peer_weights);
ideal_over = allocate_fps_over_limit(ident);
/* We're under the limit - all flows are bottlenecked. */
idealweight = allocate_fps_under_limit(ident, local_rate, peer_weights);
ideal_over = allocate_fps_over_limit(ident);
idealweight = ideal_over;
regime = 3;
dampen = 2;
idealweight = ideal_over;
regime = 3;
dampen = 2;
- underlimit_flowcount_count += 1;
} else {
regime = 1;
dampen = 0;
} else {
regime = 1;
dampen = 0;
- underlimit_normal_count += 1;
local_rate, idealweight, ident->localweight, total_weight);
}
local_rate, idealweight, ident->localweight, total_weight);
}
+ if (printcounter <= 0) {
+ printlog(LOG_WARN, "%d %.1f %.1f %.1f\n", local_rate, idealweight, ident->localweight, total_weight);
+ printcounter = 8;
+ } else {
+ printcounter -= 1;
+ }
+
//printf("Dampen: %d, dampen_increase: %d, peer_weights: %.3f, regime: %d\n",
// dampen, dampen_increase, peer_weights, regime);
//printf("Dampen: %d, dampen_increase: %d, peer_weights: %.3f, regime: %d\n",
// dampen, dampen_increase, peer_weights, regime);
- //printf("normal_count: %d, flowcount_count: %d\n", underlimit_normal_count, underlimit_flowcount_count);
-
if (regime == 3) {
printlog(LOG_DEBUG, "MIN: min said to use flow counting, which was %.3f when other method said %.3f.\n",
ideal_over, ideal_under);
if (regime == 3) {
printlog(LOG_DEBUG, "MIN: min said to use flow counting, which was %.3f when other method said %.3f.\n",
ideal_over, ideal_under);
* FLOW_START_THRESHOLD. */
if (ident->locallimit < FLOW_START_THRESHOLD) {
* FLOW_START_THRESHOLD. */
if (ident->locallimit < FLOW_START_THRESHOLD) {
- ident->locallimit = FLOW_START_THRESHOLD * 2;
+ ident->locallimit = FLOW_START_THRESHOLD;
}
/* Do not allow the node to set a limit higher than its
}
/* Do not allow the node to set a limit higher than its
printf("FPS: Setting local limit to %d\n", ident->locallimit);
}
printlog(LOG_DEBUG, "%d Limit ID:%d\n", ident->locallimit, ident->id);
printf("FPS: Setting local limit to %d\n", ident->locallimit);
}
printlog(LOG_DEBUG, "%d Limit ID:%d\n", ident->locallimit, ident->id);
+ printlog(LOG_WARN, "%d\n", ident->locallimit);
snprintf(cmd, CMD_BUFFER_SIZE,
"/sbin/tc class change dev eth0 parent 1:%x classid 1:%x htb rate 8bit ceil %dbps quantum 1600",
snprintf(cmd, CMD_BUFFER_SIZE,
"/sbin/tc class change dev eth0 parent 1:%x classid 1:%x htb rate 8bit ceil %dbps quantum 1600",
*
* This is used for FPS only. See estimate.c
*/
*
* This is used for FPS only. See estimate.c
*/
-#define FLOW_START_THRESHOLD (4096)
+#define FLOW_START_THRESHOLD (6000)
+
+#define CLOSE_ENOUGH (0.99)
/**
* All fields come from the ip protocol header.
/**
* All fields come from the ip protocol header.
- assert(current != NULL);
+ //assert(current != NULL);
+ if (current == NULL) {
+ printlog(LOG_WARN, "Flow %p disappeared?\n", current);
+ }
}
/* Remove the flow from the linked list. */
}
/* Remove the flow from the linked list. */
/* End delay testing */
#endif
/* End delay testing */
#endif
+//#define SFQTEST
+
+#ifdef SFQTEST
+ sprintf(cmd, "/sbin/tc qdisc del dev eth0 parent 1:1000 handle 1000 pfifo");
+ execute_cmd(cmd);
+
+ sprintf(cmd, "/sbin/tc qdisc replace dev eth0 parent 1:1000 handle 1000 sfq perturb 20");
+ execute_cmd(cmd);
+#endif
+