MCPcopy Create free account
hub / github.com/NetSys/bess / DropDequeue

Method DropDequeue

core/utils/codel.h:250–268  ·  view source on GitHub ↗

Called while Codel is in drop state to determine whether to drop the current entries and dequeue the next entry. Will continue to drop entries until the next drop is greater than the current time. Takes a Wrapper which is the next entry in the queue which will potentially be replaced and a boolean determing if the entry should be dropped. Returns 0 on success.

Source from the content-addressed store, hash-verified

248 // entry in the queue which will potentially be replaced and a boolean determing
249 // if the entry should be dropped. Returns 0 on success.
250 int DropDequeue(Wrapper &w, bool &drop) {
251 uint64_t now = NanoSecondTime();
252 if (!drop) {
253 dropping_ = 0;
254 } else if (now >= next_drop_time_) {
255 while (now >= next_drop_time_ && dropping_) {
256 Drop(w);
257 drop_count_++;
258 int err = RingDequeue(w, drop);
259
260 if (err != 0 || !drop) {
261 dropping_ = 0;
262 return err;
263 }
264 next_drop_time_ = NextDrop(next_drop_time_);
265 }
266 }
267 return 0;
268 }
269
270 // Returns the current time in microseconds.
271 uint64_t NanoSecondTime() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected