X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drl%2Fratetypes.h;h=dc7f6c938e250bf8072a1a18788ce70f35f00fe4;hb=d12ab8f1cd4ff135d692f7841360af70f0beb57b;hp=59a481ab6abb6d13bbe501975540824d2aa9eeac;hpb=19bf89f36a91be2fdd4a0b6c7099f7515507e1e1;p=distributedratelimiting.git diff --git a/drl/ratetypes.h b/drl/ratetypes.h index 59a481a..dc7f6c9 100644 --- a/drl/ratetypes.h +++ b/drl/ratetypes.h @@ -17,13 +17,14 @@ #include "rate_accounting/simple.h" #endif -#include "calendar.h" +#include "bsd_queue.h" #include "config.h" #include "drl_state.h" #include "common_accounting.h" #include "standard.h" #include "samplehold.h" #include "simple.h" +#include "multipleinterval.h" /** Represents a DRL entitiy/group. */ @@ -41,6 +42,9 @@ typedef struct identity { /** Pointer to the identity's parent in the HTB hierarchy. */ struct identity *parent; + /** For sets, indicates the parent should be 0x10. Meaningless for machines. */ + int independent; + /** Array of the leaves that are limited by this identity. Points into the * leaves array for the identity's instance. */ struct leaf **leaves; @@ -85,6 +89,9 @@ typedef struct identity { * flows to grow before incurring losses. */ int flowstart; + /** Keeps track of the state of FPS dampening for this identity. */ + enum dampenings dampen_state; + /* GRD */ /** GRD drop probability information. */ @@ -126,17 +133,47 @@ typedef struct identity { /** Function to call when the table should be destroyed. */ void (*table_destroy_function)(void *); +#ifdef SHADOW_ACCTING + + common_accounting_t shadow_common; + + void *shadow_table; + + double localweight_copy; + double last_localweight_copy; + + enum dampenings dampen_state_copy; + +#endif + /* Scheduling bookkeeping. */ - /* Pointers to other identities in the scheduling calendar. */ - TAILQ_ENTRY(identity) calendar; + /** Scheduling unit that tells the limiter when to execute the main loop.*/ + struct ident_action *loop_action; - /* The number of limiter ticks at which this identity should be scheduled. - */ - uint32_t intervals; + /** Scheduling unit that tells the limiter when to communicate.*/ + struct ident_action *comm_action; + + /** The number of limiter ticks that should pass before this identity should + * be scheduled to execute its main estimate/allocate/enforce loop. */ + uint32_t mainloop_intervals; + + /** The number of limiter ticks that should pass before this identity should + * be scheduled for communication. */ + uint32_t communication_intervals; } identity_t; +enum identity_actions { ACTION_MAINLOOP = 1, ACTION_COMMUNICATE = 2 }; + +typedef struct ident_action { + struct identity *ident; + enum identity_actions action; + int valid; + + TAILQ_ENTRY(ident_action) calendar; +} identity_action; + /** * Represents the bottom most entity in the HTB hierarchy. For PlanetLab, * this corresponds to sliver (identified by Vserver context id, or xid).