<div dir="auto">Hi Stephen,<div dir="auto"><br></div><div dir="auto">Thanks for the current and earlier feedback. I'll adjust accordingly and send the patches back.</div><div dir="auto"><br></div><div dir="auto">Lukas</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Jan 13, 2026, 18:46 Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 6 Jan 2026 16:38:30 +0100<br>
Lukas Sismis <<a href="mailto:sismis@dyna-nic.com" target="_blank" rel="noreferrer">sismis@dyna-nic.com</a>> wrote:<br>
<br>
> This series extracts the testpmd flow CLI parser into a reusable library,<br>
> enabling external applications to parse rte_flow rules using testpmd syntax.<br>
> <br>
> Motivation<br>
> ----------<br>
> External applications like Suricata IDS [1] need to express hardware filtering<br>
> rules in a consistent, human-readable format. Rather than inventing custom<br>
> syntax, reusing testpmd's well-tested flow grammar provides immediate<br>
> compatibility with existing documentation and user knowledge.<br>
> <br>
> Note: This library provides only one way to create rte_flow structures.<br>
> Applications can also construct rte_flow_attr, rte_flow_item[], and<br>
> rte_flow_action[] directly in C code.<br>
> <br>
> Design<br>
> ------<br>
> The library (librte_flow_parser) exposes:<br>
> - rte_flow_parser_parse(): Parse command strings into structured output<br>
> - rte_flow_parser_parse_attr_str(): Parse attributes only<br>
> - rte_flow_parser_parse_pattern_str(): Parse patterns only<br>
> - rte_flow_parser_parse_actions_str(): Parse actions only<br>
> <br>
> Testpmd is updated to use the shared library, ensuring a single<br>
> maintained parser implementation.<br>
> <br>
> Testing<br>
> -------<br>
> - Unit tests: flow_parser_autotest, flow_parser_helpers_autotest<br>
> - Example application: examples/flow_parsing<br>
> - All existing testpmd flow commands work unchanged<br>
> <br>
> <br>
> <br>
> [1] <a href="https://github.com/OISF/suricata/pull/13950" rel="noreferrer noreferrer" target="_blank">https://github.com/OISF/suricata/pull/13950</a><br>
> <br>
> Lukas Sismis (7):<br>
> flow_parser: add shared parser library<br>
> app/testpmd: integrate shared flow parser library<br>
> examples/flow_parsing: add flow parser demo<br>
> test: add flow parser unit tests<br>
> doc: add flow parser library maintainers<br>
> dts: fix invalid f-string syntax in testpmd API<br>
> cmdline: include stddef.h before defining offsetof<br>
> <br>
> .mailmap | 2 +-<br>
> MAINTAINERS | 3 +<br>
> app/test-pmd/cmd_flex_item.c | 41 +-<br>
> app/test-pmd/cmdline.c | 254 +-<br>
> app/test-pmd/config.c | 112 +-<br>
> app/test-pmd/flow_parser.c | 406 +<br>
> app/test-pmd/flow_parser.h | 8 +<br>
> app/test-pmd/flow_parser_cli.c | 149 +<br>
> app/test-pmd/meson.build | 5 +-<br>
> app/test-pmd/testpmd.c | 4 +<br>
> app/test-pmd/testpmd.h | 126 +-<br>
> app/test/meson.build | 1 +<br>
> app/test/test_flow_parser.c | 226 +<br>
> doc/guides/prog_guide/flow_parser_lib.rst | 140 +<br>
> doc/guides/prog_guide/index.rst | 1 +<br>
> doc/guides/rel_notes/release_26_03.rst | 9 +<br>
> dts/api/testpmd/__init__.py | 8 +-<br>
> examples/flow_parsing/main.c | 345 +<br>
> examples/flow_parsing/meson.build | 11 +<br>
> examples/meson.build | 1 +<br>
> lib/cmdline/cmdline_parse.h | 2 +<br>
> lib/ethdev/rte_ethdev.c | 107 +<br>
> lib/ethdev/rte_ethdev.h | 60 +<br>
> lib/flow_parser/meson.build | 6 +<br>
> .../flow_parser/rte_flow_parser.c | 10774 ++++++++--------<br>
> lib/flow_parser/rte_flow_parser.h | 1304 ++<br>
> lib/meson.build | 2 +<br>
> 27 files changed, 8600 insertions(+), 5507 deletions(-)<br>
> create mode 100644 app/test-pmd/flow_parser.c<br>
> create mode 100644 app/test-pmd/flow_parser.h<br>
> create mode 100644 app/test-pmd/flow_parser_cli.c<br>
> create mode 100644 app/test/test_flow_parser.c<br>
> create mode 100644 doc/guides/prog_guide/flow_parser_lib.rst<br>
> create mode 100644 examples/flow_parsing/main.c<br>
> create mode 100644 examples/flow_parsing/meson.build<br>
> create mode 100644 lib/flow_parser/meson.build<br>
> rename app/test-pmd/cmdline_flow.c => lib/flow_parser/rte_flow_parser.c (57%)<br>
> create mode 100644 lib/flow_parser/rte_flow_parser.h<br>
> <br>
<br>
Looks OK to me, so asked AI for second opinion.<br>
It saw some things that do need to be fixed.<br>
<br>
<br>
# DPDK Patch Review: Flow Parser Library (v2)<br>
<br>
**Series:** `[PATCH v2 0/7]` flow_parser: add shared parser library <br>
**Author:** Lukas Sismis <<a href="mailto:sismis@dyna-nic.com" target="_blank" rel="noreferrer">sismis@dyna-nic.com</a>> <br>
**Date:** Tue, 6 Jan 2026 <br>
**Reviewer:** AI Code Review Tool<br>
<br>
---<br>
<br>
## Series Overview<br>
<br>
This patch series introduces `librte_flow_parser` as an optional, experimental library that exposes the testpmd flow CLI parser as a reusable component. The series is well-structured:<br>
<br>
| Patch | Description |<br>
|-------|-------------|<br>
| 1/7 | Core library implementation (~15K lines) |<br>
| 2/7 | testpmd integration - removes embedded parser, uses library |<br>
| 3/7 | Example application demonstrating library usage |<br>
| 4/7 | Unit tests for the parser |<br>
| 5/7 | MAINTAINERS and .mailmap updates |<br>
| 6/7 | DTS f-string syntax fix (tangential bugfix) |<br>
| 7/7 | cmdline stddef.h include fix (tangential bugfix) |<br>
<br>
---<br>
<br>
## Errors (Must Fix)<br>
<br>
### 1. Missing Copyright Lines in New Files<br>
<br>
**Severity:** Error <br>
**Rule:** SPDX license identifier must be followed by copyright notice <br>
**Location:** Multiple files<br>
<br>
Per DPDK guidelines, every source file must have SPDX identifier followed by copyright:<br>
<br>
**`lib/flow_parser/rte_flow_parser.h`** (Patch 1):<br>
```c<br>
/* SPDX-License-Identifier: BSD-3-Clause */<br>
#ifndef RTE_FLOW_PARSER_H<br>
```<br>
Missing: `Copyright(c) 2026 Dyna-NIC` line after SPDX<br>
<br>
**`app/test/test_flow_parser.c`** (Patch 4):<br>
```c<br>
/* SPDX-License-Identifier: BSD-3-Clause */<br>
<br>
#include <stdint.h><br>
```<br>
Missing: Copyright line after SPDX<br>
<br>
**Recommended fix:**<br>
```c<br>
/* SPDX-License-Identifier: BSD-3-Clause<br>
* Copyright(c) 2026 Dyna-NIC<br>
*/<br>
```<br>
<br>
---<br>
<br>
### 2. Subject Lines Exceed 60 Characters<br>
<br>
**Severity:** Error <br>
**Rule:** Subject line maximum 60 characters <br>
**Location:** Patches 2 and 7<br>
<br>
| Patch | Length | Subject |<br>
|-------|--------|---------|<br>
| 2/7 | **64** | `[PATCH v2 2/7] app/testpmd: integrate shared flow parser library` |<br>
| 7/7 | **65** | `[PATCH v2 7/7] cmdline: include stddef.h before defining offsetof` |<br>
<br>
**Recommended fixes:**<br>
- Patch 2: `app/testpmd: use shared flow parser library` (47 chars with prefix)<br>
- Patch 7: `cmdline: include stddef.h for offsetof` (54 chars with prefix)<br>
<br>
---<br>
<br>
## Warnings (Should Fix)<br>
<br>
### 3. Implicit Pointer/Integer Comparisons<br>
<br>
**Severity:** Warning <br>
**Rule:** Compare pointers explicitly with NULL, integers with zero <br>
**Location:** `lib/flow_parser/rte_flow_parser.c`<br>
<br>
Multiple instances use `!ptr` instead of `ptr == NULL`:<br>
<br>
```c<br>
// Current (non-compliant):<br>
if (!data)<br>
if (!ipv4->version_ihl)<br>
if (!ops || !ops->port_validate)<br>
if (!conf->select_ipv4)<br>
<br>
// Should be:<br>
if (data == NULL)<br>
if (ipv4->version_ihl == 0)<br>
if (ops == NULL || ops->port_validate == NULL)<br>
if (conf->select_ipv4 == 0)<br>
```<br>
<br>
Affected locations include lines: 767, 783, 943, 999, 1012, 1053, 1091, 1104, 1167, 1381, 1390, 1393, 1658, 1668, 1678, 1688, 1699, 1709, 1720, 1730, and many more.<br>
<br>
---<br>
<br>
### 4. Missing Newline at End of File (Cross-Patch Fix)<br>
<br>
**Severity:** Warning <br>
**Rule:** Files must end with a newline <br>
**Location:** `app/test-pmd/flow_parser.h`<br>
<br>
Patch 2 creates this file without a trailing newline:<br>
```<br>
-#endif /* _TESTPMD_FLOW_PARSER_H_ */<br>
\ No newline at end of file<br>
```<br>
<br>
Patch 3 fixes it, but each commit should compile independently. The fix should be in Patch 2.<br>
<br>
---<br>
<br>
### 5. MAINTAINERS Entry Missing Explicit Maintainer<br>
<br>
**Severity:** Warning <br>
**Rule:** New subsystems should have release notes and maintainer entries <br>
**Location:** `MAINTAINERS`<br>
<br>
The update adds files to the Flow API section:<br>
```<br>
F: lib/flow_parser/<br>
F: app/test-pmd/flow_parser.c<br>
F: doc/guides/prog_guide/flow_parser_lib.rst<br>
```<br>
<br>
However, no explicit `M:` (maintainer) entry is added. Consider adding:<br>
```<br>
Flow Parser Library<br>
M: Lukas Sismis <<a href="mailto:sismis@dyna-nic.com" target="_blank" rel="noreferrer">sismis@dyna-nic.com</a>><br>
F: lib/flow_parser/<br>
F: doc/guides/prog_guide/flow_parser_lib.rst<br>
```<br>
<br>
---<br>
<br>
## Info (Consider)<br>
<br>
### 6. Unrelated Fixes Bundled in Series<br>
<br>
Patches 6/7 and 7/7 fix issues unrelated to the flow parser:<br>
- Patch 6: DTS f-string syntax fix<br>
- Patch 7: cmdline stddef.h include<br>
<br>
These should ideally be separate patch submissions with their own `Fixes:` tags if they address regressions. If they're prerequisites for the flow parser, this should be documented.<br>
<br>
---<br>
<br>
### 7. Code Structure Positive Notes<br>
<br>
The series demonstrates good practices:<br>
<br>
✓ New APIs marked as `__rte_experimental` (correctly on separate lines in headers) <br>
✓ Release notes updated (`doc/guides/rel_notes/release_26_03.rst`) <br>
✓ Documentation added (`doc/guides/prog_guide/flow_parser_lib.rst`) <br>
✓ Unit tests added (`app/test/test_flow_parser.c`) <br>
✓ Example application provided (`examples/flow_parsing/`) <br>
✓ Proper use of `RTE_EXPORT_EXPERIMENTAL_SYMBOL` <br>
✓ Thread-local storage for helper functions <br>
✓ Commit messages don't start with "It"<br>
<br>
---<br>
<br>
## Checklist Summary<br>
<br>
| Category | Status |<br>
|----------|--------|<br>
| SPDX + Copyright | ❌ Missing copyright in 2 files |<br>
| Subject line ≤60 chars | ❌ 2 patches exceed limit |<br>
| Subject lowercase (except acronyms) | ✓ |<br>
| Correct component prefix | ✓ |<br>
| Body ≤75 chars | ✓ |<br>
| Signed-off-by present | ✓ |<br>
| __rte_experimental placement | ✓ |<br>
| New APIs experimental | ✓ |<br>
| Release notes | ✓ |<br>
| Documentation | ✓ |<br>
| Tests added | ✓ |<br>
| Explicit comparisons | ❌ Multiple implicit comparisons |<br>
| Each commit compiles | ⚠️ Missing newline issue |<br>
<br>
---<br>
<br>
## Recommended Actions for v3<br>
<br>
1. **Add copyright lines** to `rte_flow_parser.h` and `test_flow_parser.c`<br>
2. **Shorten subject lines** for patches 2 and 7<br>
3. **Fix newline** at end of `flow_parser.h` in patch 2 (not patch 3)<br>
4. **Consider** adding explicit `M:` entry in MAINTAINERS<br>
5. **Consider** splitting patches 6-7 into separate series or adding dependency notes<br>
6. **Consider** converting implicit comparisons to explicit style (lower priority, many occurrences)<br>
<br>
---<br>
<br>
*Review generated based on DPDK AGENTS.md guidelines*<br>
<br>
<br>
</blockquote></div>