Skip to content

Conversation

@ovsrobot
Copy link
Owner

@ovsrobot ovsrobot commented Dec 8, 2025

Auto-submission for "http://patchwork.dpdk.org/project/dpdk/list/?series=36861"

Summary by Sourcery

Introduce richer EAL driver path introspection and propagate driver-path flags to child test processes, while tightening fast-test metadata and classification to ensure all unit tests are assigned to appropriate suites.

New Features:

  • Expose EAL APIs to iterate and count configured driver paths, distinguishing between command-line and directory-derived entries.
  • Add an iterator macro and new ATTIC and DRIVER test registration variants to better categorize and manage test cases.

Bug Fixes:

  • Prevent undefined behavior in RED queue empty factor calculation when the exponent is zero.
  • Ensure the power CPU frequency capability test reports as skipped rather than failed when the environment is unsuitable.
  • Adjust the timer secondary test to correctly set the exit flag and reduce timeout ranges to avoid long or hanging runs.

Enhancements:

  • Track whether dynamically loaded drivers originate from command-line flags to support more precise reporting and filtering.
  • Propagate -d/--driver-path arguments to forked test processes based on the EAL driver path list.
  • Refine fast-test registration to use explicit NOHUGE/ASAN capability tags and validate them at build time.
  • Reclassify several tests as driver or attic tests to better reflect their stability and dependency characteristics.

Build:

  • Tighten Meson suite generation by validating fast-test capability flags and aligning parsing logic with the new NOHUGE/ASAN enums, only emitting non-suite tests when present.

Tests:

  • Update fast-test registrations across the test tree to use the new NOHUGE/ASAN tagging scheme and suite metadata, and expand coverage for external memory and driver-dependent tests by integrating them into suites.

Summary by CodeRabbit

  • Refactor

    • Standardized test registration with explicit capability flags, replacing boolean parameters for clearer test configuration.
    • Reorganized test categorization with improved test classification mechanisms.
    • Enhanced test parameter validation with stricter enforcement of environment-specific options.
  • New Features

    • Added driver path parameter handling to support enhanced test environment configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

For the fast tests, we have two extra parameters specifying when the
test can be run without hugepages or using ASan. The true/false nature
of these parameters is not very clear, so change things so that they are
explicitly specified as NOHUGE_OK/NOHUGE_SKIP and ASAN_OK/ASAN_SKIP
instead.  Explicitly validate the options in the meson.build files,
rather than just checking for one of the pair of options - which can
hide errors.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Marat Khalili <marat.khalili@huawei.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
The shift of a negative number (or very large positive) is undefined
behaviour which causes errors when run with UBSan. Fix this by making
the behaviour explicit for the edge case of n being zero in the
calculation.

Fixes: de3cfa2 ("sched: initial import")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Marat Khalili <marat.khalili@huawei.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
Reduce the timer duration and the primary wait duration in the secondary
process timer autotest. This should help ensure it doesn't time out what
run in a CI environment.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
When the secondary process run from timer_secontary_autotest fails, the
timer loop is never stopped so the whole process hangs until timeout.
Fix this by setting the stop flag before checking for success or failure
of the secondary process.

Fixes: 50247fe ("test/timer: exercise new APIs in secondary process")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
Add APIs for internal DPDK use to allow querying the paths of drivers
loaded into the running instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
For unit tests which run secondary processes, allow passing the driver
paths used by the primary process to that secondary. This allows use of
mempools in those secondary tests. Without this, any tests using
mempools in secondary process will fail in shared builds.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
If the power subsystem cannot be initialized e.g. due to not being root,
skip the capabilities test, rather than failing it.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
There are quite a number of test cases defined which are not present in
any test-suite. Meson warns about these on build, so reduce the warnings
by adding external-mem, ipsec-sad, power-caps and secondary timer test
cases to the fast-test suite.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
A number of eventdev, cryptodev and ethdev tests require devices to be
present in order to run so add them to the "driver" suite of tests.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
If there are no tests which are not assigned to a test suite, omit the
line printing the non_suite_tests. This avoid having error messages from
meson about test "" not being in any test suite.

Fixes: 25065ef ("test: emit warning for orphaned tests")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Marat Khalili <marat.khalili@huawei.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
Define an "attic" test suite for unstable or unmaintained tests, and
move the red autotest to that suite.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 8, 2025

Reviewer's Guide

Introduce driver-path iteration APIs and propagate -d/--driver-path arguments to secondary test processes, while refactoring fast test registration to use explicit NOHUGE_/ASAN_ flags and assigning tests into suites with minor timing and correctness fixes in timers, RED, and power tests.

Sequence diagram for driver loading and driver path iteration

sequenceDiagram
    actor App
    participant EAL
    participant ArgsParser
    participant PluginDirScanner
    participant SharedDriverList

    App->>EAL: rte_eal_init(argc, argv)
    EAL->>ArgsParser: eal_parse_args()
    ArgsParser-->>ArgsParser: collect -d and --driver-path arguments
    loop for each driver_path_arg
        ArgsParser->>EAL: eal_plugin_add(path, true)
        EAL->>SharedDriverList: allocate shared_driver
        EAL-->>SharedDriverList: set name, lib_handle, from_cmdline = true
    end

    EAL->>PluginDirScanner: eal_plugindir_init(default_solib_dir)
    PluginDirScanner-->>PluginDirScanner: scan directory for .so files
    loop for each sopath
        PluginDirScanner->>EAL: eal_plugin_add(sopath, false)
        EAL->>SharedDriverList: allocate shared_driver
        EAL-->>SharedDriverList: set name, lib_handle, from_cmdline = false
    end

    App->>EAL: rte_eal_driver_path_count(cmdline_only)
    EAL->>SharedDriverList: iterate and count based on from_cmdline and cmdline_only
    EAL-->>App: count

    App->>EAL: rte_eal_driver_path_next(NULL, cmdline_only)
    EAL->>SharedDriverList: get first matching shared_driver
    EAL-->>App: path
    loop while path != NULL
        App->>EAL: rte_eal_driver_path_next(path, cmdline_only)
        EAL->>SharedDriverList: find current and next matching entry
        EAL-->>App: next path or NULL
    end
Loading

Class diagram for EAL shared_driver and driver path iteration APIs

classDiagram
    class shared_driver {
        +char name[PATH_MAX]
        +void* lib_handle
        +bool from_cmdline
    }

    class solib_list {
        +shared_driver* head
        +shared_driver* tail
    }

    class eal_common_options {
        +int eal_plugin_add(const char* path, bool from_cmdline)
        +void eal_plugindir_init(const char* path)
        +void eal_plugins_init()
        +int eal_parse_args()
    }

    class rte_eal_driver_path_api {
        +const char* rte_eal_driver_path_next(const char* start, bool cmdline_only)
        +unsigned int rte_eal_driver_path_count(bool cmdline_only)
        +macro RTE_EAL_DRIVER_PATH_FOREACH(path, cmdline_only)
    }

    solib_list "1" o-- "*" shared_driver : contains

    eal_common_options --> solib_list : manages
    eal_common_options ..> shared_driver : allocates_and_initializes

    rte_eal_driver_path_api --> solib_list : iterates
    rte_eal_driver_path_api ..> shared_driver : reads_name_and_from_cmdline
Loading

Flow diagram for rte_eal_driver_path_next iteration logic

flowchart TD
    A["Call rte_eal_driver_path_next(start, cmdline_only)"] --> B{start is NULL?}
    B -->|Yes| C["solib = first element of solib_list"]
    B -->|No| D["Find element in solib_list where start == solib.name"]
    D --> E["solib = next element after matched one"]

    C --> F{solib is NULL?}
    E --> F

    F -->|Yes| G["Return NULL"]
    F -->|No| H{cmdline_only is true?}

    H -->|No| I["Return solib.name"]
    H -->|Yes| J{solib.from_cmdline is true?}

    J -->|Yes| I
    J -->|No| K["solib = next element in solib_list"] --> L{solib is NULL?}
    L -->|Yes| G
    L -->|No| J
Loading

File-Level Changes

Change Details Files
Track whether shared drivers come from the command line and expose iteration/count APIs for driver paths
  • Extend shared_driver with a from_cmdline flag and plumb it through eal_plugin_add and plugin directory loading
  • Export rte_eal_driver_path_next and rte_eal_driver_path_count with support for filtering to command-line-provided paths
  • Add public declarations and an iteration macro RTE_EAL_DRIVER_PATH_FOREACH to rte_eal.h
lib/eal/common/eal_common_options.c
lib/eal/include/rte_eal.h
Propagate allow-list and driver-path EAL flags into forked test processes
  • Include rte_eal.h in process test helper to use new driver path APIs
  • Add helper to append --driver-path flags based on RTE_EAL_DRIVER_PATH_FOREACH
  • Extend process_dup to account for and append driver-path arguments alongside existing --allow handling
app/test/process.h
Standardize fast test registration flags and validate them in suite generation
  • Redefine REGISTER_FAST_TEST signature to take symbolic NOHUGE_* and ASAN_* flags and document usage; introduce REGISTER_ATTIC_TEST
  • Change many REGISTER_FAST_TEST call sites from boolean flags to NOHUGE_OK/NOHUGE_SKIP and ASAN_OK/ASAN_SKIP according to test capabilities
  • Convert some REGISTER_TEST_COMMAND uses to REGISTER_DRIVER_TEST or REGISTER_FAST_TEST to assign tests to suites
  • Update get-test-suites.py to emit raw NOHUGE_/ASAN_ tokens and only print non_suite_tests when non-empty
  • Tighten Meson test suite parsing to validate NOHUGE_/ASAN_ strings and map them to boolean meson options
app/test/test.h
app/test/test_eal_flags.c
app/test/test_timer_secondary.c
app/test/test_rwlock.c
app/test/test_bpf.c
app/test/test_power_cpufreq.c
app/test/test_security_inline_proto.c
app/test/test_event_eth_rx_adapter.c
app/test/test_eventdev.c
app/test/test_graph.c
app/test/test_stack.c
app/test/test_acl.c
app/test/test_alarm.c
app/test/test_argparse.c
app/test/test_atomic.c
app/test/test_bitcount.c
app/test/test_bitmap.c
app/test/test_bitops.c
app/test/test_bitratestats.c
app/test/test_bitset.c
app/test/test_byteorder.c
app/test/test_cfgfile.c
app/test/test_cksum.c
app/test/test_cmdline.c
app/test/test_common.c
app/test/test_compressdev.c
app/test/test_cpuflags.c
app/test/test_crc.c
app/test/test_cryptodev_crosscheck.c
app/test/test_cycles.c
app/test/test_debug.c
app/test/test_devargs.c
app/test/test_dispatcher.c
app/test/test_distributor.c
app/test/test_eal_fs.c
app/test/test_errno.c
app/test/test_ethdev_api.c
app/test/test_ethdev_link.c
app/test/test_event_crypto_adapter.c
app/test/test_event_eth_tx_adapter.c
app/test/test_event_ring.c
app/test/test_event_timer_adapter.c
app/test/test_external_mem.c
app/test/test_fbarray.c
app/test/test_fib.c
app/test/test_fib6.c
app/test/test_func_reentrancy.c
app/test/test_graph_feature_arc.c
app/test/test_hash.c
app/test/test_hash_readwrite.c
app/test/test_interrupts.c
app/test/test_ipfrag.c
app/test/test_ipsec.c
app/test/test_ipsec_sad.c
app/test/test_kvargs.c
app/test/test_latencystats.c
app/test/test_lcore_var.c
app/test/test_lcores.c
app/test/test_logs.c
app/test/test_lpm.c
app/test/test_lpm6.c
app/test/test_malloc.c
app/test/test_mbuf.c
app/test/test_mcslock.c
app/test/test_member.c
app/test/test_memcpy.c
app/test/test_memory.c
app/test/test_mempool.c
app/test/test_memzone.c
app/test/test_meter.c
app/test/test_metrics.c
app/test/test_mp_secondary.c
app/test/test_net_ether.c
app/test/test_net_ip6.c
app/test/test_pcapng.c
app/test/test_pdcp.c
app/test/test_pdump.c
app/test/test_per_lcore.c
app/test/test_pflock.c
app/test/test_pie.c
app/test/test_pmd_ring.c
app/test/test_pmu.c
app/test/test_power.c
app/test/test_power_intel_uncore.c
app/test/test_power_kvm_vm.c
app/test/test_prefetch.c
app/test/test_ptr_compress.c
app/test/test_rawdev.c
app/test/test_rcu_qsbr.c
app/test/test_red.c
app/test/test_reorder.c
app/test/test_rib.c
app/test/test_rib6.c
app/test/test_ring.c
app/test/test_sched.c
app/test/test_security.c
app/test/test_security_inline_macsec.c
app/test/test_seqlock.c
app/test/test_service_cores.c
app/test/test_soring.c
app/test/test_spinlock.c
app/test/test_string_fns.c
app/test/test_table.c
app/test/test_tailq.c
app/test/test_telemetry_data.c
app/test/test_telemetry_json.c
app/test/test_thash.c
app/test/test_threads.c
app/test/test_ticketlock.c
app/test/test_timer.c
app/test/test_trace.c
app/test/test_vdev.c
app/test/test_version.c
app/test/test_event_vector_adapter.c
app/test/suites/meson.build
buildtools/get-test-suites.py
Clarify categorization of certain tests as driver or attic tests and adjust scheduling behavior
  • Re-register various device- or driver-dependent tests (ethdev, eventdev, security, cryptodev, external_mem, inline macsec/ipsec, crosscheck) as REGISTER_DRIVER_TEST so they are treated as driver tests
  • Re-register the RED unit test as REGISTER_ATTIC_TEST to mark it unstable/experimental while leaving perf tests intact
app/test/test_security_inline_proto.c
app/test/test_event_eth_rx_adapter.c
app/test/test_event_crypto_adapter.c
app/test/test_event_timer_adapter.c
app/test/test_external_mem.c
app/test/test_cryptodev_crosscheck.c
app/test/test_ethdev_api.c
app/test/test_security_inline_macsec.c
app/test/test_red.c
Fix timing and correctness issues in specific tests and libraries
  • In test_timer_secondary, ensure exit_flag is set even when secondary execution fails, reduce delay from 2000ms to 500ms, and shrink timeout range to 10–80ms
  • Change test_power_caps to return TEST_SKIPPED instead of -1 when power environment is unsuitable
  • Fix potential undefined behavior in __rte_red_calc_qempty_factor when n == 0 by special-casing and adjusting rounding logic
app/test/test_timer_secondary.c
app/test/test_power_cpufreq.c
lib/sched/rte_red.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Dec 8, 2025

Walkthrough

Infrastructure changes introduce driver path support in test process utilities, add test parameter validation in the build system, and implement environment-specific test registration flags (NOHUGE_OK/SKIP, ASAN_OK/SKIP) replacing boolean parameters across the test suite, along with new test registration macros.

Changes

Cohort / File(s) Summary
Infrastructure & Build System
app/test/process.h, app/test/test.h, app/test/suites/meson.build
Added driver path support via PREFIX_DRIVER_PATH macro and add_parameter_driver_path() helper in process.h; argv size calculation extended to account for driver-path entries. New macro REGISTER_ATTIC_TEST defined in test.h. Build system adds validation for test parameters (NOHUGE_OK/NOHUGE_SKIP, ASAN_OK/ASAN_SKIP tokens) with error handling for invalid values.
Test Files: Boolean to NOHUGE_OK, ASAN_OK
app/test/test_acl.c, app/test/test_alarm.c, app/test/test_argparse.c, app/test/test_bitcount.c, app/test/test_bitmap.c, app/test/test_bitops.c, app/test/test_bitratestats.c, app/test/test_bitset.c, app/test/test_byteorder.c, app/test/test_cfgfile.c, app/test/test_cksum.c, app/test/test_cmdline.c, app/test/test_common.c, app/test/test_cpuflags.c, app/test/test_crc.c, app/test/test_cycles.c, app/test/test_debug.c, app/test/test_devargs.c, app/test/test_eal_fs.c, app/test/test_errno.c, app/test/test_ethdev_link.c, app/test/test_event_ring.c, app/test/test_fbarray.c, app/test/test_fib.c, app/test/test_fib6.c, app/test/test_graph.c, app/test/test_graph_feature_arc.c, app/test/test_hash.c, app/test/test_interrupts.c, app/test/test_ipsec.c, app/test/test_kvargs.c, app/test/test_latencystats.c, app/test/test_lcores.c, app/test/test_logs.c, app/test/test_lpm.c, app/test/test_lpm6.c, app/test/test_memcpy.c, app/test/test_member.c, app/test/test_meter.c, app/test/test_metrics.c, app/test/test_net_ether.c, app/test/test_net_ip6.c, app/test/test_pcapng.c, app/test/test_per_lcore.c, app/test/test_pflock.c, app/test/test_pie.c, app/test/test_pmd_ring.c, app/test/test_power.c, app/test/test_power_intel_uncore.c, app/test/test_prefetch.c, app/test/test_ptr_compress.c, app/test/test_rawdev.c, app/test/test_rcu_qsbr.c, app/test/test_reorder.c, app/test/test_rib.c, app/test/test_rib6.c, app/test/test_ring.c, app/test/test_sched.c, app/test/test_seqlock.c, app/test/test_service_cores.c, app/test/test_soring.c, app/test/test_spinlock.c, app/test/test_string_fns.c, app/test/test_table.c, app/test/test_tailq.c, app/test/test_telemetry_data.c
Changed REGISTER_FAST_TEST macro invocations from boolean flags (true, true) to (NOHUGE_OK, ASAN_OK), replacing generic boolean parameters with environment-specific capability flags.
Test Files: Boolean to NOHUGE_SKIP, ASAN_OK
app/test/test_atomic.c, app/test/test_compressdev.c, app/test/test_dispatcher.c, app/test/test_distributor.c, app/test/test_event_eth_tx_adapter.c, app/test/test_external_mem.c, app/test/test_func_reentrancy.c, app/test/test_hash_readwrite.c, app/test/test_ipfrag.c, app/test/test_malloc.c, app/test/test_mbuf.c, app/test/test_mcslock.c, app/test/test_memory.c, app/test/test_mempool.c, app/test/test_memzone.c, app/test/test_pdcp.c, app/test/test_pdump.c, app/test/test_power_cpufreq.c, app/test/test_power_kvm_vm.c, app/test/test_security.c, app/test/test_stack.c
Changed REGISTER_FAST_TEST invocations from boolean flags (false, true) to (NOHUGE_SKIP, ASAN_OK), or other combinations, replacing legacy boolean semantics with explicit skip/accept tokens.
Test Files: Boolean to NOHUGE_OK, ASAN_SKIP
app/test/test_lcore_var.c
Changed REGISTER_FAST_TEST invocation from (true, false) to (NOHUGE_OK, ASAN_SKIP).
Test Files: Boolean to NOHUGE_SKIP, ASAN_SKIP
app/test/test_eal_flags.c, app/test/test_mp_secondary.c
Changed REGISTER_FAST_TEST invocations from (false, false) to (NOHUGE_SKIP, ASAN_SKIP).
Test Files: Macro Registration Changes
app/test/test_bpf.c, app/test/test_cryptodev_crosscheck.c, app/test/test_ethdev_api.c, app/test/test_event_crypto_adapter.c, app/test/test_event_eth_rx_adapter.c, app/test/test_event_timer_adapter.c, app/test/test_event_vector_adapter.c, app/test/test_eventdev.c, app/test/test_ipsec_sad.c, app/test/test_pmu.c, app/test/test_red.c, app/test/test_rwlock.c, app/test/test_security_inline_macsec.c, app/test/test_security_inline_proto.c
Replaced test registration macros: REGISTER_TEST_COMMAND(...)REGISTER_DRIVER_TEST(...) for driver-based tests; REGISTER_TEST_COMMAND(...)REGISTER_ATTIC_TEST(...) for red_autotest; some tests updated to REGISTER_FAST_TEST with new flags (e.g., external_mem, ipsec_sad, power_cpufreq).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Homogeneous changes dominate: ~95% of modifications are repetitive flag replacements following a single pattern (boolean → named constant)
  • High file count balanced by simplicity: While affecting 100+ test files, each change is trivial pattern substitution with minimal logic complexity
  • Infrastructure changes merit attention:
    • app/test/process.h: Driver path support logic with argv expansion (requires verification of memory/iteration logic)
    • app/test/suites/meson.build: Parameter validation logic and error handling
    • app/test/test.h: New macro definition consistency

Poem

🐰 Test flags transform from true/false to names so bright,
NOHUGE_OK and ASAN_SKIP bring clarity to light,
Driver paths now journey where test processes flow,
A rabbit rejoices—the test suite does grow!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main objective: assigning all unit tests to suites. It directly relates to the changeset which updates test registrations throughout the codebase.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch series_36861

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd60dcd and 53e6bf8.

📒 Files selected for processing (107)
  • app/test/process.h (6 hunks)
  • app/test/suites/meson.build (1 hunks)
  • app/test/test.h (1 hunks)
  • app/test/test_acl.c (1 hunks)
  • app/test/test_alarm.c (1 hunks)
  • app/test/test_argparse.c (1 hunks)
  • app/test/test_atomic.c (1 hunks)
  • app/test/test_bitcount.c (1 hunks)
  • app/test/test_bitmap.c (1 hunks)
  • app/test/test_bitops.c (1 hunks)
  • app/test/test_bitratestats.c (1 hunks)
  • app/test/test_bitset.c (1 hunks)
  • app/test/test_bpf.c (3 hunks)
  • app/test/test_byteorder.c (1 hunks)
  • app/test/test_cfgfile.c (1 hunks)
  • app/test/test_cksum.c (1 hunks)
  • app/test/test_cmdline.c (1 hunks)
  • app/test/test_common.c (1 hunks)
  • app/test/test_compressdev.c (1 hunks)
  • app/test/test_cpuflags.c (1 hunks)
  • app/test/test_crc.c (1 hunks)
  • app/test/test_cryptodev_crosscheck.c (1 hunks)
  • app/test/test_cycles.c (1 hunks)
  • app/test/test_debug.c (1 hunks)
  • app/test/test_devargs.c (1 hunks)
  • app/test/test_dispatcher.c (1 hunks)
  • app/test/test_distributor.c (1 hunks)
  • app/test/test_eal_flags.c (1 hunks)
  • app/test/test_eal_fs.c (1 hunks)
  • app/test/test_errno.c (1 hunks)
  • app/test/test_ethdev_api.c (1 hunks)
  • app/test/test_ethdev_link.c (1 hunks)
  • app/test/test_event_crypto_adapter.c (1 hunks)
  • app/test/test_event_eth_rx_adapter.c (1 hunks)
  • app/test/test_event_eth_tx_adapter.c (1 hunks)
  • app/test/test_event_ring.c (1 hunks)
  • app/test/test_event_timer_adapter.c (1 hunks)
  • app/test/test_event_vector_adapter.c (1 hunks)
  • app/test/test_eventdev.c (1 hunks)
  • app/test/test_external_mem.c (1 hunks)
  • app/test/test_fbarray.c (1 hunks)
  • app/test/test_fib.c (1 hunks)
  • app/test/test_fib6.c (1 hunks)
  • app/test/test_func_reentrancy.c (1 hunks)
  • app/test/test_graph.c (2 hunks)
  • app/test/test_graph_feature_arc.c (1 hunks)
  • app/test/test_hash.c (1 hunks)
  • app/test/test_hash_readwrite.c (1 hunks)
  • app/test/test_interrupts.c (1 hunks)
  • app/test/test_ipfrag.c (1 hunks)
  • app/test/test_ipsec.c (1 hunks)
  • app/test/test_ipsec_sad.c (1 hunks)
  • app/test/test_kvargs.c (1 hunks)
  • app/test/test_latencystats.c (1 hunks)
  • app/test/test_lcore_var.c (1 hunks)
  • app/test/test_lcores.c (1 hunks)
  • app/test/test_logs.c (1 hunks)
  • app/test/test_lpm.c (1 hunks)
  • app/test/test_lpm6.c (1 hunks)
  • app/test/test_malloc.c (1 hunks)
  • app/test/test_mbuf.c (1 hunks)
  • app/test/test_mcslock.c (1 hunks)
  • app/test/test_member.c (1 hunks)
  • app/test/test_memcpy.c (1 hunks)
  • app/test/test_memory.c (1 hunks)
  • app/test/test_mempool.c (1 hunks)
  • app/test/test_memzone.c (1 hunks)
  • app/test/test_meter.c (1 hunks)
  • app/test/test_metrics.c (1 hunks)
  • app/test/test_mp_secondary.c (1 hunks)
  • app/test/test_net_ether.c (1 hunks)
  • app/test/test_net_ip6.c (1 hunks)
  • app/test/test_pcapng.c (1 hunks)
  • app/test/test_pdcp.c (1 hunks)
  • app/test/test_pdump.c (1 hunks)
  • app/test/test_per_lcore.c (1 hunks)
  • app/test/test_pflock.c (1 hunks)
  • app/test/test_pie.c (1 hunks)
  • app/test/test_pmd_ring.c (1 hunks)
  • app/test/test_pmu.c (1 hunks)
  • app/test/test_power.c (1 hunks)
  • app/test/test_power_cpufreq.c (2 hunks)
  • app/test/test_power_intel_uncore.c (1 hunks)
  • app/test/test_power_kvm_vm.c (1 hunks)
  • app/test/test_prefetch.c (1 hunks)
  • app/test/test_ptr_compress.c (1 hunks)
  • app/test/test_rawdev.c (1 hunks)
  • app/test/test_rcu_qsbr.c (1 hunks)
  • app/test/test_red.c (1 hunks)
  • app/test/test_reorder.c (1 hunks)
  • app/test/test_rib.c (1 hunks)
  • app/test/test_rib6.c (1 hunks)
  • app/test/test_ring.c (1 hunks)
  • app/test/test_rwlock.c (1 hunks)
  • app/test/test_sched.c (1 hunks)
  • app/test/test_security.c (1 hunks)
  • app/test/test_security_inline_macsec.c (1 hunks)
  • app/test/test_security_inline_proto.c (1 hunks)
  • app/test/test_seqlock.c (1 hunks)
  • app/test/test_service_cores.c (1 hunks)
  • app/test/test_soring.c (1 hunks)
  • app/test/test_spinlock.c (1 hunks)
  • app/test/test_stack.c (1 hunks)
  • app/test/test_string_fns.c (1 hunks)
  • app/test/test_table.c (1 hunks)
  • app/test/test_tailq.c (1 hunks)
  • app/test/test_telemetry_data.c (1 hunks)
⛔ Files not processed due to max files limit (14)
  • app/test/test_telemetry_json.c
  • app/test/test_thash.c
  • app/test/test_threads.c
  • app/test/test_ticketlock.c
  • app/test/test_timer.c
  • app/test/test_timer_secondary.c
  • app/test/test_trace.c
  • app/test/test_vdev.c
  • app/test/test_version.c
  • buildtools/get-test-suites.py
  • doc/guides/contributing/unit_test.rst
  • lib/eal/common/eal_common_options.c
  • lib/eal/include/rte_eal.h
  • lib/sched/rte_red.h
🧰 Additional context used
🧬 Code graph analysis (1)
app/test/process.h (1)
lib/eal/common/eal_common_options.c (1)
  • rte_eal_driver_path_count (786-798)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (114)
app/test/test_compressdev.c (1)

4258-4258: REGISTER_FAST_TEST flag update is correct

NOHUGE_SKIP and ASAN_OK accurately preserve the prior semantics (false, true) for this fast test and align with the new documented flag usage; no further changes needed. (mails.dpdk.org)

app/test/test_spinlock.c (1)

306-306: Spinlock autotest registration correctly migrated to capability flags

Using NOHUGE_OK and ASAN_OK preserves the prior true, true semantics for spinlock_autotest and aligns with the new registration scheme, with no impact on test logic.

app/test/test_cryptodev_crosscheck.c (1)

1050-1050: cryptodev_crosscheck moved to driver-test registration appropriately

Registering cryptodev_crosscheck via REGISTER_DRIVER_TEST matches its dependency on cryptodev hardware and keeps the function binding unchanged.

app/test/test_bitratestats.c (1)

252-252: bitratestats_autotest registration flags updated consistently

NOHUGE_OK and ASAN_OK correctly reflect the previous true, true behavior for bitratestats_autotest and align it with the new capability-flag model.

app/test/test_telemetry_data.c (1)

618-618: telemetry_data_autotest now uses explicit NOHUGE/ASAN capability flags

NOHUGE_OK and ASAN_OK match the original intent (run in both environments) and are consistent with the rest of the telemetry test file and the suite-wide migration.

app/test/test_power_kvm_vm.c (1)

266-266: power_kvm_vm_autotest gating preserved with NOHUGE_SKIP/ASAN_OK

Translating (false, true) to (NOHUGE_SKIP, ASAN_OK) keeps the existing behavior—skipping in no-huge environments while allowing ASAN—and integrates with the new capability-based registration.

app/test/test_logs.c (1)

161-161: logs_autotest registration aligned with capability-flag scheme

Using NOHUGE_OK and ASAN_OK for logs_autotest accurately reflects its environment independence and matches the project-wide flag migration.

app/test/test_memcpy.c (1)

132-132: memcpy_autotest correctly marked as NOHUGE_OK and ASAN_OK

The memcpy functional test is independent of hugepage configuration and safe under ASAN, so the new capability flags are an accurate replacement for the prior boolean parameters.

app/test/test_stack.c (1)

382-383: stack autotest registrations preserve prior environment gating

Both stack_autotest and stack_lf_autotest now use (NOHUGE_SKIP, ASAN_OK), which matches the earlier (false, true) behavior—skipping in no-huge mode while allowing ASAN—and is consistent with the rest of the test suite’s flag migration.

app/test/test_sched.c (1)

218-218: Sched fast-test registration updated correctly

REGISTER_FAST_TEST(sched_autotest, NOHUGE_OK, ASAN_OK, test_sched); matches the existing test_sched entry point and aligns with the new flag-based pattern; no functional issues evident.

app/test/test_byteorder.c (1)

66-66: Byteorder fast-test flags migration looks good

The change to REGISTER_FAST_TEST(byteorder_autotest, NOHUGE_OK, ASAN_OK, test_byteorder); preserves the previous behavior while adopting the new capability flags.

app/test/test_member.c (1)

999-999: Member autotest registration aligned with new flag API

REGISTER_FAST_TEST(member_autotest, NOHUGE_OK, ASAN_OK, test_member); correctly targets the aggregated test_member function and matches the project-wide NOHUGE/ASAN flag pattern.

app/test/test_pmu.c (1)

56-56: Keeping disabled PMU test comment in sync is fine

Updating the commented REGISTER_FAST_TEST(pmu_autotest, NOHUGE_OK, ASAN_OK, test_pmu); keeps the example aligned with current flags without changing behavior, which is appropriate while the test stays disabled.

app/test/test_per_lcore.c (1)

121-121: Per-lcore fast-test registration update is consistent

REGISTER_FAST_TEST(per_lcore_autotest, NOHUGE_OK, ASAN_OK, test_per_lcore); correctly references the main test function and uses the new NOHUGE/ASAN flags; nothing else needed.

app/test/test_bitcount.c (1)

174-174: Bitcount autotest registration change is trivial and correct

The switch to REGISTER_FAST_TEST(bitcount_autotest, NOHUGE_OK, ASAN_OK, test_bitcount); keeps the same test entry and adopts the standardized capability flags.

app/test/test_pie.c (1)

1085-1085: PIE functional autotest now uses capability flags

REGISTER_FAST_TEST(pie_autotest, NOHUGE_OK, ASAN_OK, test_pie); correctly registers the functional PIE test alongside existing perf registrations and matches the new flag scheme.

app/test/test_tailq.c (1)

128-128: Tailq autotest registration flag update looks good

The change to REGISTER_FAST_TEST(tailq_autotest, NOHUGE_OK, ASAN_OK, test_tailq); preserves the existing test entry point while conforming to the new NOHUGE/ASAN flag conventions.

app/test/test_pmd_ring.c (1)

596-596: REGISTER_FAST_TEST flag migration looks correct

Switching from boolean flags to NOHUGE_OK / ASAN_OK preserves the prior “no-huge allowed, ASAN-safe” semantics for ring_pmd_autotest. No further changes needed here.

app/test/test_pdcp.c (1)

2391-2391: Capability flags correctly reflect previous pdcp_autotest behavior

Using NOHUGE_SKIP (was false) and ASAN_OK (was true) keeps the prior constraints: skip when no-huge is enforced but allow ASAN. Registration signature and target function remain consistent.

app/test/test_lcores.c (1)

425-425: lcores_autotest registration updated consistently

NOHUGE_OK / ASAN_OK are the expected replacements for the previous (true, true) flags here; registration still points to test_lcores only.

app/test/test_rib6.c (1)

365-365: rib6_autotest flag conversion matches suite semantics

The switch to NOHUGE_OK and ASAN_OK for rib6_autotest aligns with the former boolean configuration and doesn’t affect the slow/perf suite registration.

app/test/test_latencystats.c (1)

249-249: latencystats_autotest registration updated appropriately

NOHUGE_OK and ASAN_OK are the expected explicit equivalents of the prior boolean flags for this suite; no functional impact beyond clearer gating.

app/test/test_hash_readwrite.c (1)

778-778: hash_readwrite functional test gating preserved with new flags

Replacing (false, true) with NOHUGE_SKIP / ASAN_OK keeps the previous behavior (skip without hugepages, allow ASAN) while conforming to the new capability-flag scheme.

app/test/test_func_reentrancy.c (1)

514-514: func_reentrancy_autotest registration matches new capability model

NOHUGE_SKIP and ASAN_OK correctly replace the old (false, true) flags, preserving that this test should be skipped without hugepages but is ASAN-safe.

app/test/test_rwlock.c (1)

510-513: RWLock autotest registrations consistently migrated to capability flags

All four RWLock tests now use NOHUGE_OK and ASAN_OK instead of (true, true), which is appropriate for these synchronization-only unit tests and keeps behavior unchanged under the new registration scheme.

app/test/test_metrics.c (1)

329-329: Metrics autotest registration flags look appropriate

Switching to REGISTER_FAST_TEST(metrics_autotest, NOHUGE_OK, ASAN_OK, test_metrics); matches the test’s pure-API behavior and aligns with the new capability-flag scheme.

app/test/test_seqlock.c (1)

190-190: Seqlock autotest capability flags are consistent with test behavior

Using NOHUGE_OK and ASAN_OK for seqlock_autotest fits this concurrency-focused test and the suite-wide flag refactor.

app/test/test_ipsec.c (1)

2620-2620: IPsec autotest registration updated correctly to capability flags

The move to REGISTER_FAST_TEST(ipsec_autotest, NOHUGE_OK, ASAN_OK, test_ipsec); matches the rest of the suite and the test’s device‑centric (not hugepage‑specific) nature.

app/test/test_event_eth_rx_adapter.c (1)

1558-1561: Switch to REGISTER_DRIVER_TEST matches these tests’ device dependencies

Registering event_eth_rx_adapter_autotest and event_eth_rx_intr_adapter_autotest via REGISTER_DRIVER_TEST is appropriate since the suites rely on eventdev/ethdev and virtual devices, and it aligns with the new driver‑test classification.

app/test/test_rawdev.c (1)

77-77: Rawdev autotest gating updated appropriately

REGISTER_FAST_TEST(rawdev_autotest, NOHUGE_OK, ASAN_OK, test_rawdev_selftests); correctly reflects that the rawdev selftests are device‑/driver‑oriented and not tied to hugepages, while remaining ASan‑friendly.

app/test/test_net_ip6.c (1)

221-221: IPv6 helper autotest flags are straightforwardly correct

For a pure IPv6 utility test, REGISTER_FAST_TEST(net_ipv6_autotest, NOHUGE_OK, ASAN_OK, test_net_ipv6); is exactly what we want and matches the project-wide flag refactor.

app/test/test_memory.c (1)

113-113: Memory autotest gating matches its constraints

Marking memory_autotest as REGISTER_FAST_TEST(memory_autotest, NOHUGE_SKIP, ASAN_OK, test_memory); is a good fit: the test walks all memsegs (so it should be skipped in no‑huge setups) and the existing __rte_no_asan annotation justifies enabling it under ASan.

app/test/test_errno.c (1)

97-97: Errno autotest registration aligns with its pure-logic nature

Updating to REGISTER_FAST_TEST(errno_autotest, NOHUGE_OK, ASAN_OK, test_errno); is fully in line with the new flag scheme and the test’s lack of hugepage or sanitizer sensitivities.

app/test/test_event_timer_adapter.c (1)

2039-2039: Switch to REGISTER_DRIVER_TEST looks appropriate

Reclassifying event_timer_adapter_test as a driver test matches its dependency on eventdev/timer-adapter capabilities; no behavior change in the suite runner.

app/test/test_graph.c (2)

1153-1153: Updated capability flags for graph_autotest are consistent

Mapping from prior true, true to NOHUGE_OK, ASAN_OK preserves semantics and correctly marks the test as safe under no-huge and ASAN.


1165-1165: node_list_dump registration now uses explicit capability tokens

Using NOHUGE_OK, ASAN_OK instead of booleans keeps behavior while aligning with the new capability-based registration scheme.

app/test/test_ipfrag.c (1)

508-508: ipfrag_autotest flag mapping preserved with tokens

Replacing false, true by NOHUGE_SKIP, ASAN_OK keeps the original gating behavior while conforming to the new tokenized API.

app/test/test_fbarray.c (1)

936-936: fbarray_autotest registration correctly updated to capability flags

NOHUGE_OK, ASAN_OK is the natural replacement for the prior true, true and matches the test’s pure-data-structure nature.

app/test/test_mp_secondary.c (1)

226-226: multiprocess_autotest remains gated, now via NOHUGE_SKIP/ASAN_SKIP

The conversion from false, false to NOHUGE_SKIP, ASAN_SKIP preserves existing behavior and cleanly expresses the constraints.

app/test/test_ptr_compress.c (1)

193-193: ptr_compress_autotest now uses explicit OK flags

NOHUGE_OK, ASAN_OK accurately reflects the previous true, true configuration for this pure library test.

app/test/test_power_intel_uncore.c (1)

306-306: power_intel_uncore_autotest registration flags modernized

Swapping true, true for NOHUGE_OK, ASAN_OK keeps previous behavior and lets the existing runtime checks control support/skip decisions.

app/test/test_pdump.c (1)

222-222: pdump_autotest capabilities expressed as NOHUGE_OK, ASAN_SKIP

The new flags mirror the earlier boolean configuration while clearly documenting that the test is fine without hugepages but excluded from ASAN runs.

app/test/test_bitset.c (1)

912-912: LGTM: Test registration updated with explicit capability flags.

The migration from boolean literals (true, true) to named constants (NOHUGE_OK, ASAN_OK) improves code readability and makes the test's environment requirements self-documenting.

app/test/test_ethdev_api.c (1)

188-188: LGTM: Test macro updated to driver-specific registration.

The change from REGISTER_TEST_COMMAND to REGISTER_DRIVER_TEST appropriately categorizes this ethdev API test as a driver test, consistent with the TODO comment above indicating this should eventually become a fast test once all drivers comply with queue state requirements.

app/test/test_rib.c (1)

366-366: LGTM: Test registration modernized with named capability flags.

Replacing true, true with NOHUGE_OK, ASAN_OK makes the test's compatibility requirements explicit and easier to maintain.

app/test/test_graph_feature_arc.c (1)

1371-1371: LGTM: Test registration fixed and modernized.

Two improvements in one:

  1. Corrected test name from graph_feature_arc_autotest_autotest (duplicate) to graph_feature_arc_autotest
  2. Replaced boolean flags with explicit capability constants (NOHUGE_OK, ASAN_OK)
app/test/test_eal_flags.c (1)

1695-1706: LGTM: All EAL flag tests consistently updated.

All 12 test registrations correctly migrated from false, false to NOHUGE_SKIP, ASAN_SKIP, making it explicit that these tests should be skipped in no-hugepage and ASAN environments.

app/test/test_event_vector_adapter.c (1)

711-713: Note: Test registration is commented out pending fixes.

The commented-out registration shows the intended migration to NOHUGE_OK, ASAN_OK flags. The comment indicates the test is disabled due to reported failures awaiting a fix.

app/test/test_mempool.c (1)

1125-1125: LGTM: Mempool test registration flags clarified.

