Skip to content

acl core (DON'T REVIEW ME YET)#1471

Draft
daniel-noland wants to merge 3 commits intomainfrom
pr/daniel-noland/acl-core
Draft

acl core (DON'T REVIEW ME YET)#1471
daniel-noland wants to merge 3 commits intomainfrom
pr/daniel-noland/acl-core

Conversation

@daniel-noland
Copy link
Copy Markdown
Collaborator

🚧 DON'T REVIEW ME YET I'M IN MAJOR FLUX 🚧

daniel-noland and others added 3 commits April 15, 2026 16:44
Add the dataplane-acl crate providing a type-safe ACL rule builder,
compiled classifier, and match-action classification engine.

Core types:
- AclRuleBuilder<T, M> with typestate enforcement of protocol layer
  ordering via Within<T>/Install<T>/Blank traits
- FieldMatch<T> {Ignore, Select} with matches(predicate) combinator
  and as_option() for Option interop
- ActionSequence (Vec<Step> + Fate) with metadata accessors
  (mark, meta, tag, flag)
- Classifier<M> with unified Linear/Cascade dispatch
- ClassifyOutcome: Matched(&ActionSequence) | Default(Fate)
- Metadata trait with associated Values type

Match types:
- ExactMatch<T>, MaskedMatch<T> with private fields (immutability
  for hash table safety) and const fn accessors
- Uses lpm crate's Ipv4Prefix/Ipv6Prefix (no duplication)
- Uses std::ops::RangeInclusive for port ranges (80..=443 syntax)

Compiler passes:
- FieldSignature bitset and rule grouping by signature
- Pairwise overlap analysis using lpm's IpPrefixColliding
- Cascade compiler with BackendCapabilities and trap rule insertion
- Category-based rule organization
- Two-phase update planning (Reitblatt delta+base cascade)

Testing:
- 63 unit tests across all modules
- 3 bolero property tests (deterministic classification, update
  consistency, large table)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add dpdk/src/acl/ providing safe Rust wrappers around the DPDK ACL
library:

- AclContext<N, State> -- typestate context (Configuring -> Built)
- Rule<N> -- #[repr(C)] rule with compile-time field count
- AclClassifierBuilder / AclClassifier -- runtime-sized alternative
  that avoids const-generic N at the API boundary
- AclField, FieldDef, AclBuildConfig, ClassifyAlgorithm
- Comprehensive error types

Also enables the DPDK ACL library in the nix build and adds
rte_acl.h to the dpdk-wrapper header for bindgen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User-facing API:
  let classifier = DpdkAclClassifier::compile(&table)?;
  let outcome = classifier.classify(&headers);

Internals:
- Field mapping from ACL signatures to DPDK FieldDef arrays
- Rule translation with 2-byte field promotion (lone 2B fields
  promoted to 4B for DPDK's 4-byte trie traversal)
- Category-aware compilation merging signature groups into a
  single DPDK context via RTE_ACL categories
- Compact input buffer assembly from parsed headers
- Cross-category priority resolution

Tests (41 total):
- 3 bolero fuzz tests
- 11 boundary tests (priority limits, scale, edge cases)
- 5 signature grouping E2E tests
- 6 property tests against linear classifier
- 3 facade tests with ClassifyOutcome output
- 10 unit tests + 3 integration tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@daniel-noland daniel-noland added the dont-merge Do not merge this Pull Request label Apr 15, 2026
@daniel-noland daniel-noland self-assigned this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dont-merge Do not merge this Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant