Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1262d9b
[softnpu, mcast] wire up the softnpu backend for multicast table ops
zeeshanlakhani Oct 14, 2026
776db38
[merge] merge fwd
zeeshanlakhani Oct 17, 2026
8c742a3
[deps] p4(rs) update
zeeshanlakhani Oct 19, 2026
94ef914
[merge] merge fwd
zeeshanlakhani Oct 20, 2026
b52e768
[deps] softnpu and p4(rs) to main
zeeshanlakhani Oct 19, 2026
5671a7e
[merge] merge fwd
zeeshanlakhani Oct 20, 2026
90eacb1
[merge] merge fwd -> drop VLAN dispatch for mcast NAT
zeeshanlakhani Oct 20, 2026
4a52d14
[merge] merge fwd
zeeshanlakhani Oct 21, 2026
d664792
[merge] merge fwd
zeeshanlakhani Oct 22, 2026
61c965a
[merge] merge fwd
zeeshanlakhani Oct 29, 2026
1188ce3
[review] address review items
zeeshanlakhani Oct 29, 2026
05b4530
[merge] merge fwd
zeeshanlakhani Oct 30, 2026
b69f67e
[merge] merge fwd
zeeshanlakhani Oct 30, 2026
53f18f3
[merge] merge fwd
zeeshanlakhani Oct 30, 2026
563cb14
[review, softnpu] replace entry on add and don't drop on a dup add
zeeshanlakhani Oct 30, 2026
3019e6f
[merge] merge fwd
zeeshanlakhani Nov 2, 2026
ef57482
[merge] merge fwd
zeeshanlakhani Nov 5, 2026
628e849
[merge] merge-fwd
zeeshanlakhani Nov 5, 2026
eb55743
[softnpu, mcast] clear known src filters on update/delete + sweep after
zeeshanlakhani Nov 5, 2026
50c7013
[merge] merge fwd
zeeshanlakhani Nov 6, 2026
795b422
[rollback, repair] preserve decap coverage during cleanup and repair
zeeshanlakhani Nov 9, 2026
c6392f8
[review] address feedback + table upserts & clears
zeeshanlakhani Nov 7, 2026
f885505
[deps] newly built softnpu
zeeshanlakhani Nov 9, 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
21 changes: 16 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ oxnet = { version = "0.1.6", default-features = false, features = ["schemars", "
propolis = { git = "https://github.com/oxidecomputer/propolis" }
smf = { git = "https://github.com/illumos/smf-rs" }
slog-error-chain = { git = "https://github.com/oxidecomputer/slog-error-chain", branch = "main" }
softnpu-lib = { git = "https://github.com/oxidecomputer/softnpu" , package = "softnpu" , branch = "main"}
softnpu-lib = { git = "https://github.com/oxidecomputer/softnpu" , package = "softnpu" , branch = "zl/table-clear"}
tofino = { git = "https://github.com/oxidecomputer/tofino", branch = "main" }
transceiver-controller = { git = "https://github.com/oxidecomputer/transceiver-control", branch = "main" }

Expand Down
40 changes: 20 additions & 20 deletions asic/src/chaos/fault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,32 @@ pub(super) struct Fault {
calls: u64,
/// The call numbers that fail.
range: CallRange,
/// The error returned by a failing execution.
err: fn(String) -> AsicError,
}

impl Fault {
pub(super) fn new(range: CallRange) -> Self {
Self { calls: 0, range }
Self { calls: 0, range, err: AsicError::Synthetic }
}
}

impl Handle {
pub(super) fn check_mc_fault(&self, op: McOp) -> AsicResult<()> {
if self.config.mc_config.unsupported.contains(&op) {
return Err(AsicError::OperationUnsupported);
}

let failed_call = {
let mut faults = self.mc_faults.lock().unwrap();
faults.get_mut(&op).and_then(|fault| {
fault.calls += 1;
fault.range.contains(fault.calls).then_some(fault.calls)
fault
.range
.contains(fault.calls)
.then_some((fault.calls, fault.err))
})
};

if let Some(call) = failed_call {
slog::error!(self.log, "chaos error: {} (call {})", op, call);
return Err(AsicError::Synthetic(op.to_string()));
if let Some((call, err)) = failed_call {
slog::error!(self.log, "chaos error: {op} (call {call})");
return Err(err(op.to_string()));
}

self.config.mc_config.chaos(op).unfurled(&self.log, &op.to_string())
Expand All @@ -93,20 +94,20 @@ impl Handle {
let mut faults = self.table_faults.lock().unwrap();
faults.get_mut(&(table, op)).and_then(|fault| {
fault.calls += 1;
fault.range.contains(fault.calls).then_some(fault.calls)
fault
.range
.contains(fault.calls)
.then_some((fault.calls, fault.err))
})
};

match failed_call {
Some(call) => {
Some((call, err)) => {
slog::error!(
self.log,
"chaos table error: {} on {} (call {})",
op,
table,
call
"chaos table error: {op} on {table} (call {call})"
);
Err(AsicError::Synthetic(op.to_string()))
Err(err(op.to_string()))
}
None => Ok(()),
}
Expand All @@ -117,11 +118,10 @@ impl Handle {
table: TableType,
op: TableOp,
range: CallRange,
error: fn(String) -> AsicError,
) {
self.table_faults
.lock()
.unwrap()
.insert((table, op), Fault::new(range));
let fault = Fault { err: error, ..Fault::new(range) };
self.table_faults.lock().unwrap().insert((table, op), fault);
}

pub fn clear_table_faults(&self, table: TableType, op: TableOp) {
Expand Down
9 changes: 4 additions & 5 deletions asic/src/chaos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Chaos {
/// Return a chaos error according to the underlying probability value.
pub fn unfurled(&self, log: &Logger, message: &str) -> AsicResult<()> {
if self.value > random() {
slog::error!(log, "chaos error: {}", message);
slog::error!(log, "chaos error: {message}");
return Err(AsicError::Synthetic(message.into()));
}
Ok(())
Expand Down Expand Up @@ -150,7 +150,7 @@ impl TableChaos {
if let Some(value) = self.values.get(&id)
&& *value > random()
{
slog::error!(log, "chaos table error: {}", message);
slog::error!(log, "chaos table error: {message}");
return Err(AsicError::Synthetic(message.into()));
}
Ok(())
Expand Down Expand Up @@ -201,6 +201,7 @@ pub enum TableOp {
EntryAdd,
EntryUpdate,
EntryDel,
EntryList,
}

impl fmt::Display for TableOp {
Expand All @@ -209,6 +210,7 @@ impl fmt::Display for TableOp {
Self::EntryAdd => "table_entry_add",
Self::EntryUpdate => "table_entry_update",
Self::EntryDel => "table_entry_del",
Self::EntryList => "table_entry_list",
})
}
}
Expand All @@ -226,8 +228,6 @@ pub struct AsicMulticastConfig {
pub mc_port_list: Chaos,
#[serde(default)]
pub faults: BTreeMap<McOp, CallRange>,
#[serde(default)]
pub unsupported: BTreeSet<McOp>,
}

impl AsicMulticastConfig {
Expand Down Expand Up @@ -316,7 +316,6 @@ impl AsicConfig {
mc_set_max_nodes: Chaos::new(v),
mc_port_list: Chaos::new(v),
faults: BTreeMap::new(),
unsupported: BTreeSet::new(),
},
}
}
Expand Down
3 changes: 2 additions & 1 deletion asic/src/chaos/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ impl TableOps<Handle> for Table {

fn get_entries<M: MatchParse, A: ActionParse>(
&self,
_hdl: &Handle,
hdl: &Handle,
_from_hardware: bool,
) -> AsicResult<Vec<(M, A)>> {
hdl.check_table_fault(self.type_, TableOp::EntryList)?;
self.keys
.lock()
.unwrap()
Expand Down
Loading
Loading