DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Prudvi Deti <prudvi.deti@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Ori Kam <orika@nvidia.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Nirint Shah <nirint.shah@intel.com>
Subject: [RFC v3 0/7] regex/hs: introduce Hyperscan regex PMD
Date: Wed, 16 Sep 2026 17:56:57 +0530	[thread overview]
Message-ID: <20260916122738.2176589-1-prudvi.deti@intel.com> (raw)
In-Reply-To: <20260910080136.1790851-1-prudvi.deti@intel.com>

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


  parent reply	other threads:[~2026-09-16 12:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  5:35 [RFC 0/7] regex/hs: introduce Hyperscan regex PMD Prudvi Deti
2026-08-28  5:35 ` [RFC 1/7] regex/hs: add driver skeleton and build integration Prudvi Deti
2026-08-28  5:35 ` [RFC 2/7] regex/hs: add device configure and queue pair setup Prudvi Deti
2026-08-28  5:35 ` [RFC 3/7] regex/hs: add rule database update and compilation Prudvi Deti
2026-08-28  5:35 ` [RFC 4/7] regex/hs: add enqueue and dequeue burst paths Prudvi Deti
2026-08-28  5:35 ` [RFC 5/7] regex/hs: add per-queue-pair extended statistics Prudvi Deti
2026-08-28  5:35 ` [RFC 6/7] regex/hs: add start stop close and device dump Prudvi Deti
2026-08-28  5:35 ` [RFC 7/7] regex/hs: add Hyperscan compile flag support Prudvi Deti
2026-08-28 16:34 ` [RFC 0/7] regex/hs: introduce Hyperscan regex PMD Stephen Hemminger
2026-09-10  8:00 ` [RFC v2 " Prudvi Deti
2026-09-10  8:00   ` [RFC v2 1/7] regex/hs: add driver skeleton and build integration Prudvi Deti
2026-09-10  8:00   ` [RFC v2 2/7] regex/hs: add device configure and queue pair setup Prudvi Deti
2026-09-10  8:00   ` [RFC v2 3/7] regex/hs: add rule database update and compilation Prudvi Deti
2026-09-10  8:00   ` [RFC v2 4/7] regex/hs: add enqueue and dequeue burst paths Prudvi Deti
2026-09-10  8:00   ` [RFC v2 5/7] regex/hs: add per-queue-pair extended statistics Prudvi Deti
2026-09-10  8:00   ` [RFC v2 6/7] regex/hs: add start stop close and device dump Prudvi Deti
2026-09-10  8:00   ` [RFC v2 7/7] regex/hs: add Hyperscan compile flag support Prudvi Deti
2026-09-16 12:26   ` Prudvi Deti [this message]
2026-09-16 12:26     ` [RFC v3 1/7] regex/hs: add driver skeleton and build integration Prudvi Deti
2026-09-16 12:26     ` [RFC v3 2/7] regex/hs: add device configure and queue pair setup Prudvi Deti
2026-09-16 12:27     ` [RFC v3 3/7] regex/hs: add rule database update and compilation Prudvi Deti
2026-09-16 12:27     ` [RFC v3 4/7] regex/hs: add enqueue and dequeue burst paths Prudvi Deti
2026-09-16 12:27     ` [RFC v3 5/7] regex/hs: add per-queue-pair extended statistics Prudvi Deti
2026-09-16 12:27     ` [RFC v3 6/7] regex/hs: add start stop close and device dump Prudvi Deti
2026-09-16 12:27     ` [RFC v3 7/7] regex/hs: add Hyperscan compile flag support Prudvi Deti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260916122738.2176589-1-prudvi.deti@intel.com \
    --to=prudvi.deti@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=nirint.shah@intel.com \
    --cc=orika@nvidia.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox