diff --git a/src/server.c b/src/server.c index 19f8d1ac9..25a8857fb 100644 --- a/src/server.c +++ b/src/server.c @@ -58,7 +58,7 @@ static void start() /* Create priority queuing discipline */ tc_reset(i); - tc_prio(i, TC_HDL(4000, 0), i->refcnt + 2); + tc_prio(i, TC_HDL(4000, 0), i->refcnt); } /* Connect and bind nodes to their sockets, set socket options */ diff --git a/src/tc.c b/src/tc.c index 43420ec9f..5fd78a90e 100644 --- a/src/tc.c +++ b/src/tc.c @@ -26,13 +26,14 @@ int tc_prio(struct interface *i, tc_hdl_t handle, int bands) { char cmd[128]; int len = 0; + int priomap[] = { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; len += snprintf(cmd+len, sizeof(cmd)-len, "tc qdisc add dev %s root handle %u prio bands %u priomap", - i->name, TC_HDL_MAJ(handle), bands); + i->name, TC_HDL_MAJ(handle), bands + 3); - for (int i = 0; i < bands; i++) - len += snprintf(cmd+len, sizeof(cmd)-len, " 0"); + for (int i = 0; i < 16; i++) + len += snprintf(cmd+len, sizeof(cmd)-len, " %u", priomap[i] + bands); debug(6, "system: %s", cmd); return system(cmd);