On Wed, 21 Jan 2026 00:24:17 +0100 Lukas Sismis <[email protected]> wrote:
> External applications like Suricata IDS [1] need to express hardware filtering > rules in a consistent, human-readable format. Rather than inventing custom > syntax, reusing testpmd's well-tested flow grammar provides immediate > compatibility with existing documentation and user knowledge. > > Note: This library provides only one way to create rte_flow structures. > Applications can also construct rte_flow_attr, rte_flow_item[], and > rte_flow_action[] directly in C code. > > Design > ------ > The library (librte_flow_parser) exposes the following APIs: > - rte_flow_parser_parse_attr_str(): Parse attributes only > - rte_flow_parser_parse_pattern_str(): Parse patterns only > - rte_flow_parser_parse_actions_str(): Parse actions only > > Testpmd is updated to use the library, ensuring a single > maintained parser implementation. > > Testing and Demo > ------- > - Functional tests in dpdk-test > - Example application: examples/flow_parsing > > Changes > ------- > > v4: > - ethdev changes in separate commit > - library's public API only exposes attribute, pattern and action parsing, > while the full command parsing is kept internal for testpmd usage only. > - Addressed Stephen's comments from V3 > - dpdk-test now have tests focused on public and internal library functions > > v3: > - Add more functional tests > - More concise MAINTAINERS updates > - Updated license headers > - A thing to note: When playing with flow commands, I figured, some may use > non-flow commands, such as raw decap/encap, policy meter and others. > Flow parser library itself now supports `set` command to set e.g. the decap/ > encap parameters, as the flow syntax only supports defining the index of the > encap/decap configs. The library, however, does not support e.g. `create` > command to create policy meters, as that is just an ID and it can be created > separately using rte_meter APIs. > > [1] https://github.com/OISF/suricata/pull/13950 > There seem to be lot of build failures in CI for this version.

