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

Method CommandReset

core/modules/worker_split.cc:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41CommandResponse WorkerSplit::CommandReset(const bess::pb::WorkerSplitArg &arg) {
42 if (arg.worker_gates().empty()) {
43 for (int i = 0; i < Worker::kMaxWorkers; i++) {
44 gates_[i] = i;
45 }
46 return CommandSuccess();
47 }
48
49 for (size_t i = 0; i < Worker::kMaxWorkers; i++) {
50 gates_[i] = -1;
51 }
52
53 for (auto it : arg.worker_gates()) {
54 gate_idx_t ogate = it.second;
55 if (ogate >= MAX_GATES) {
56 return CommandFailure(EINVAL, "output gate must be less than %" PRIu16,
57 MAX_GATES);
58 }
59 gates_[it.first] = ogate;
60 }
61
62 return CommandSuccess();
63}
64
65void WorkerSplit::ProcessBatch(Context *ctx, bess::PacketBatch *batch) {
66 int gate = gates_[ctx->wid];

Callers

nothing calls this directly

Calls 3

CommandSuccessFunction · 0.85
CommandFailureFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected