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

Method ResizeQueue

core/modules/drr.cc:385–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385llring *DRR::ResizeQueue(llring *old_queue, uint32_t new_size, int *err) {
386 llring *new_queue = AddQueue(new_size, err);
387 if (*err != 0) {
388 return nullptr;
389 }
390
391 // migrates packets from the old queue
392 if (old_queue) {
393 bess::Packet *pkt;
394
395 while (llring_dequeue(old_queue, reinterpret_cast<void **>(&pkt)) == 0) {
396 *err = llring_enqueue(new_queue, pkt);
397 if (*err == -LLRING_ERR_NOBUF) {
398 bess::Packet::Free(pkt);
399 *err = 0;
400 } else if (*err != 0) {
401 std::free(new_queue);
402 return nullptr;
403 }
404 }
405
406 std::free(old_queue);
407 }
408 return new_queue;
409}
410
411CommandResponse DRR::SetQuantumSize(uint32_t size) {
412 if (size == 0) {

Callers

nothing calls this directly

Calls 2

llring_dequeueFunction · 0.85
llring_enqueueFunction · 0.85

Tested by

no test coverage detected