Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Stanislav Fomichev
Wed, 21 Oct 2026 14:55
Re: [PATCH net] selftests: drv-net: devmem: Skip when hugetlbfs isn't supported
Author: Stanislav Fomichev
Date: Wed, 21 Oct 2026 14:55
Date: Wed, 21 Oct 2026 14:55
32 lines
12670 bytes
12670 bytes
On 10/21, Maxime Chevallier wrote:
> The devmem selftest requires accessing /proc/sys/vm/nr_hugepages,
> which is only available when hugetlbfs is supported. This isn't the
> case on all CPU architectures, for example it isn't supported on ARM
> 32-bits on cores that don't support LPAE.
>
> On these devices, the devmem kselftest doesn't skip gracefully, it hits
> an exception while trying to open the nr_hugepages file :
>
> # Exception| _reserve_hugepages()
> # Exception| ~~~~~~~~~~~~~~~~~~^^
> # Exception| File "/usr/lib/kselftests/drivers/net/hw/devmem_lib.py", line 36, in _reserve_hugepages
> # Exception| with open(NR_HUGEPAGES_FILE, 'r+', encoding='utf-8') as f:
> # Exception| ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> # Exception| FileNotFoundError: [Errno 2] No such file or directory: '/proc/sys/vm/nr_hugepages'
>
> Let's check if the file exists before trying to open it, and return
> immediately if we can't.
>
> The _reserve_hugepages() runs as part of the "require_devmem()", that
> skips if devmem itself isn't supported. Before the blamed commit, this
> check was done prior to accessing nr_hugepages, so the problem wasn't
> showing.
>
> This has been found by trying to run the selftest on stmmac, on an
> Altera CycloneV SoC (Cortex A9, doesn't support hugepages).
>
> Fixes: 8ac4255c1e0c ("selftests/net: devmem.py: add check_rx_large_niov")
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads