Skip to content
Draft

stats #1774

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d3fbe98
fix(stats): Stop reporting a rate that is negative, or not a number
daniel-noland Aug 25, 2026
d13b8b9
test(interface-manager): Say what spec-to-interface equality means
daniel-noland Aug 25, 2026
36c4b8b
fix(stats): Read the rate window in the order its samples arrived
daniel-noland Aug 25, 2026
886bd62
test(dataplane): Read the cli while the dataplane forwards and reconf…
daniel-noland Aug 25, 2026
c2ebc2c
test(stats): Check the published rate against the load that produced it
daniel-noland Aug 25, 2026
993e383
test(stats): Check the stencil against arithmetic that is obviously r…
daniel-noland Aug 25, 2026
5253702
fix(stats): Open the startup batches as consecutive windows
daniel-noland Aug 25, 2026
a860d67
test(stats): Fuzz the counter ledger against skewed arrival times
daniel-noland Aug 25, 2026
c9a269b
test(stats): Draw the smoothing windows the collector actually produces
daniel-noland Aug 25, 2026
06403f0
fix(stats): Retire a metric series when its name stops being current
daniel-noland Aug 25, 2026
6899d6a
perf(stats): Spend the collector's second on the traffic, not on the …
daniel-noland Aug 25, 2026
89b99e5
fix(stats): Hold a batch the collector cannot take yet
daniel-noland Aug 25, 2026
efe2b59
fix(dataplane): Give the pipeline a tick when the interface is quiet
daniel-noland Aug 25, 2026
9acaf43
fix(stats): Reset a VNI's counters when it changes hands
daniel-noland Aug 25, 2026
a03f25c
fix(stats): Drop the traffic still in flight when a VNI changes hands
daniel-noland Aug 25, 2026
0582e78
perf(stats): Make the collector's work follow the traffic
daniel-noland Aug 25, 2026
8f8194c
fix(stats): Keep a VPC's own total when its peer is deleted
daniel-noland Aug 25, 2026
139926c
fix(stats): Read the store's names and counters as one thing
daniel-noland Aug 25, 2026
81fd6f6
fix(nat): Wait for a fuzz case's timers to retire, not just to be woken
daniel-noland Aug 25, 2026
e2d20f6
fix(flow-entry): Build the per-case runtime per case
daniel-noland Aug 26, 2026
c14db20
fix(flow-entry): Repair the shuttle-gated flow table tests
daniel-noland Aug 26, 2026
b8b9251
fix(acl-filter): Keep the rte_acl name counter off the facade atomic
daniel-noland Aug 26, 2026
0a4129f
test(dataplane): Draw the model tests' inputs rather than pinning them
daniel-noland Aug 26, 2026
72119ff
fix(net): Compare the partner's genid against its own reading
daniel-noland Aug 26, 2026
5f83e9a
fix(dataplane): Take clippy's answer on three properties it rejects
daniel-noland Aug 28, 2026
00fdd9c
style(stats,acl-filter): Settle the sync facade, and two markdownlint…
daniel-noland Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions acl-filter/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use acl::dpdk::lookup::DpdkAclLookup;
use acl::dpdk::rule::{AclFieldChunks, RuleSpec};
#[cfg(test)]
use acl::reference::table::{RefRule, ReferenceTable};
use concurrency::sync::LazyLock;
use concurrency::sync::atomic::{AtomicU64, Ordering};
use config::ConfigError;
use config::external::overlay::ValidatedOverlay;
use config::external::overlay::acl::{AclAction, AclProtoMatch, AclScope, ValidatedAclRule};
Expand Down Expand Up @@ -404,16 +402,41 @@ impl<K: MatchKey, A> fmt::Debug for AnyTable<K, A> {
}
}

// Lazily initialized so this compiles under the loom backend, whose AtomicU64::new is not const
// (each instance registers with the loom executor). The atomic itself is still the backend atomic,
// so fetch_add() stays instrumented; only construction is deferred. On every other backend LazyLock
// is a thin wrapper over an otherwise-const atomic.
static TABLE_SEQ: LazyLock<AtomicU64> = LazyLock::new(|| AtomicU64::new(0));
concurrency::with_std! {
use concurrency::sync::LazyLock;
use concurrency::sync::atomic::{AtomicU64, Ordering};

static TABLE_SEQ: LazyLock<AtomicU64> = LazyLock::new(|| AtomicU64::new(0));

fn next_in_sequence() -> u64 {
TABLE_SEQ.fetch_add(1, Ordering::Relaxed)
}
}

concurrency::with_loom! {
// nosemgrep: rust-no-direct-std-sync-import
static TABLE_SEQ: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);

fn next_in_sequence() -> u64 {
// nosemgrep: rust-no-direct-std-sync-import
TABLE_SEQ.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
}
}

concurrency::with_shuttle! {
// nosemgrep: rust-no-direct-std-sync-import
static TABLE_SEQ: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);

fn next_in_sequence() -> u64 {
// nosemgrep: rust-no-direct-std-sync-import
TABLE_SEQ.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
}
}

/// A process-unique rte_acl context name. rte_acl rejects duplicate names, and a hot-swap briefly
/// keeps the old and new contexts alive at once, so the name must be unique across the process.
fn table_name(base: &str) -> String {
format!("acl_{base}_{}", TABLE_SEQ.fetch_add(1, Ordering::Relaxed))
format!("acl_{base}_{}", next_in_sequence())
}

/// Build one table for the selected backend from rules in precedence (insertion) order.
Expand Down
7 changes: 1 addition & 6 deletions dataplane/src/drivers/kernel/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Worker {
// awaits before reading anything from the socket.
_ = ticker.tick() => {
intf.watchdog.pat();
continue;
Vec::new()
}
};

Expand All @@ -221,11 +221,6 @@ impl Worker {
let mut tx_drops: u64 = 0; // number of packets dropped on tx
let rx_pkts = packets_vec.len() as u64; // number of packets received
counters.rx = rx_pkts;
if rx_pkts == 0 {
// nothing to process, but the read may have hit errors worth reporting
intf.watchdog.record(&counters);
continue;
}

let packets = packets_vec.into_iter();
let out_pkts = pipeline
Expand Down
Loading
Loading