[RFC v3 0/7] regex/hs: introduce Hyperscan regex PMD
Prudvi Deti
prudvi.deti at intel.com
Wed Sep 16 14:26:57 CEST 2026
This RFC series adds a new regexdev PMD based on Hyperscan.
Goal: provide a software regex PMD for environments without regex HW,
while keeping compatibility with the standard ``rte_regexdev`` API.
The PMD is a virtual device, created with ``--vdev=regex_hs`` at EAL
init.
The series introduces:
- a new vdev driver under ``drivers/regex/hs``
- device and queue pair configuration, start/stop/close lifecycle,
and device dump support
- rule database update, compile+activate, import/export of serialized
Hyperscan databases
- enqueue/dequeue burst paths with per-queue-pair scratch usage and
per-queue-pair extended statistics (enqueued/dequeued/matches)
- PMD-private rule flag mappings for common Hyperscan compile options
(singlematch, prefilter, SOM-leftmost, combination, quiet)
Behavior notes relevant for review:
- per-op match counters are bounded by API field width
(``nb_matches``/``nb_actual_matches`` are ``uint16_t``)
- payload size exposed through regexdev is ``max_payload_size = 65535``
bytes, while Hyperscan block mode itself supports larger scan buffers
- queue pairs are intended for single-thread ownership (SPSC model)
with dedicated scratch per queue pair
Documentation, feature matrix integration, meson integration, and
maintainers metadata are included.
Prudvi Deti (7):
regex/hs: add driver skeleton and build integration
regex/hs: add device configure and queue pair setup
regex/hs: add rule database update and compilation
regex/hs: add enqueue and dequeue burst paths
regex/hs: add per-queue-pair extended statistics
regex/hs: add start stop close and device dump
regex/hs: add Hyperscan compile flag support
---
v3: Addressed AI review of the driver skeleton patch:
* Fixed a resource ordering issue in hs_regex_dev_create(): the device
private data is now allocated before rte_regexdev_register(), so a
registration failure cannot leave a registered device with no cleanup
path, and a private-data allocation failure no longer needs to
unregister the device.
v2: Addressed AI reviews with the following changes:
* Fixed a queue-pair resource leak on reconfigure (stale scratch and
operation ring were not freed before reallocation).
* Rejected unsupported device and queue-pair configuration flags
instead of silently ignoring them.
* Fixed a rule-id hash name collision between multiple device
instances by including the device id in the hash name.
* Validated rule operations and fixed rule-id hash/array consistency
on add and remove failures.
* Cleared the compiled-database state on a failed rule database
import so a partially failed import cannot be reported as started.
* Implemented stop-on-match request handling and saturated the
per-op actual-match count instead of wrapping past 65535.
* Fixed device info to report the backing vdev device instead of NULL.
* Moved the pending-operation warning so it fires on both explicit
and implicit stop.
* Documented the 20-bit match-result rule-id limit and the
unsupported high-priority match request mode.
* Capped dev_dump() rule listing with a summary line for large rule
counts instead of printing every rule unconditionally.
* Documented that rule_db_export()'s output buffer has no alignment
requirement.
* Documented building Hyperscan 5.4.2 from source as a prerequisite.
.mailmap | 1 +
MAINTAINERS | 6 +
doc/guides/regexdevs/features/hs.ini | 8 +
doc/guides/regexdevs/hs.rst | 235 ++++
doc/guides/regexdevs/index.rst | 1 +
doc/guides/rel_notes/release_26_11.rst | 19 +
drivers/regex/hs/hs_regex.c | 1447 ++++++++++++++++++++++++
drivers/regex/hs/hs_regex.h | 101 ++
drivers/regex/hs/meson.build | 19 +
drivers/regex/meson.build | 1 +
10 files changed, 1838 insertions(+)
create mode 100644 doc/guides/regexdevs/features/hs.ini
create mode 100644 doc/guides/regexdevs/hs.rst
create mode 100644 drivers/regex/hs/hs_regex.c
create mode 100644 drivers/regex/hs/hs_regex.h
create mode 100644 drivers/regex/hs/meson.build
--
2.43.0
More information about the dev
mailing list