summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author刘畅 <[email protected]>2023-07-14 02:25:19 +0000
committer刘畅 <[email protected]>2023-07-14 02:25:19 +0000
commitef3befccc46e6051ca4a456b9f5442b181d56617 (patch)
tree7ba5591af0147818104fedad34437cc53ae1ea65
parent6bef4d3eafed16f99ad898a692469d06e815fce9 (diff)
parentd5b09859c6afd831c60630f61ecade1b7915c740 (diff)
Merge branch 'bugfix-borrow_drop' into 'rel'
Bugfix borrow drop See merge request tango/shaping-engine!38
-rw-r--r--shaping/src/shaper.cpp10
-rw-r--r--shaping/test/stub.cpp2
2 files changed, 7 insertions, 5 deletions
diff --git a/shaping/src/shaper.cpp b/shaping/src/shaper.cpp
index a8f9d06..2d88b01 100644
--- a/shaping/src/shaper.cpp
+++ b/shaping/src/shaper.cpp
@@ -685,10 +685,12 @@ static enum shaping_packet_action shaper_pkt_action_decide_queueing(struct shapi
return SHAPING_FORWARD;
}
- clock_gettime(CLOCK_MONOTONIC, &curr_time);
- if (shaper_pkt_latency_us_calculate(pf_container[0].pf_info, &curr_time) > SHAPING_LATENCY_THRESHOLD) {
- shaper_flow_pop(ctx, sf);
- goto DROP;
+ if (pf_container[0].pf_type == PROFILE_IN_RULE_TYPE_PRIMARY) {
+ clock_gettime(CLOCK_MONOTONIC, &curr_time);
+ if (shaper_pkt_latency_us_calculate(pf_container[0].pf_info, &curr_time) > SHAPING_LATENCY_THRESHOLD) {
+ shaper_flow_pop(ctx, sf);
+ goto DROP;
+ }
}
/*todo: AQM, just for primary profile*/
diff --git a/shaping/test/stub.cpp b/shaping/test/stub.cpp
index 36f9fa8..9406752 100644
--- a/shaping/test/stub.cpp
+++ b/shaping/test/stub.cpp
@@ -49,7 +49,7 @@ struct stub_matched_rules matched_rules;
struct shaping_profile pf_array[MAX_STUB_PROFILE_NUM];
static int profile_priority_len[MAX_STUB_PROFILE_NUM][10] = {{0}};
-static unsigned long long curr_time = 1;
+static unsigned long long curr_time = 2000000000;//2s
void * stub_get_token_thread_func(void *data)
{