From 623385cda93e6562b095a9135d9db93e6a34681e Mon Sep 17 00:00:00 2001 From: Marvin Klimke Date: Fri, 15 Feb 2019 11:18:32 +0100 Subject: [PATCH] fixes related to tc support --- lib/kernel/if.c | 4 ++-- lib/node.c | 4 ++-- lib/nodes/rtp.c | 2 +- tests/integration/pipe-loopback-rtp-tbf.sh | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/kernel/if.c b/lib/kernel/if.c index 67926493a..d78eced93 100644 --- a/lib/kernel/if.c +++ b/lib/kernel/if.c @@ -82,14 +82,14 @@ int if_start(struct interface *i) } /* Abort if no node is using netem */ - if (mark == 0) + if (fwmark == 0) return 0; if (getuid() != 0) error("Network emulation requires super-user privileges!"); /* Replace root qdisc */ - ret = tc_prio(i, &i->tc_qdisc, TC_HANDLE(1, 0), TC_H_ROOT, mark); + ret = tc_prio(i, &i->tc_qdisc, TC_HANDLE(1, 0), TC_H_ROOT, fwmark); if (ret) error("Failed to setup priority queuing discipline: %s", nl_geterror(ret)); diff --git a/lib/node.c b/lib/node.c index 97702de0a..ec8b431a0 100644 --- a/lib/node.c +++ b/lib/node.c @@ -227,7 +227,7 @@ int node_init(struct node *n, struct node_type *vt) #ifdef __linux__ n->fwmark = -1; -#endif /* __linux__ * +#endif /* __linux__ */ #ifdef WITH_NETEM n->tc_qdisc = NULL; @@ -293,7 +293,7 @@ int node_parse(struct node *n, json_t *json, const char *name) jerror(&err, "Failed to parse node %s", node_name(n)); #ifdef __linux__ - ret = json_unpack_ex(json, &err, 0, "{ s?: { s: o, s: i } }", + ret = json_unpack_ex(json, &err, 0, "{ s?: { s?: o, s?: i } }", "out", "netem", &json_netem, "fwmark", &n->fwmark diff --git a/lib/nodes/rtp.c b/lib/nodes/rtp.c index 3b7f0a92b..922c59a00 100644 --- a/lib/nodes/rtp.c +++ b/lib/nodes/rtp.c @@ -290,7 +290,7 @@ char * rtp_print(struct node *n) strcatf(&buf, ", rtcp.mode=%s, rtcp.throttle_mode=%s", mode, throttle_mode); - if (r->rtcp.throttle_mode == RTCP_MODE_AIMD) + if (r->rtcp.mode == RTCP_MODE_AIMD) strcatf(&buf, ", aimd.a=%f, aimd.b=%f, aimd.start_rate=%f", r->aimd.a, r->aimd.b, r->aimd.last_rate); } diff --git a/tests/integration/pipe-loopback-rtp-tbf.sh b/tests/integration/pipe-loopback-rtp-tbf.sh index a035485e8..b49d389c8 100755 --- a/tests/integration/pipe-loopback-rtp-tbf.sh +++ b/tests/integration/pipe-loopback-rtp-tbf.sh @@ -40,7 +40,7 @@ OUTPUT_FILE=$(mktemp) FORMAT="villas.binary" VECTORIZE="1" -RATE=5000 +RATE=1000 NUM_SAMPLES=100000 cat > ${CONFIG_FILE_SRC} << EOF @@ -62,7 +62,7 @@ cat > ${CONFIG_FILE_SRC} << EOF "aimd" : { "a" : 10, "b" : 0.5, - "start_rate" : 5000 + "start_rate" : ${RATE} }, "in" : { "address" : "0.0.0.0:12002", @@ -99,7 +99,7 @@ cat > ${CONFIG_FILE_DEST} << EOF "aimd" : { "a" : 10, "b" : 0.5, - "start_rate" : 5000 + "start_rate" : ${RATE} }, "in" : { "address" : "0.0.0.0:12000",