The change from false, true to NOHUGE_SKIP, ASAN_OK explicitly documents that this test should be skipped in no-hugepage mode but is compatible with AddressSanitizer.

app/test/test_eal_fs.c (1)

188-188: LGTM: EAL filesystem test registration modernized.

Converting from true, true to NOHUGE_OK, ASAN_OK improves clarity about the test's environment compatibility.

app/test/test_security.c (1)

2317-2317: LGTM!

The test registration correctly migrates from boolean flags to explicit capability tokens (NOHUGE_SKIP, ASAN_OK), improving readability and aligning with the broader test harness standardization.

app/test/test_ipsec_sad.c (1)

902-902: LGTM!

The test is appropriately migrated from REGISTER_TEST_COMMAND to REGISTER_FAST_TEST, assigning it to a test suite with explicit capability flags (NOHUGE_OK, ASAN_OK). This aligns with the PR objective of assigning all unit tests to suites.

app/test/process.h (4)

21-21: LGTM!

The rte_eal.h include is correctly added to provide access to rte_eal_driver_path_count() and RTE_EAL_DRIVER_PATH_FOREACH macro used in the new functionality.


97-97: LGTM!

The driver_path_num variable is correctly introduced and used to calculate the total argv size. The call to rte_eal_driver_path_count(true) correctly passes cmdline_only=true to only include driver paths that were specified on the command line.

Also applies to: 113-114


129-132: LGTM!

The driver-path parameters are correctly appended to argv after the allow parameters. The added variable properly tracks the actual number of entries added (which may differ from driver_path_num if asprintf fails), maintaining correct indexing.


68-83: LGTM!

The add_parameter_driver_path function correctly mirrors the pattern of add_parameter_allow. It iterates through driver paths using the RTE_EAL_DRIVER_PATH_FOREACH macro with cmdline_only=true to propagate only command-line specified driver paths to the subprocess.

The memory allocated by asprintf() is intentionally not freed since it will be used by execv() in the child process.

app/test/test_net_ether.c (1)

165-165: LGTM!

The test registration correctly migrates from boolean flags to explicit capability tokens (NOHUGE_OK, ASAN_OK). This is appropriate since the Ethernet address manipulation tests don't require hugepage memory.

app/test/test_mbuf.c (1)

2956-2956: LGTM!

The test registration correctly migrates from boolean flags to explicit capability tokens (NOHUGE_SKIP, ASAN_OK). NOHUGE_SKIP is appropriate since mbuf tests rely on rte_pktmbuf_pool_create and mempool allocations that require hugepage memory.

app/test/test_malloc.c (1)

1169-1169: Malloc test registration flags look correct

Wiring malloc_autotest through REGISTER_FAST_TEST with NOHUGE_SKIP/ASAN_OK is consistent with this suite’s heavy malloc/heap usage and localized __rte_no_asan helper; no issues seen.

app/test/test_external_mem.c (1)

590-590: External-mem test now correctly uses capability-based fast-test registration

Hooking external_mem_autotest into REGISTER_FAST_TEST with NOHUGE_SKIP/ASAN_OK matches its low-level heap/extmem nature and existing Windows skip behavior; nothing problematic here.

app/test/test_memzone.c (1)

1165-1165: Memzone autotest gating is aligned with its hugepage-heavy behavior

Registering memzone_autotest with NOHUGE_SKIP and ASAN_OK is appropriate given this suite’s reliance on hugepage-backed memzones and lack of intentional sanitizer-hostile patterns.

app/test/test_power.c (1)

81-81: Power autotest registration matches its environment-only behavior

The NOHUGE_OK/ASAN_OK flags for power_autotest are appropriate since the test just exercises power env configuration and doesn’t depend on hugepages or sanitizer-sensitive memory patterns.

app/test/test_interrupts.c (1)

597-597: Interrupt autotest flags are reasonable

interrupt_autotest doesn’t depend on hugepage-backed memory and has no intentional UAF/poisoned-access behavior, so NOHUGE_OK and ASAN_OK are a good fit for the fast-test registration.

app/test/test_lcore_var.c (1)

414-414: Lcore-var autotest gating matches its layout-sensitive nature

Marking lcore_var_autotest as NOHUGE_OK and ASAN_SKIP makes sense: it’s independent of hugepages but deeply inspects lcore-var layout and alignment, which can be perturbed under sanitizers.

app/test/test_eventdev.c (1)

1532-1535: Eventdev fast-test registrations look correct

Using NOHUGE_OK/ASAN_OK for both eventdev_common_autotest and eventdev_selftest_sw matches their API-centric behavior, and keeping eventdev_common_autotest registered on all platforms is fine since the Windows implementation already returns TEST_SKIPPED.

app/test/test_reorder.c (1)

555-555: Reorder autotest registration is consistent with its dependencies

reorder_autotest only relies on mbuf/mempool/reorder APIs and not on hugepage-specific behavior, so NOHUGE_OK and ASAN_OK on the fast-test registration are appropriate.

app/test/test_prefetch.c (1)

38-38: LGTM! Test registration modernization improves code clarity.

The replacement of boolean literals with explicit capability flags (NOHUGE_OK, ASAN_OK) makes the test registration self-documenting and aligns with the project-wide test suite modernization. The test logic remains unchanged.

app/test/test_kvargs.c (1)

367-367: LGTM! Consistent test registration update.

The change from boolean flags to named capability constants improves maintainability and aligns with the broader test suite refactor.

app/test/test_pcapng.c (1)

467-467: LGTM! Clean refactor to capability flags.

Replacing boolean literals with explicit flags enhances code readability without altering test behavior.

app/test/test_rcu_qsbr.c (1)

1421-1421: LGTM! Registration modernization applied correctly.

The update to named capability flags is consistent with the project-wide pattern and improves code clarity.

app/test/test_table.c (1)

209-209: LGTM! Test registration updated consistently.

The change to explicit capability flags maintains consistency with other test files in this PR.

app/test/test_dispatcher.c (1)

1056-1056: LGTM! Correct translation preserves test gating behavior.

The change from false, true to NOHUGE_SKIP, ASAN_OK correctly preserves the original behavior where this test is skipped when huge pages are not available. The explicit flags make this requirement clear.

app/test/test_ethdev_link.c (1)

175-175: LGTM! Consistent capability flag update.

The registration modernization aligns with the project-wide refactor and improves code self-documentation.

app/test/test_cycles.c (1)

56-56: LGTM! Final test registration updated consistently.

The change completes the pattern of replacing boolean literals with self-documenting capability flags across the test suite.

app/test/test_alarm.c (1)

79-79: LGTM! Clear improvement in readability.

The replacement of boolean literals with explicit capability flags (NOHUGE_OK, ASAN_OK) makes the test registration self-documenting and easier to understand.

app/test/test_service_cores.c (1)

1084-1084: LGTM! Consistent with project-wide refactoring.

The change from boolean literals to named capability flags improves code clarity and aligns with the broader test suite modernization.

app/test/test_cksum.c (1)

270-270: LGTM! Well-aligned with test suite improvements.

Explicit capability flags make the test requirements transparent at the registration site.

app/test/test_distributor.c (1)

956-956: LGTM! Appropriate capability flag selection.

The use of NOHUGE_SKIP is appropriate for the distributor test, which likely requires huge pages for its memory pools and packet processing.

app/test/test_fib.c (1)

632-632: LGTM! Clean refactoring.

The capability flags clearly document that this test is compatible with both no-huge-page and ASAN environments.

app/test/test_event_ring.c (1)

259-259: LGTM! Excellent readability improvement.

Named capability flags make test requirements explicit and eliminate the ambiguity of positional boolean parameters.

app/test/test_hash.c (1)

2408-2408: LGTM! Maintainability enhancement.

The explicit capability flags improve code maintainability and reduce the cognitive load of understanding test registration parameters.

app/test/test_fib6.c (1)

643-643: LGTM! Completes the consistent refactoring pattern.

The capability flags make test requirements explicit and complete the project-wide migration from boolean literals to named constants.

app/test/test_cfgfile.c (1)

402-402: Fast test registration flags look consistent

Using NOHUGE_OK and ASAN_OK for cfgfile_autotest matches the prior true, true semantics and aligns with the new REGISTER_FAST_TEST contract. No issues from a C/ABI perspective since only cmd and func are used.

