Conversation
- TrexTestRun: optional pcap argument restricting TRex traffic to a single profile pcap (set_pcap on BaseTrexClientManager) - STF profile is rebuilt and re-uploaded when the pcap changes - add generated RSS test pcaps (flow A, flows B/C/D, reverse flow rA) - move performance test profiles under traffic_profiles/performance_tests/ and switch tests to absolute imports
TRex infrastructure for functional tests that need exact packet counts per replayed pcap: * TrexTestRun.execute(pcap=, single_pass=) - select the pcap and optionally disable the duration fallback per execution, so the traffic volume is bounded by the pcap content, not by time * set_props accepts duration=None -> STL single-pass: every pcap is transmitted exactly once instead of looping for a duration; ASTF and STF still require a duration (explicit guards) * _selectable_pcaps snapshot taken at the end of __init__ so that set_pcap can re-select any profile pcap later, not just the ones remaining after the previous narrowing-down
suricata_conf_file now falls back to a suricata.yaml placed next to the test file when no --suricata-cfg is given, letting a test pin capture-specific settings (e.g. DPDK queue/RSS config) without a dedicated command-line path.
Verify RSS flow-to-queue placement on a multi-queue DPDK interface (functional_tests/rss/). The test is parametrized by stage so each stage is a separate pytest node and runs in isolation: * stage 1: flow A on exactly one queue * stage 2: flows B/C/D spread over multiple queues * stage 3: reversed flow rA (exact tuple mirror of A) shares A's queue - symmetric RSS hash; A's reference queue is learned by an inline flow-A pre-pass, so the stage does not depend on stages 1/2 having run in the same session Placement is asserted on per-worker decoder counts from eve-stats (queue id = worker name minus interface suffix) with a +/-32 packet tolerance. Uses a test-local suricata.yaml (4 RX queues, interrupt-mode off, rss-hash-functions 0x3ffc = L3+L4 hash types) and the new RssProfile (STL, all 3 pcaps at multiplier weight 1). The B/C/D pcap carries distinct RFC-5737 flow tuples so the queue spread is unambiguous.
Deterministic scapy-based generator backing the three test pcaps, in the style of the MTU generator: * flow A - single fixed 5-tuple, index-tagged payloads (b'A0000042') * flows B/C/D - three RFC-5737 tuples interleaved by timestamp, 1400-byte indexed payloads * flow rA - the exact tuple mirror of A (symmetric-hash stage) Verified against the committed pcaps: packet counts, direction splits, flag sequences, payload tags, mirror property. MACs are placeholders (TRex rewrites the dst MAC at send time); timestamps are deterministic (STL pacing comes from ipg_usec, not the pcap).
There was a problem hiding this comment.
🟡 Changes recommended
The new set_pcap VLAN-tag matching logic does not actually support VLAN-tagged requests as documented, which can break the advertised API behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an RSS (Receive Side Scaling) functional test that verifies DPDK flow-to-queue placement by replaying stage-specific pcaps via TRex (single-pass STL), reading per-worker counters from eve-stats.json, and allowing tests to use a test-local suricata.yaml for better isolation.
Changes:
- Added
functional_tests/rss/test, supporting Suricata config, and a pcap-generation utility. - Added an RSS-specific TRex profile and extended the TRex client manager to support per-pcap selection and STL single-pass (
duration=None) replay. - Updated config handling to auto-pick a test-local
suricata.yamlwhen present.
File summaries
| File | Description |
|---|---|
| util/test_runner.py | Extends test runner to allow selecting a pcap and running single-pass traffic cycles. |
| README.md | Documents the new RSS functional test and how to run stages. |
| functional_tests/rss/test_settings.json | Added test settings placeholder/file (currently empty). |
| functional_tests/rss/test_rss.py | New staged RSS placement test driven by per-worker eve-stats.json counters. |
| functional_tests/rss/suricata.yaml | Test-local Suricata config enabling multi-queue DPDK + RSS hash settings for the RSS test. |
| functional_tests/rss/generate_pcaps.py | Script to deterministically generate the pcaps used by the RSS test. |
| conftest.py | Uses a test-local suricata.yaml when present to improve test isolation. |
| assets/trex/traffic_profiles/trex_client_manager.py | Adds pcap re-selection (set_pcap) and supports STL single-pass replay via duration=None. |
| assets/trex/traffic_profiles/pcaps/rss_flows_bcd_6000p.pcap | New RSS test pcap (Git LFS pointer). |
| assets/trex/traffic_profiles/pcaps/rss_flow_ra_500p.pcap | New RSS test pcap (Git LFS pointer). |
| assets/trex/traffic_profiles/pcaps/rss_flow_a_1000p.pcap | New RSS test pcap (Git LFS pointer). |
| assets/trex/traffic_profiles/functional_tests/rss_profile/profile.py | New TRex profile wiring the RSS test pcaps into a reusable profile. |
Review details
Suppressed comments (1)
util/test_runner.py:99
- TrexTestRun overrides still annotate
duration: int, but in STL single-pass mode duration is intentionally None. Align these overrides with the updated TestRun/trex_client_manager API to avoid misleading signatures and type-checker errors.
def _before_traffic(
self, multiplier: float, duration: int, pcap: str | None = None
):
if pcap is not None:
self.trex_client.set_pcap(pcap)
- Files reviewed: 11/12 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| entry = Path(pcap_entry) | ||
| req = Path(requested) | ||
| if entry.name == req.name: | ||
| return True | ||
| return entry.stem.startswith(f"{req.stem}.vlan") | ||
|
|
There was a problem hiding this comment.
Fixed so it matches the documentation (intented) way.
| duration: int | None = None | ||
| _stf_config_path: Path | None = None | ||
| _selected_pcap: str | None = None | ||
| _selectable_pcaps: PcapList | None = None |
There was a problem hiding this comment.
Annotation bug, but with no impact. Still addressed.
| interface. The test is parametrized by stage so a single stage can be | ||
| selected and run in isolation via its node ID, e.g. | ||
| `functional_tests/rss/test_rss.py::test_rss[2]`: |
There was a problem hiding this comment.
Documentational oversight, fixed.
| def _before_traffic( | ||
| self, multiplier: float, duration: int, pcap: str | None = None | ||
| ): | ||
| """Prepare TRex before suricata starts (select pcap, reset, set_props).""" | ||
|
|
||
| def _run_traffic(self, multiplier: float, duration: int, run_info: RunInfo): |
There was a problem hiding this comment.
Potential bug, if the code would be using duration for some calculations. Preemptively fixed.
|
Seems like a good direction! Thank you. |
|
I am aware that v2 will be needed. It will not test the local suricata.yaml, but take "default_suricata.yaml". @matyas7dub other tests use that one, right? Edit: Grammar |
|
I have looked into the functional test PRs and made a branch on my fork, which I would like to merge before these get implemented, because the changes should make it easier to implement new behavior for TRex. It also includes other improvements which try to simplify maintenance. I will make multiple PRs out of it later, but you can already look at it and give feedback :) |
This pull request introduces a new functional test for RSS (Receive Side Scaling) flow-to-queue placement on DPDK interfaces, along with supporting infrastructure and documentation updates. The changes include a new test profile, pcap files, enhancements to the TRex traffic profile manager, and improved configuration handling for test-local Suricata YAML files.
Key changes:
RSS Functional Test and Documentation
functional_tests/rss/with supporting documentation inREADME.md, describing test stages, usage, and notes about traffic replay and configuration.TRex Traffic Profile and PCAPs
RssProfileinassets/trex/traffic_profiles/functional_tests/rss_profile/profile.pyto manage RSS-specific traffic replay, referencing three new pcap files:rss_flow_a_1000p.pcaprss_flows_bcd_6000p.pcaprss_flow_ra_500p.pcapEnhancements to TRex Client Manager
BaseTrexClientManagerintrex_client_manager.pyto support:set_pcapmethod and supporting logic.duration=Nonefor single-pass traffic (replay each pcap exactly once), with appropriate handling inset_props,prepare, andrunmethods.Test Configuration Improvements
conftest.pyto automatically use a test-localsuricata.yamlif present, improving test isolation and reproducibility.Minor Updates
These changes collectively enable precise, stage-selectable functional testing of RSS queue placement with clear configuration and traffic replay control.