| 307 | } |
| 308 | |
| 309 | void DRR::AddNewFlow(bess::Packet *pkt, FlowId id, int *err) { |
| 310 | // creates flow |
| 311 | Flow *f = new Flow(id); |
| 312 | |
| 313 | // TODO(joshua) do proper error checking |
| 314 | f->queue = AddQueue(static_cast<int>(kFlowQueueSize), err); |
| 315 | |
| 316 | if (*err != 0) { |
| 317 | return; |
| 318 | } |
| 319 | |
| 320 | flows_.Insert(id, f); |
| 321 | |
| 322 | Enqueue(f, pkt, err); |
| 323 | if (*err != 0) { |
| 324 | return; |
| 325 | } |
| 326 | |
| 327 | // puts flow in round robin |
| 328 | *err = llring_enqueue(flow_ring_, f); |
| 329 | } |
| 330 | |
| 331 | void DRR::RemoveFlow(Flow *f) { |
| 332 | if (f == current_flow_) { |
nothing calls this directly
no test coverage detected