Willem de Bruijn wrote:
> From: Willem de Bruijn <[email protected]>
>
> In preparation for extending to pacing hardware offload, convert the
> so_txtime.sh test to a drv-net test that can be run against netdevsim
> and real hardware.
>
> Also update so_txtime.c to not exit on first failure, but run to
> completion and report exit code there. This helps with debugging
> unexpected results, especially when processing multiple packets,
> as in the "reverse_order" testcase.
>
> Signed-off-by: Willem de Bruijn <[email protected]>
> +def main() -> None:
> + """Boilerplate ksft main."""
> + with NetDrvEpEnv(__file__) as cfg:
> + # Record original root qdisc
> + cmd_obj = cmd((f"tc -j qdisc show dev {cfg.ifname} root"))
> + qdisc_root = json.loads(cmd_obj.stdout)[0].get("kind", None)
> +
> + ksft_run([test_so_txtime_mono, test_so_txtime_etf], args=(cfg,))
> +
> + # Restore original root qdisc. If mq, populate with default_qdisc
> nodes
> + if (qdisc_root):
I evidently couldn't resist a touch up after running through pylint.
Unnecessary parentheses. Only a warn. But I can resubmit irrespective
of other concerns.
Again, could add a tc helper (in a separate patch) to hide some of the
open coded ugliness too.
> + cmd(f"tc qdisc replace dev {cfg.ifname} root {qdisc_root}")
> + ksft_exit()