tools/testing/selftests/ntb/ntb_test.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/ntb/ntb_test.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/ntb/ntb_test.sh- Extension
.sh- Size
- 12098 bytes
- Lines
- 632
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function show_helpfunction _modprobefunction split_remotefunction read_filefunction write_filefunction check_filefunction subdirnamefunction port_testfunction doorbell_testfunction get_files_countfunction scratchpad_testfunction message_testfunction get_numberfunction write_mwfunction mw_checkfunction mw_freefunction pingpong_testfunction msi_testfunction perf_testfunction ntb_tool_testsfunction ntb_perf_testsfunction cleanup
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2016 Microsemi. All Rights Reserved.
#
# Author: Logan Gunthorpe <logang@deltatee.com>
REMOTE_HOST=
LIST_DEVS=FALSE
DEBUGFS=${DEBUGFS-/sys/kernel/debug}
PERF_RUN_ORDER=32
MAX_MW_SIZE=0
RUN_DMA_TESTS=
DONT_CLEANUP=
MW_SIZE=65536
function show_help()
{
echo "Usage: $0 [OPTIONS] LOCAL_DEV REMOTE_DEV"
echo "Run tests on a pair of NTB endpoints."
echo
echo "If the NTB device loops back to the same host then,"
echo "just specifying the two PCI ids on the command line is"
echo "sufficient. Otherwise, if the NTB link spans two hosts"
echo "use the -r option to specify the hostname for the remote"
echo "device. SSH will then be used to test the remote side."
echo "An SSH key between the root users of the host would then"
echo "be highly recommended."
echo
echo "Options:"
echo " -C don't cleanup ntb modules on exit"
echo " -h show this help message"
echo " -l list available local and remote PCI ids"
echo " -r REMOTE_HOST specify the remote's hostname to connect"
echo " to for the test (using ssh)"
echo " -m MW_SIZE memory window size for ntb_tool"
echo " (default: $MW_SIZE)"
echo " -d run dma tests for ntb_perf"
echo " -p ORDER total data order for ntb_perf"
echo " (default: $PERF_RUN_ORDER)"
echo " -w MAX_MW_SIZE maxmium memory window size for ntb_perf"
echo
}
function parse_args()
{
OPTIND=0
while getopts "b:Cdhlm:r:p:w:" opt; do
case "$opt" in
C) DONT_CLEANUP=1 ;;
d) RUN_DMA_TESTS=1 ;;
h) show_help; exit 0 ;;
l) LIST_DEVS=TRUE ;;
m) MW_SIZE=${OPTARG} ;;
r) REMOTE_HOST=${OPTARG} ;;
p) PERF_RUN_ORDER=${OPTARG} ;;
w) MAX_MW_SIZE=${OPTARG} ;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
}
parse_args "$@"
shift $((OPTIND-1))
LOCAL_DEV=$1
shift
Annotation
- Detected declarations: `function show_help`, `function _modprobe`, `function split_remote`, `function read_file`, `function write_file`, `function check_file`, `function subdirname`, `function port_test`, `function doorbell_test`, `function get_files_count`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.