Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/systemd/sysconfig.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
# 0 = force unlimited
# Default is auto.
# FLAGS_rx_rate_limit=-1
#
# Set OpenFlow echo request timeout in seconds:
# FLAGS_of_timeout_echo=6
#
# Set OpenFlow idle delay for sending echo requests:
# FLAGS_of_timeout_lifecheck=10

### glog logging configuration
#
Expand Down
8 changes: 6 additions & 2 deletions src/baseboxd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ DEFINE_int32(port_untagged_vid, 1,
DEFINE_int32(
rx_rate_limit, -1,
"PPS limit for traffic to controller (-1 = auto, 0 = force unlimited)");
DEFINE_int32(of_timeout_echo, 6, "timeout of sent echo requests");
DEFINE_int32(of_timeout_lifecheck, 10, "delay of life check after last rx");

static bool validate_port(const char *flagname, gflags::int32 value) {
VLOG(3) << __FUNCTION__ << ": flagname=" << flagname << ", value=" << value;
Expand Down Expand Up @@ -67,8 +69,10 @@ int main(int argc, char **argv) {
}

// all variables can be set from env
FLAGS_tryfromenv = std::string("multicast,port,ofdpa_grpc_port,use_knet,mark_"
"fwd_offload,port_untagged_vid");
FLAGS_tryfromenv =
std::string("multicast,port,ofdpa_grpc_port,use_knet,mark_"
"fwd_offload,port_untagged_vid,of_timeout_lifecheck,of_"
"timeout_echo");
gflags::SetUsageMessage("");
gflags::SetVersionString(PROJECT_VERSION);

Expand Down
7 changes: 7 additions & 0 deletions src/of-dpa/controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ DECLARE_bool(clear_switch_configuration);
DECLARE_bool(use_knet);
DECLARE_int32(rx_rate_limit);

DECLARE_int32(of_timeout_echo);
DECLARE_int32(of_timeout_lifecheck);

namespace basebox {

void controller::handle_conn_established(rofl::crofdpt &dpt,
Expand Down Expand Up @@ -53,6 +56,10 @@ void controller::handle_dpt_open(rofl::crofdpt &dpt) {

// set max queue size in rofl
dpt.set_conn(rofl::cauxid(0)).set_txqueue_max_size(128 * 1024);
// set timeout limits
dpt.set_conn(rofl::cauxid(0)).set_timeout_echo(FLAGS_of_timeout_echo);
dpt.set_conn(rofl::cauxid(0))
.set_timeout_lifecheck(FLAGS_of_timeout_lifecheck);

rofl::csockaddr raddr = dpt.set_conn(rofl::cauxid(0)).get_raddr();
std::string buf;
Expand Down
Loading