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

Method RunChooseModule

core/module.h:489–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489inline void Module::RunChooseModule(Context *ctx, gate_idx_t ogate_idx,
490 bess::PacketBatch *batch) {
491 bess::OGate *ogate;
492
493 if (unlikely(batch->cnt() <= 0)) {
494 return;
495 }
496
497 if (unlikely(ogate_idx >= ogates_.size())) {
498 deadend(ctx, batch);
499 return;
500 }
501
502 ogate = ogates_[ogate_idx];
503
504 if (unlikely(!ogate)) {
505 deadend(ctx, batch);
506 return;
507 }
508
509 for (auto &hook : ogate->hooks()) {
510 hook->ProcessBatch(batch);
511 }
512
513 ctx->task->AddToRun(ogate->igate(), batch);
514}
515
516inline void Module::RunNextModule(Context *ctx, bess::PacketBatch *batch) {
517 RunChooseModule(ctx, 0, batch);

Callers

nothing calls this directly

Calls 6

deadendFunction · 0.85
sizeMethod · 0.80
AddToRunMethod · 0.80
igateMethod · 0.80
cntMethod · 0.45
ProcessBatchMethod · 0.45

Tested by

no test coverage detected