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

Method PropagateIGatePriority

core/module_graph.cc:94–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void ModuleGraph::PropagateIGatePriority(
95 bess::IGate *igate, std::unordered_set<bess::IGate *> &visited_igates,
96 uint32_t priority) {
97 if (igate->module()->is_task()) {
98 return;
99 } else {
100 std::vector<bess::OGate *> ogates = igate->module()->ogates();
101 for (size_t i = 0; i < ogates.size(); i++) {
102 if (!ogates[i]) {
103 continue;
104 }
105
106 bess::IGate *next_igate = ogates[i]->igate();
107 if (visited_igates.count(next_igate) != 0 || // This is a loop or
108 next_igate->priority() >= priority) { // visited by longer path
109 continue;
110 }
111
112 visited_igates.insert(next_igate);
113 next_igate->SetPriority(priority);
114 PropagateIGatePriority(next_igate, visited_igates, priority + 1);
115 visited_igates.erase(next_igate);
116 }
117 }
118}
119
120void ModuleGraph::SetIGatePriority(Module *task_module) {
121 uint32_t priority = 1;

Callers

nothing calls this directly

Calls 6

is_taskMethod · 0.80
sizeMethod · 0.80
igateMethod · 0.80
SetPriorityMethod · 0.80
moduleMethod · 0.45
priorityMethod · 0.45

Tested by

no test coverage detected