summaryrefslogtreecommitdiff
path: root/shaping/include
diff options
context:
space:
mode:
authorroot <[email protected]>2023-12-07 09:35:24 +0000
committerroot <[email protected]>2023-12-07 09:35:24 +0000
commited2b9e3d510882eef7a2fa20730d89794d24f2ce (patch)
treeee0711cdafebbee42d3afb445d6d8e9a1e65e919 /shaping/include
parentfe477349056d0797a5b1ca29556ee7689826b332 (diff)
TSG-17687: fix borrow early, only borrow when tconsume_cb don't get token
Diffstat (limited to 'shaping/include')
-rw-r--r--shaping/include/shaper.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/shaping/include/shaper.h b/shaping/include/shaper.h
index 7fede3b..9ae3846 100644
--- a/shaping/include/shaper.h
+++ b/shaping/include/shaper.h
@@ -19,7 +19,7 @@ extern "C" {
#define SHAPER_FLOW_POP_NUM_MAX 10
#define SESSION_CLOSE 0x1
-#define SESSION_UPDATE_PF_PRIO_LEN 0x2
+#define SESSION_BORROW 0x2
#define CONFIRM_PRIORITY_PKTS 20
@@ -150,6 +150,7 @@ struct shaping_flow {
int priority;
int rule_num;
int anchor;//rule_idx
+ int ref_cnt;
unsigned int queue_len;
unsigned int flag;
struct metadata ctrl_meta;
@@ -165,13 +166,26 @@ struct shaper_flow_instance {
int priority;
};
-struct shaping_async_cb_arg {
+struct shaping_tconsume_cb_arg {
struct shaping_thread_ctx *ctx;
struct shaping_profile_info *profile;
+ struct shaping_flow *sf;
unsigned char direction;
long long start_time_us;
};
+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;
+};
+
+struct shaping_hincrby_cb_arg {
+ struct shaping_thread_ctx *ctx;
+ long long start_time_us;
+};
+
struct shaper;//instance of shaping, thread unsafe
struct shaping_flow* shaping_flow_new(struct shaping_thread_ctx *ctx);