[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b00dc64b-d760-4c27-891a-465cd3c25d9e@intel.com>
Date: Wed, 8 Oct 2025 16:34:39 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, <davem@...emloft.net>
CC: <netdev@...r.kernel.org>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<andrew+netdev@...n.ch>, <horms@...nel.org>, <bpf@...r.kernel.org>,
<shuah@...nel.org>, <johndale@...co.com>, <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH net v2 7/9] selftests: drv-net: fix linter warnings in
pp_alloc_fail
On 10/7/2025 4:26 PM, Jakub Kicinski wrote:
> Fix linter warnings, it's a bit hard to check for new ones otherwise.
>
> W0311: Bad indentation. Found 16 spaces, expected 12 (bad-indentation)
> C0114: Missing module docstring (missing-module-docstring)
> W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
> C0116: Missing function or method docstring (missing-function-docstring)
>
Everything seems reasonable here.
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Reviewed-by: Simon Horman <horms@...nel.org>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> CC: shuah@...nel.org
> CC: johndale@...co.com
> CC: linux-kselftest@...r.kernel.org
> ---
> .../selftests/drivers/net/hw/pp_alloc_fail.py | 20 +++++++++++++------
> 1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py b/tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py
> index ad192fef3117..fc66b7a7b149 100755
> --- a/tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py
> +++ b/tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py
> @@ -1,6 +1,10 @@
> #!/usr/bin/env python3
> # SPDX-License-Identifier: GPL-2.0
>
> +"""
> +Test driver resilience vs page pool allocation failures.
> +"""
> +
> import errno
> import time
> import os
> @@ -13,7 +17,8 @@ from lib.py import cmd, tool, GenerateTraffic
>
> def _write_fail_config(config):
> for key, value in config.items():
> - with open("/sys/kernel/debug/fail_function/" + key, "w") as fp:
> + path = "/sys/kernel/debug/fail_function/"
> + with open(path + key, "w", encoding='ascii') as fp:
> fp.write(str(value) + "\n")
>
>
> @@ -22,8 +27,7 @@ from lib.py import cmd, tool, GenerateTraffic
> raise KsftSkipEx("Kernel built without function error injection (or DebugFS)")
>
> if not os.path.exists("/sys/kernel/debug/fail_function/page_pool_alloc_netmems"):
> - with open("/sys/kernel/debug/fail_function/inject", "w") as fp:
> - fp.write("page_pool_alloc_netmems\n")
> + _write_fail_config({"inject": "page_pool_alloc_netmems"})
>
> _write_fail_config({
> "verbose": 0,
> @@ -38,8 +42,7 @@ from lib.py import cmd, tool, GenerateTraffic
> return
>
> if os.path.exists("/sys/kernel/debug/fail_function/page_pool_alloc_netmems"):
> - with open("/sys/kernel/debug/fail_function/inject", "w") as fp:
> - fp.write("\n")
> + _write_fail_config({"inject": ""})
>
> _write_fail_config({
> "probability": 0,
> @@ -48,6 +51,10 @@ from lib.py import cmd, tool, GenerateTraffic
>
>
> def test_pp_alloc(cfg, netdevnl):
> + """
> + Configure page pool allocation fail injection while traffic is running.
> + """
> +
> def get_stats():
> return netdevnl.qstats_get({"ifindex": cfg.ifindex}, dump=True)[0]
>
> @@ -105,7 +112,7 @@ from lib.py import cmd, tool, GenerateTraffic
> else:
> ksft_pr("ethtool -G change retval: did not succeed", new_g)
> else:
> - ksft_pr("ethtool -G change retval: did not try")
> + ksft_pr("ethtool -G change retval: did not try")
>
> time.sleep(0.1)
> check_traffic_flowing()
> @@ -119,6 +126,7 @@ from lib.py import cmd, tool, GenerateTraffic
>
>
> def main() -> None:
> + """ Ksft boiler plate main """
> netdevnl = NetdevFamily()
> with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
>
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists