$ show linux-rdma/perftest
The RDMA performance micro-benchmark suite (`perftest`) consists of command-line executables that measure bandwidth and latency for InfiniBand/RoCE verbs (SEND, WRITE, READ, ATOMIC) over multiple transport types (RC, UD, Raw Ethernet, etc.). The architecture follows a client-server model: parameters are negotiated via a TCP control channel, then RDMA transfers are executed, and results (bandwidth, latency percentiles, CPU utilization) are reported. The codebase is structured around shared modules in the `src/` directory: `libperftest.a` containing connection setup (`perftest_communication.c`), resource management (`perftest_resources.c`), CLI parsing (`perftest_parameters.c`), and data validation (`host_validation.c`). Memory backends (host, CUDA, ROCm, etc.) are abstracted through a vtable interface, and the negotiation protocol supports both legacy and key-value version. While not a data pipeline, the benchmarking methodology is rigorous. The code is professionally crafted but shows signs of long evolution: large monolithic files, extensive `#ifdef` gating, and manually maintained vendor-specific tables.
The LLM identified 3 files worth highlighting for reuse:
Delivers the shared data validation framework used by both host and GPU validation paths. Contains type definitions, helper functions for chunk size derivation and layout computation, and a mismatch classifier. The SIMD-optimized pattern checking and epoch boundaries make this a standalone piece that could be reused in any memory integrity verification project.
Defines the `struct memory_ctx` vtable interface for RDMA buffer lifecycle: allocate, free, copy to/from host, and validation hooks. Each hardware backend (host, CUDA, ROCm, MUSA, MLU, etc.) implements the same interface, enabling transparent device support in the test engine. The pattern is easily extracted to build a portable RDMA memory wrapper.
Platform-agnostic cycle-accurate timer with calibration to convert cycles to nanoseconds. Uses architecture-specific measurements (RDTSC on x86, PMU registers on ARM) and provides `get_cycles()`/`get_cur_time()` APIs. The calibration routine and fallback logic are well-isolated and could be used in any high-precision benchmarking tool.