app/test/test_bitops.c (1)

441-441: Bitops fast test capability flags mapped correctly

bitops_autotest being marked NOHUGE_OK and ASAN_OK is consistent with the prior boolean registration and the test’s pure algorithmic nature.

app/test/test_lpm6.c (1)

1770-1770: LPM6 fast test registration updated as expected

Switch to NOHUGE_OK/ASAN_OK preserves the original “allowed under no-huge and ASan” intent for lpm6_autotest; no functional change to the tests themselves.

app/test/test_mcslock.c (1)

244-244: mcslock fast test gating preserved

NOHUGE_SKIP / ASAN_OK correctly reflects the former (false, true) flags for mcslock_autotest, keeping the same hugepage/ASan gating behavior under the new scheme.

app/test/test_atomic.c (1)

635-635: Atomic fast test flags mapped 1:1 from booleans

atomic_autotest now uses NOHUGE_SKIP and ASAN_OK, which is the direct symbolic equivalent of the previous (false, true) arguments and keeps the existing platform/allocator gating.

app/test/test.h (1)

214-225: New fast/attic test macros are simple, compatible aliases

The REGISTER_FAST_TEST and REGISTER_ATTIC_TEST definitions cleanly alias to REGISTER_TEST_COMMAND, while the added comment documents the intended NOHUGE_* / ASAN_* tokens. Discarding the extra params in the macro body is fine given they’re used as metadata rather than at runtime.

app/test/test_acl.c (1)

1751-1751: ACL fast test registration updated consistently

acl_autotest being tagged NOHUGE_OK and ASAN_OK matches the former boolean configuration and works for both the full implementation and the Windows “skipped” stub.

app/test/test_cmdline.c (1)

63-63: cmdline fast test flags aligned with new convention

cmdline_autotest now uses NOHUGE_OK and ASAN_OK, which is the expected symbolic replacement for the previous (true, true) arguments with no impact on the test body.

app/test/test_string_fns.c (1)

331-331: Flag-based registration for string_autotest looks correct

Switching from boolean flags to NOHUGE_OK, ASAN_OK for test_string_fns matches the new test harness pattern and is appropriate for a pure string utility test.

app/test/test_cpuflags.c (1)

330-330: Updated cpuflags_autotest registration matches new flag API

Using NOHUGE_OK, ASAN_OK for test_cpuflags preserves the prior semantics of running in no-huge and ASAN environments and aligns with the rest of the suite.

app/test/test_devargs.c (1)

323-323: devargs_autotest registration updated consistently

REGISTER_FAST_TEST(devargs_autotest, NOHUGE_OK, ASAN_OK, test_devargs) is consistent with the new flag-based API and matches the nature of this parsing-only test.

app/test/test_bpf.c (3)

3281-3281: bpf_autotest moved to capability flags cleanly

The switch to REGISTER_FAST_TEST(bpf_autotest, NOHUGE_OK, ASAN_OK, test_bpf) is in line with the new scheme and keeps the mapping between test name and implementation clear.


3754-3754: bpf_elf_autotest registration matches new pattern

Using NOHUGE_OK, ASAN_OK for test_bpf_elf aligns this ELF-loading test with the rest of the fast tests registered via capability flags.


3972-3972: bpf_convert_autotest registration updated consistently

REGISTER_FAST_TEST(bpf_convert_autotest, NOHUGE_OK, ASAN_OK, test_bpf_convert) correctly hooks the existing conversion test into the new flag-based fast-test registration.

app/test/test_crc.c (1)

143-143: CRC autotest registration aligns with flag-based interface

Replacing the boolean parameters with NOHUGE_OK, ASAN_OK for crc_autotest is a straightforward mechanical update and suits this CPU-only test.

app/test/test_argparse.c (1)

1621-1621: argparse_autotest correctly registered into fast suite

REGISTER_FAST_TEST(argparse_autotest, NOHUGE_OK, ASAN_OK, test_argparse) cleanly wires the existing unit-test suite into the new fast-test mechanism.

app/test/test_lpm.c (1)

1587-1587: LPM autotest registration updated as expected

The move to REGISTER_FAST_TEST(lpm_autotest, NOHUGE_OK, ASAN_OK, test_lpm) matches the new registration contract and keeps the test name/function pairing intact.

app/test/test_red.c (1)

1875-1875: red_autotest reclassified as an attic test

Switching to REGISTER_ATTIC_TEST(red_autotest, test_red) cleanly moves this comprehensive/slow RED test into the attic category while leaving the existing perf registrations (red_perf, red_all) intact.

app/test/test_ring.c (1)

1251-1251: LGTM! Clean migration to explicit capability flags.

The update from boolean parameters to NOHUGE_OK and ASAN_OK makes the test registration more self-documenting and aligns with the PR-wide standardization of test environment capabilities.

app/test/test_common.c (1)

357-357: LGTM! Consistent with the test suite refactoring.

The migration to explicit capability flags (NOHUGE_OK, ASAN_OK) improves test registration clarity.

app/test/test_event_crypto_adapter.c (1)

1628-1629: LGTM! Appropriate reclassification as a driver test.

Migrating from REGISTER_TEST_COMMAND to REGISTER_DRIVER_TEST correctly categorizes this as a driver-dependent test, which is appropriate for event crypto adapter functionality.

app/test/test_debug.c (1)

186-186: LGTM! Mechanical update to explicit capability flags.

The transition to NOHUGE_OK and ASAN_OK is consistent with the broader test suite refactoring.

app/test/test_power_cpufreq.c (2)

664-664: LGTM! Improved consistency with test framework conventions.

Returning TEST_SKIPPED instead of -1 when initialization fails aligns better with the test framework's return value semantics, making it clearer that this is a skip condition rather than a failure.


681-682: LGTM! Consistent migration to explicit capability flags.

Both test registrations now use explicit capability flags:

  • power_cpufreq_autotest: NOHUGE_SKIP reflects that this test requires hugepages
  • power_caps_autotest: NOHUGE_OK indicates this test can run without hugepages

This improves test configuration clarity.

app/test/suites/meson.build (1)

70-82: LGTM! Excellent defensive programming with build-time validation.

The added parameter validation ensures that only valid capability flags (NOHUGE_OK/NOHUGE_SKIP and ASAN_OK/ASAN_SKIP) are used in test registrations. This catches configuration errors early at build time rather than allowing invalid test configurations to silently pass through.

The updated parsing logic (lines 81-82) correctly derives boolean values from the explicit flag tokens, maintaining compatibility with the downstream test execution logic.

app/test/test_bitmap.c (1)

272-272: LGTM! Mechanical update to explicit capability flags.

The transition to NOHUGE_OK and ASAN_OK is consistent with the test suite refactoring.

app/test/test_pflock.c (1)

197-197: LGTM! Consistent with the test suite refactoring.

The migration to explicit capability flags (NOHUGE_OK, ASAN_OK) improves test registration clarity.

app/test/test_soring.c (1)

441-441: Soring test registration flags look correct

Switching soring_autotest to REGISTER_FAST_TEST(soring_autotest, NOHUGE_OK, ASAN_OK, test_soring) matches the intent of a generic functional test that should run without hugepages and under ASAN, with the same test entry point. No issues from the registration side.

app/test/test_event_eth_tx_adapter.c (1)

1013-1013: Event ETH TX adapter test correctly marked as NOHUGE-only and ASAN-safe

Using REGISTER_FAST_TEST(event_eth_tx_adapter_autotest, NOHUGE_SKIP, ASAN_OK, test_event_eth_tx_adapter_common) preserves the previous behavior of skipping this test in no-hugepage environments while still allowing ASAN runs, with the shared test_event_eth_tx_adapter_common used for both Windows and non-Windows builds.

app/test/test_security_inline_macsec.c (1)

2587-2587: Inline MACsec test correctly migrated to driver-based registration

Changing from a generic test command to REGISTER_DRIVER_TEST(inline_macsec_autotest, test_inline_macsec) is appropriate for a MACsec capability–dependent path and aligns it with the driver test suite infrastructure, while keeping the existing Windows/non-Windows handling via test_inline_macsec().

app/test/test_meter.c (1)

716-716: Meter autotest registration aligned with new capability flags

