tools/testing/selftests/drivers/net/hw/userns_devmem.py
Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/hw/userns_devmem.py
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/drivers/net/hw/userns_devmem.py- Extension
.py- Size
- 1342 bytes
- Lines
- 50
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
"""
Devmem tests for non-init userns.
"""
import os
from devmem_lib import run_rx, run_rx_hds, run_tx, run_tx_chunks, setup_test
from lib.py import NetDrvContEnv, ksft_disruptive, ksft_exit, ksft_run
@ksft_disruptive
def check_userns_rx(cfg) -> None:
"""Run the devmem RX test through non-init userns netkit."""
run_rx(cfg)
@ksft_disruptive
def check_userns_tx(cfg) -> None:
"""Run the devmem TX test through non-init userns netkit."""
run_tx(cfg)
@ksft_disruptive
def check_userns_tx_chunks(cfg) -> None:
"""Run the devmem TX chunking test through non-init userns netkit."""
run_tx_chunks(cfg)
def check_userns_rx_hds(cfg) -> None:
"""Run the HDS test through non-init userns netkit."""
run_rx_hds(cfg)
def main() -> None:
"""Run userns devmem RX selftests against the test environment."""
with NetDrvContEnv(__file__, userns=True, rxqueues=2,
primary_rx_redirect=True) as cfg:
setup_test(cfg,
os.path.join(os.path.dirname(os.path.abspath(__file__)),
"ncdevmem"))
ksft_run([check_userns_rx, check_userns_tx, check_userns_tx_chunks,
check_userns_rx_hds], args=(cfg,))
ksft_exit()
if __name__ == "__main__":
main()
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.