All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bobby Eshleman" <bobbyeshleman@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH net-next v5 3/3] selftests/net: devmem.py: add check_rx_large_niov
Date: Fri, 10 Jul 2026 07:27:11 +0000	[thread overview]
Message-ID: <20260710072712.0F50B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708-tcpdm-large-niovs-v5-3-34bf6fac941b@meta.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unhandled Python exception in selftests when hugepages are disabled or sysctl is read-only.
--

--- Patch [3]: [PATCH net-next v5 3/3] selftests/net: devmem.py: add check_rx_large_niov ---
commit c6680f91b9c04fa78f7d8b9d5f92ce1bee9816c1
Author: Bobby Eshleman <bobbyeshleman@meta.com>

selftests/net: devmem.py: add check_rx_large_niov

This commit adds a new devmem test case for binding a dmabuf with a 16K
rx-buf-size. It also sweeps various RX payload sizes across the niov boundary
to exercise the sub-niov, exact-niov, and multi-niov RX paths.

> diff --git a/tools/testing/selftests/drivers/net/hw/devmem_lib.py b/tools/testing/selftests/drivers/net/hw/devmem_lib.py
> --- a/tools/testing/selftests/drivers/net/hw/devmem_lib.py
> +++ b/tools/testing/selftests/drivers/net/hw/devmem_lib.py

[ ... ]

> +def run_rx_large_niov(cfg):
> +    """Run the devmem RX test with a large niov (rx-buf-size > PAGE_SIZE).
> +
> +    Sweep payload sizes that straddle the niov boundary: below, equal to,
> +    and above rx_buf_size, to exercise sub-niov, exact-niov, and multi-niov
> +    RX paths.
> +    """
> +    hp_file = "/proc/sys/vm/nr_hugepages"
> +    with open(hp_file, 'r+', encoding='utf-8') as f:

[Severity: Medium]
Will this crash with an unhandled exception on systems without hugepages
enabled or when run without write permissions to /proc/sys?

If the system was compiled without CONFIG_HUGETLB_PAGE=y, opening this file
will throw a FileNotFoundError, causing the kselftest framework to report a
test failure rather than gracefully skipping. 

Could this be wrapped in a try/except block to catch these exceptions and
raise KsftSkipEx instead?

> +        nr_hugepages = int(f.read().strip())
> +        if nr_hugepages < 64:
> +            f.seek(0)
> +            f.write("64")
> +            defer(_restore_nr_hugepages, hp_file, nr_hugepages)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260708-tcpdm-large-niovs-v5-0-34bf6fac941b@meta.com?part=3

      reply	other threads:[~2026-07-10  7:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 22:55 [PATCH net-next v5 0/3] net: devmem: allow rx-buf-size > PAGE_SIZE per binding Bobby Eshleman
2026-07-08 22:55 ` [PATCH net-next v5 1/3] net: devmem: allow rx-buf-size > PAGE_SIZE per dmabuf binding Bobby Eshleman
2026-07-10  7:27   ` sashiko-bot
2026-07-08 22:55 ` [PATCH net-next v5 2/3] selftests/net: ncdevmem: add -b option to set rx-buf-size on bind Bobby Eshleman
2026-07-08 22:55 ` [PATCH net-next v5 3/3] selftests/net: devmem.py: add check_rx_large_niov Bobby Eshleman
2026-07-10  7:27   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260710072712.0F50B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bobbyeshleman@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.