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

Method AddToRun

core/task.h:121–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119 void Attach(bess::LeafTrafficClass *c);
120
121 void AddToRun(bess::IGate *ig, bess::PacketBatch *batch) const {
122 if (next_gate_ == nullptr &&
123 !ig->mergeable()) { // optimization for chained
124 next_gate_ = ig;
125 next_batch_ = batch;
126 } else {
127 bess::PacketBatch *ibatch = get_gate_batch(ig);
128 if (ibatch && (static_cast<size_t>(ibatch->cnt() + batch->cnt()) <=
129 bess::PacketBatch::kMaxBurst)) {
130 // merge two batches
131 ibatch->add(batch);
132 } else {
133 // set the input as new batch
134 set_gate_batch(ig, batch);
135 igates_to_run_.emplace(ig, batch);
136 }
137 }
138 }
139
140 // Do not track used/unsued for efficiency
141 bess::PacketBatch *AllocPacketBatch() const {

Callers 3

RunChooseModuleMethod · 0.80
EmitPacketMethod · 0.80
ProcessOGatesMethod · 0.80

Calls 3

mergeableMethod · 0.80
addMethod · 0.80
cntMethod · 0.45

Tested by

no test coverage detected