summaryrefslogtreecommitdiff
path: root/shaping/include
diff options
context:
space:
mode:
authorroot <[email protected]>2024-01-19 02:33:20 +0000
committerroot <[email protected]>2024-01-19 02:33:20 +0000
commitf0c91c0cfd4ec5a8f3e6636605484f1467c40a1f (patch)
tree93e2b2045d9e83aa6565b7f0d84271f636851345 /shaping/include
parent008d4b3906cc84e007f4519f901a288dd968a14e (diff)
temp code feature AQM blue alghorithm
Diffstat (limited to 'shaping/include')
-rw-r--r--shaping/include/shaper.h34
-rw-r--r--shaping/include/shaper_aqm.h2
2 files changed, 31 insertions, 5 deletions
diff --git a/shaping/include/shaper.h b/shaping/include/shaper.h
index 6168191..069abcf 100644
--- a/shaping/include/shaper.h
+++ b/shaping/include/shaper.h
@@ -97,6 +97,33 @@ enum shaping_profile_type {
PROFILE_TYPE_SPLIT_BY_LOCAL_HOST
};
+enum shaper_aqm_type {
+ AQM_TYPE_NONE = 0,
+ AQM_TYPE_BLUE,
+ AQM_TYPE_CODEL,
+ AQM_TYPE_MAX
+};
+
+struct shaper_aqm_blue_para {
+ time_t update_time;
+ int probability;
+};
+
+struct shaping_profile_hash_node {
+ int id;
+ enum shaper_aqm_type aqm_type;
+ int in_deposit_token_bits[SHAPING_PRIORITY_NUM_MAX];
+ int out_deposit_token_bits[SHAPING_PRIORITY_NUM_MAX];
+ long long last_failed_get_token_ms;
+ long long last_hmget_ms;
+ long long queue_len[SHAPING_PRIORITY_NUM_MAX];
+ long long priority_blocked_time_ms[SHAPING_PRIORITY_NUM_MAX];
+ int ref_cnt;
+ struct shaper_aqm_blue_para aqm_blue_para;
+ unsigned char is_invalid;
+ UT_hash_handle hh;
+};
+
struct shaping_profile_info {
int id;//profile_id
enum shaping_profile_type type;
@@ -126,6 +153,7 @@ struct shaping_packet_wrapper {
unsigned int length;
int rule_anchor;
unsigned char direction;
+ unsigned char aqm_processed;
TAILQ_ENTRY(shaping_packet_wrapper) node;
};
TAILQ_HEAD(delay_queue, shaping_packet_wrapper);
@@ -179,7 +207,6 @@ struct shaping_tconsume_cb_arg {
struct shaping_hmget_cb_arg {
struct shaping_thread_ctx *ctx;
struct shaping_profile_hash_node *pf_hash_node;
- int priority;
long long start_time_us;
};
@@ -202,10 +229,7 @@ bool shaper_queue_empty(struct shaping_flow *sf);
void shaper_packet_dequeue(struct shaping_flow *sf);
struct shaping_packet_wrapper* shaper_first_pkt_get(struct shaping_flow *sf);
void shaper_queue_clear(struct shaping_flow *sf, struct shaping_thread_ctx *ctx);
-/*return value: 0 for success, -1 for failed*/
-int shaper_flow_push(struct shaping_thread_ctx *ctx, struct shaping_flow *sf, unsigned long long enqueue_time);
-/*return num of sf_ins*/
-void shaper_flow_pop(struct shaping_thread_ctx *ctx, struct shaping_flow *sf);
+
int shaper_flow_in_order_get(struct shaper *sp, struct shaper_flow_instance sf_ins[], int priority, int max_sf_num);
//enum shaping_packet_action shaper_pkt_action_decide(struct shaping_thread_ctx *ctx, struct shaping_flow *sf, int priority, int sf_in_queue);
diff --git a/shaping/include/shaper_aqm.h b/shaping/include/shaper_aqm.h
new file mode 100644
index 0000000..794c74d
--- /dev/null
+++ b/shaping/include/shaper_aqm.h
@@ -0,0 +1,2 @@
+
+int shaper_aqm_need_drop(struct shaping_profile_info *profile, struct shaping_packet_wrapper *pkt_wrapper); \ No newline at end of file