run_command
static const char run_command[] = "run";
char buf[sizeof(run_command) + 1]; /* to detect "runx" */
if (0 == strcmp(buf, run_command))
dynevent_create_fn_t run_command)
cmd->run_command = run_command;
return cmd->run_command(cmd);
dynevent_create_fn_t run_command);
return run_command(&cmd);
int run_command(struct child_process *);
return run_command(args, NULL, 0);
return run_command(args, output_buf, output_max_len);
if (run_command("sudo tc qdisc show dev %s | grep -q 'qdisc mqprio 8001:'", ifname) == 0)
run_command("sudo tc qdisc del dev %s root", ifname);
if (run_command("sudo tc qdisc show dev %s | grep -q 'qdisc ingress ffff:'", ifname) == 0)
run_command("sudo tc qdisc del dev %s ingress", ifname);
if (run_command("sudo ethtool -n %s | grep -q 'Filter:'", ifname) == 0) {
run_command("sudo ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 sudo ethtool -N %s delete >&2",
run_command("sudo tc qdisc add dev %s handle 8001: parent root mqprio num_tc %d map %squeues %shw 0",
run_command("sudo tc qdisc replace dev %s parent 8001:%d etf offload clockid CLOCK_TAI delta 500000",
if (run_command("sudo ethtool -N %s flow-type ether vlan 0x2000 vlan-mask 0x1FFF action %d",
run_command("sudo tc qdisc add dev %s ingress", ifname);
run_command("sudo tc filter add dev %s parent ffff: protocol 802.1Q flower vlan_prio 1 hw_tc %d",
run_command("sudo ethtool -K %s rxvlan on", ifname);
run_command("ethtool -N %s delete %d",
return run_command("ethtool -X %s equal %d >&2", ifname, start_queue);
run_command("ethtool -X %s default >&2", ifname, start_queue);
retval = run_command(argc, argv, 0);
retval = run_command(argc, argv, 1);
rc = run_command(&cmds[i], argc, argv);