From 7c298670530922c53ae3f35cd853c0c82229d1ca Mon Sep 17 00:00:00 2001 From: Zeeshan Lakhani Date: Thu, 19 Nov 2026 01:26:47 +0000 Subject: [PATCH] [softnpu, deps] handle `TableClear` mgmt requests / softnpu @ main oxidecomputer/softnpu#234 added a `TableClear` management request that processes (e.g., DPD) can execute for emptying P4 tables. Includes: - the p4rs lock bump picks up oxidecomputer/p4#278 (`Pipeline::clear_table_entries`) - on clear, if an unknown table is encountered we log with a `warn!` --- Cargo.lock | 4 ++-- lib/propolis/src/hw/virtio/softnpu.rs | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2648f3d5..b28e84f2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5986,7 +5986,7 @@ dependencies = [ [[package]] name = "p4rs" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/p4?branch=main#33d646041f13062cc39c6f38725d8c95d4024a2f" +source = "git+https://github.com/oxidecomputer/p4?branch=main#89b725ca3d534089675ef59f1606882218b6a3c8" dependencies = [ "bitvec", "num", @@ -9130,7 +9130,7 @@ dependencies = [ [[package]] name = "softnpu" version = "0.2.0" -source = "git+https://github.com/oxidecomputer/softnpu#3828225fd5719dc985a300e36850d25a0405eba6" +source = "git+https://github.com/oxidecomputer/softnpu#42ff234fbb5e4b2da55eff9e11529694c43589d9" dependencies = [ "p4rs", "serde", diff --git a/lib/propolis/src/hw/virtio/softnpu.rs b/lib/propolis/src/hw/virtio/softnpu.rs index 94b83cff7..a15cea42d 100644 --- a/lib/propolis/src/hw/virtio/softnpu.rs +++ b/lib/propolis/src/hw/virtio/softnpu.rs @@ -775,6 +775,17 @@ fn handle_management_message( }; pl.1.remove_table_entry(&tm.table, &tm.keyset_data); } + ManagementRequest::TableClear(tc) => { + let mut pl_opt = pipeline.lock().unwrap(); + let pl = match &mut *pl_opt { + Some(pl) => pl, + None => return, + }; + + if !pl.1.clear_table_entries(&tc.table) { + warn!(log, "table clear: unknown table {}", tc.table); + } + } ManagementRequest::RadixRequest => { // the data is being sent back as ascii text because this is the // simplest way for the guest tty device to handle the data. control