This allows directing processing of locally received packets to the CPUs
of the tasks receiving them
Signed-off-by: Felix Fietkau <nbd@nbd.name>
reload_service() {
packet_steering="$(uci get "network.@globals[0].packet_steering")"
+ steering_flows="$(uci get "network.@globals[0].steering_flows")"
+ [ "$steering_flows" -gt 0 ] && opts="-l $steering_flows"
if [ -e "/usr/libexec/platform/packet-steering.sh" ]; then
/usr/libexec/platform/packet-steering.sh "$packet_steering"
else
- /usr/libexec/network/packet-steering.uc "$packet_steering"
+ /usr/libexec/network/packet-steering.uc $opts "$packet_steering"
fi
}
let disable;
let cpus;
let all_cpus;
+let local_flows = 0;
-for (let arg in ARGV) {
+while (length(ARGV) > 0) {
+ let arg = shift(ARGV);
switch (arg) {
case "-d":
debug++;
case '2':
all_cpus = true;
break;
+ case '-l':
+ local_flows = +shift(ARGV);
+ break;
}
}
if (!do_nothing)
writefile(queue, `${val}`);
}
+ queues = glob(`/sys/class/net/${dev}/queues/rx-*/rps_flow_cnt`);
+ for (let queue in queues) {
+ if (debug || do_nothing)
+ warn(`echo ${local_flows} > ${queue}\n`);
+ if (!do_nothing)
+ writefile(queue, `${local_flows}`);
+ }
}
function task_device_match(name, device)