REGISTER_FAST_TEST(meter_autotest, NOHUGE_OK, ASAN_OK, test_meter) accurately advertises that the meter tests are independent of hugepage support and are expected to be ASAN-clean; no behavioral changes to test_meter() itself.

app/test/test_security_inline_proto.c (1)

3619-3621: Inline IPsec tests correctly moved to driver test registry

Registering the three entry points via:

  • REGISTER_DRIVER_TEST(inline_ipsec_autotest, test_inline_ipsec);
  • REGISTER_DRIVER_TEST(inline_ipsec_sg_autotest, test_inline_ipsec_sg);
  • REGISTER_DRIVER_TEST(event_inline_ipsec_autotest, test_event_inline_ipsec);

is consistent with these being NIC/driver‑capability–dependent suites. It keeps the Windows stubs and the rich non‑Windows suites intact while shifting discovery into the driver test framework.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `lib/eal/common/eal_common_options.c:758-766` </location>
<code_context>

+RTE_EXPORT_SYMBOL(rte_eal_driver_path_next)
+const char *
+rte_eal_driver_path_next(const char *start, bool cmdline_only)
+{
+	struct shared_driver *solib;
+
+	if (start == NULL) {
+		solib = TAILQ_FIRST(&solib_list);
+	} else {
+		/* Find the current entry based on the name string */
+		TAILQ_FOREACH(solib, &solib_list, next) {
+			if (start == solib->name) {
+				solib = TAILQ_NEXT(solib, next);
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Pointer comparison for `start` requires callers to pass the exact returned pointer, which is a subtle contract.

This lookup assumes `start` is the exact same pointer as one of the stored `solib->name` values (i.e., a value previously returned by this function), not just an equal string. That’s safe with `RTE_EAL_DRIVER_PATH_FOREACH`, but easy to misuse for other callers. If this is meant as a public/ABI-stable API, consider either documenting that `start` must be a value previously returned by this function, or switching to an opaque iterator type (handle/index) instead of `const char *` to make correct use clearer.

Suggested implementation:

```c
/*
 * Iterate over registered shared drivers.
 *
 * The iterator is driven by the return value of this function:
 * - To start iteration, callers must pass start == NULL.
 * - To advance, callers must pass as start a pointer value that was
 *   previously returned by this function.
 *
 * Note: the lookup below compares the 'start' argument to the stored
 * solib->name using pointer equality, not strcmp(). This is intentional
 * to keep the API ABI-stable without introducing an explicit iterator
 * handle type, but it means arbitrary strings must not be passed here.
 *
 * The RTE_EAL_DRIVER_PATH_FOREACH macro is implemented to respect this
 * contract and should be preferred by most callers.
 */
RTE_EXPORT_SYMBOL(rte_eal_driver_path_next)
const char *
rte_eal_driver_path_next(const char *start, bool cmdline_only)

```

```c
	} else {
		/*
		 * Find the current entry based on the previously returned
		 * name pointer. This relies on pointer identity, not on
		 * string comparison, so 'start' must be a value returned
		 * by this function (or by RTE_EAL_DRIVER_PATH_FOREACH).
		 */
		TAILQ_FOREACH(solib, &solib_list, next) {

```
</issue_to_address>

### Comment 2
<location> `app/test/process.h:42-43` </location>
<code_context>
 #define PREFIX_ALLOW "--allow="
+#define PREFIX_DRIVER_PATH "--driver-path="

 static int
 add_parameter_allow(char **argv, int max_capacity)
</code_context>

<issue_to_address>
**suggestion (testing):** Add explicit tests for driver-path propagation to child processes

Given the new reliance on `rte_eal_driver_path_count(true)` and `RTE_EAL_DRIVER_PATH_FOREACH(..., true)` for propagating `--driver-path`, please add an end-to-end test (e.g., in `test_eal_flags.c` or a new EAL test) that:
- Launches a process with multiple `-d` / `--driver-path` options (plus optional directory-based drivers),
- Confirms a `process_dup()` child receives equivalent `--driver-path=` arguments reconstructed from `rte_eal_driver_path_*`,
- Exercises zero, single, and multiple paths, and verifies that only `from_cmdline` entries are propagated.
This will validate both the iterator APIs and the helper used to rebuild the arguments.

Suggested implementation:

```c
	RTE_EAL_DRIVER_PATH_FOREACH(driver_path, true) {
		size_t len;
		char *arg;

		if (count >= max_capacity)
			break;

		len = strlen(PREFIX_DRIVER_PATH) + strlen(driver_path) + 1;
		arg = malloc(len);
		if (arg == NULL)
			break;

		snprintf(arg, len, "%s%s", PREFIX_DRIVER_PATH, driver_path);
		argv[count++] = arg;
	}

```

To fully implement your test suggestion, you will also need to:

1. Ensure `app/test/process.h` (or a common header) includes the required headers if they are not already present:
   - `#include <stdlib.h>` for `malloc`
   - `#include <string.h>` for `strlen`
   - `#include <stdio.h>` for `snprintf`

2. Add an end-to-end EAL test (e.g., in `app/test/test_eal_flags.c` or an appropriate EAL test file) that:
   - Starts a primary process with:
     - Zero `-d/--driver-path` options,
     - A single `--driver-path=...` option,
     - Multiple `--driver-path=...` options plus any directory-based drivers configured via other APIs.
   - From within that process, calls `process_dup()` (or the existing helper you use for child processes).
   - Asserts that the child’s `argv`:
     - Contains `--driver-path=<path>` entries that exactly match the `from_cmdline` paths returned by `RTE_EAL_DRIVER_PATH_FOREACH(driver_path, true)`,
     - Does not contain directory-based / non-`from_cmdline` driver paths,
     - Preserves the order of the original `--driver-path` arguments.
   - Verifies behavior when `rte_eal_driver_path_count(true)` returns:
     - `0` (no `--driver-path` added),
     - `1`,
     - `>1`.

3. In those tests, explicitly validate that:
   - The iterator APIs (`rte_eal_driver_path_count(true)` and `RTE_EAL_DRIVER_PATH_FOREACH(..., true)`) return the expected set of paths.
   - The rebuilt `--driver-path=` arguments in the child’s `argv` are obtained exclusively via the above helper, not by manually pushing flags.

These additional changes will exercise both the iterator APIs and the helper that reconstructs `--driver-path` arguments, satisfying the review comment.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +758 to +766
rte_eal_driver_path_next(const char *start, bool cmdline_only)
{
struct shared_driver *solib;

if (start == NULL) {
solib = TAILQ_FIRST(&solib_list);
} else {
/* Find the current entry based on the name string */
TAILQ_FOREACH(solib, &solib_list, next) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Pointer comparison for start requires callers to pass the exact returned pointer, which is a subtle contract.

This lookup assumes start is the exact same pointer as one of the stored solib->name values (i.e., a value previously returned by this function), not just an equal string. That’s safe with RTE_EAL_DRIVER_PATH_FOREACH, but easy to misuse for other callers. If this is meant as a public/ABI-stable API, consider either documenting that start must be a value previously returned by this function, or switching to an opaque iterator type (handle/index) instead of const char * to make correct use clearer.

Suggested implementation:

/*
 * Iterate over registered shared drivers.
 *
 * The iterator is driven by the return value of this function:
 * - To start iteration, callers must pass start == NULL.
 * - To advance, callers must pass as start a pointer value that was
 *   previously returned by this function.
 *
 * Note: the lookup below compares the 'start' argument to the stored
 * solib->name using pointer equality, not strcmp(). This is intentional
 * to keep the API ABI-stable without introducing an explicit iterator
 * handle type, but it means arbitrary strings must not be passed here.
 *
 * The RTE_EAL_DRIVER_PATH_FOREACH macro is implemented to respect this
 * contract and should be preferred by most callers.
 */
RTE_EXPORT_SYMBOL(rte_eal_driver_path_next)
const char *
rte_eal_driver_path_next(const char *start, bool cmdline_only)
	} else {
		/*
		 * Find the current entry based on the previously returned
		 * name pointer. This relies on pointer identity, not on
		 * string comparison, so 'start' must be a value returned
		 * by this function (or by RTE_EAL_DRIVER_PATH_FOREACH).
		 */
		TAILQ_FOREACH(solib, &solib_list, next) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants