Skip to content

Commit

Permalink
fix(QoS): Get now after get lock to prevent from negtive elapsed time.
Browse files Browse the repository at this point in the history
  • Loading branch information
leohung-free5GC committed Dec 25, 2024
1 parent 5c04e67 commit e0f86c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gtpu/trTCM.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ Color policePacket(TrafficPolicer* p, int pktLen) {
u64 refillTokens = 0;
u64 tc, te = 0;
u64 elapsed = 0;
u64 now = ktime_get_ns();
u64 now = 0;

spin_lock(&p->lock);

now = ktime_get_ns();
elapsed = now - p->lastUpdate;
p->lastUpdate = now;

Expand Down

0 comments on commit e0f86c6

Please sign in to comment.