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

Method Init

core/modules/queue_out.cc:36–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include "../utils/format.h"
35
36CommandResponse QueueOut::Init(const bess::pb::QueueOutArg &arg) {
37 const char *port_name;
38 int ret;
39
40 if (!arg.port().length()) {
41 return CommandFailure(EINVAL, "Field 'port' must be specified");
42 }
43
44 port_name = arg.port().c_str();
45 qid_ = arg.qid();
46
47 const auto &it = PortBuilder::all_ports().find(port_name);
48 if (it == PortBuilder::all_ports().end()) {
49 return CommandFailure(ENODEV, "Port %s not found", port_name);
50 }
51 port_ = it->second;
52
53 node_constraints_ = port_->GetNodePlacementConstraint();
54
55 ret = port_->AcquireQueues(reinterpret_cast<const module *>(this),
56 PACKET_DIR_OUT, &qid_, 1);
57 if (ret < 0) {
58 return CommandFailure(-ret);
59 }
60
61 return CommandSuccess();
62}
63
64void QueueOut::DeInit() {
65 if (port_) {

Callers

nothing calls this directly

Calls 5

CommandFailureFunction · 0.85
CommandSuccessFunction · 0.85
AcquireQueuesMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected