-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packet drop issue resolution #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,9 +110,6 @@ void Measure::ProcessBatch(Context *ctx, bess::PacketBatch *batch) { | |
uint64_t now_ns = tsc_to_ns(rdtsc()); | ||
size_t offset = offset_; | ||
|
||
mcslock_node_t mynode; | ||
mcs_lock(&lock_, &mynode); | ||
|
||
pkt_cnt_ += batch->cnt(); | ||
|
||
int cnt = batch->cnt(); | ||
|
@@ -132,21 +129,20 @@ void Measure::ProcessBatch(Context *ctx, bess::PacketBatch *batch) { | |
|
||
bytes_cnt_ += batch->pkts()[i]->total_len(); | ||
|
||
rtt_hist_.Insert(diff); | ||
rtt_hist_.AtomicInsert(diff); | ||
if (rand_.GetRealNonzero() <= jitter_sample_prob_) { | ||
if (unlikely(!last_rtt_ns_)) { | ||
last_rtt_ns_ = diff; | ||
continue; | ||
} | ||
uint64_t jitter = absdiff(diff, last_rtt_ns_); | ||
jitter_hist_.Insert(jitter); | ||
int64_t jitter = diff - last_rtt_ns_; | ||
jitter = jitter * ((jitter>0) - (jitter<0)); | ||
Comment on lines
+138
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to apply There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. covered in latest pr
Comment on lines
+138
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moreover, why do you have to change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this context, suggested change wont work as uint64_t wont be able to save negative values . |
||
jitter_hist_.AtomicInsert(jitter); | ||
last_rtt_ns_ = diff; | ||
} | ||
} | ||
} | ||
|
||
mcs_unlock(&lock_, &mynode); | ||
|
||
RunNextModule(ctx, batch); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use the
abs
?Of course, the above would need to include
<cstdlib>
if neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested change in line 138 wont work/compile as abs dnt work on atomics. latest patch has that change.