[RFC 0/2] rte_flow API unit testing via null PMD
Stephen Hemminger
stephen at networkplumber.org
Mon Feb 9 21:05:41 CET 2026
The rte_flow API is an important DPDK interface but has no dedicated
unit tests. This series adds stub flow ops to the null PMD and a test
suite that exercises the public API without requiring hardware.
Patch 1 adds flow_ops to net_null that validate input structure and
reject all rules with specific error types and cause pointers.
Patch 2 adds flow_api_autotest with 31 test cases covering basic
operations and error handling.
Limitations:
- Only negative-path behaviour is tested since the null PMD rejects
all rules. Positive-path coverage requires a PMD that installs
flows.
- The async template API, meters, and indirect actions can be
covered with additional stubs in a follow-up series.
- Aged flow testing requires a PMD that creates real rules and is
outside the scope of the null PMD stub approach.
The test code and null PMD stub were generated with AI assistance
(Claude) and reviewed/edited by the author.
Stephen Hemminger (2):
net/null: add stub flow ops for rte_flow API testing
app/test: add rte_flow API unit tests
app/test/meson.build | 1 +
app/test/test_flow_api.c | 1015 +++++++++++++++++++++++++++++++
drivers/net/null/meson.build | 6 +-
drivers/net/null/null_flow.c | 237 ++++++++
drivers/net/null/null_flow.h | 12 +
drivers/net/null/rte_eth_null.c | 12 +
6 files changed, 1282 insertions(+), 1 deletion(-)
create mode 100644 app/test/test_flow_api.c
create mode 100644 drivers/net/null/null_flow.c
create mode 100644 drivers/net/null/null_flow.h
--
2.51.0
More information about the dev
mailing list