Skip to content

TEST-XSTAMP-PERF-001: Verify IOCTL_AVB_PHC_CROSSTIMESTAMP P50/P99 Latency #322

Description

@zarfld

Requirement

Derived from #48 (REQ-F-IOCTL-XSTAMP-001) performance requirements:

Metric Target
IOCTL Latency (P50) <8µs
IOCTL Latency (P99) <15µs
Throughput (Single Thread) >80K ops/sec

Test Objective

Measure the round-trip latency of IOCTL_AVB_PHC_CROSSTIMESTAMP from user-mode
DeviceIoControl call to return over 10,000 calls and verify P50 and P99 are
within the budgets specified in REQ-F-IOCTL-XSTAMP-001.

Test Cases

TC-XSTAMP-PERF-001a: 10K calls — P50 < 8µs, P99 < 15µs

Preconditions: Driver loaded, handle open, adapter index 0 valid.

Steps:

  1. Allocate array of 10,000 latency samples (microseconds, double precision)
  2. For i = 0..9999:
    a. QueryPerformanceCounter(&t0)
    b. DeviceIoControl(IOCTL_AVB_PHC_CROSSTIMESTAMP, &req, ...)
    c. QueryPerformanceCounter(&t1)
    d. Assert req.valid == 1
    e. samples[i] = (t1 - t0) * 1e6 / qpc_freq
  3. Sort samples[]
  4. Report P50, P95, P99, P99.9

Acceptance Criteria:

  • P50 < 8µs (REQ-F-IOCTL-XSTAMP-001: IOCTL Latency P50 target)
  • P99 < 15µs (REQ-F-IOCTL-XSTAMP-001: IOCTL Latency P99 target)

Expected Status: ⚠️ P99 may exceed 15µs under OS scheduling jitter — this is a known
measurement challenge for user-mode latency tests; note whether system was under load.


TC-XSTAMP-PERF-001b: Throughput > 80K ops/sec (single thread)

Steps:

  1. Record wall time via QPC
  2. Call IOCTL_AVB_PHC_CROSSTIMESTAMP in a tight loop for 1 second
  3. Count successful calls
  4. Assert count > 80,000

Acceptance Criterion: ops/sec > 80,000


TC-XSTAMP-PERF-001c: All 10K responses have valid == 1

Acceptance Criterion: No IOCTL fails during the latency run (driver stability)

Acceptance Criteria Summary

  • ✅ P50 latency < 8µs over 10K calls
  • ✅ P99 latency < 15µs over 10K calls
  • ✅ Throughput > 80K ops/sec sustained
  • valid == 1 for all responses (no silent failures)

Implementation

  • New test file: tests/integration/ptp/ptp_ioctl_latency_test.c

Traceability

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions