Skip to content

Extend cli + small fixes#1340

Merged
Fredi-raspall merged 30 commits intomainfrom
pr/fredi/dataplane-state-cli
Mar 17, 2026
Merged

Extend cli + small fixes#1340
Fredi-raspall merged 30 commits intomainfrom
pr/fredi/dataplane-state-cli

Conversation

@Fredi-raspall
Copy link
Contributor

Fixes: #1317

@pau-hedgehog @edipascale you may find these commands useful for troubleshooting.

SAMPLES

dataplane(✔)# show vpc summary
 ───────────────────────────────────────────── VPCs (3) ─────────────────────────────────────────────
 VPC                Id     VNI      peers     remote             peering name      
 VPC-1              AAAAA  3000     2         VPC-2              vpc-1--vpc-2      
                                              VPC-3              vpc-1--vpc-3      
 VPC-2              BBBBB  4000     2         VPC-1              vpc-1--vpc-2      
                                              VPC-3              vpc-2--vpc-3      
 VPC-3              CCCCC  2000     2         VPC-1              vpc-1--vpc-3      
                                              VPC-2              vpc-2--vpc-3      
dataplane(✔)# show vpc peerings
 ─────────────────────────── Peerings of VPC:VPC-1 Id:AAAAA vni :3000 (2) ───────────────────────────
  ■ vpc-1--vpc-2:
   gwgroup: gw-group-1
     local:
        prefixes: 192.168.50.0/24:[all]
        prefixes: 192.168.60.0/24:[all]

     remote VPC is VPC-2 (id:BBBBB):
        prefixes: 192.168.90.0/24:[22-22]
              as: 20.10.90.0/24:[2222-2222] proto: Tcp NAT:port-forwarding, idle timeout: 660
        prefixes: 192.168.90.0/24:[53-53]
              as: 20.10.90.0/24:[2053-2053] proto: Udp NAT:port-forwarding, idle timeout: 660
        prefixes: 192.168.80.0/24:[all]

  ■ vpc-1--vpc-3:
   gwgroup: gw-group-2
     local:
        prefixes: 192.168.50.0/24:[all]

     remote VPC is VPC-3 (id:CCCCC):
        prefixes: 192.168.100.0/24:[all]
        prefixes: 192.168.128.0/27:[all]

 ─────────────────────────── Peerings of VPC:VPC-2 Id:BBBBB vni :4000 (2) ───────────────────────────
  ■ vpc-1--vpc-2:
   gwgroup: gw-group-1
     local:
        prefixes: 192.168.90.0/24:[22-22]
              as: 20.10.90.0/24:[2222-2222] proto: Tcp NAT:port-forwarding, idle timeout: 660
        prefixes: 192.168.90.0/24:[53-53]
              as: 20.10.90.0/24:[2053-2053] proto: Udp NAT:port-forwarding, idle timeout: 660
        prefixes: 192.168.80.0/24:[all]

     remote VPC is VPC-1 (id:AAAAA):
        prefixes: 192.168.50.0/24:[all]
        prefixes: 192.168.60.0/24:[all]

  ■ vpc-2--vpc-3:
   gwgroup: gw-group-2
     local:
        prefixes: 192.168.90.0/24:[all]
              as: 20.30.90.30/32:[all] proto: Any NAT:masquerade, idle timeout: 300

     remote VPC is VPC-3 (id:CCCCC):
        prefixes: 192.168.128.0/27:[all]

 ─────────────────────────── Peerings of VPC:VPC-3 Id:CCCCC vni :2000 (2) ───────────────────────────
  ■ vpc-1--vpc-3:
   gwgroup: gw-group-2
     local:
        prefixes: 192.168.100.0/24:[all]
        prefixes: 192.168.128.0/27:[all]

     remote VPC is VPC-1 (id:AAAAA):
        prefixes: 192.168.50.0/24:[all]

  ■ vpc-2--vpc-3:
   gwgroup: gw-group-2
     local:
        prefixes: 192.168.128.0/27:[all]

     remote VPC is VPC-2 (id:BBBBB):
        prefixes: 192.168.90.0/24:[all]
              as: 20.30.90.30/32:[all] proto: Any NAT:masquerade, idle timeout: 300
dataplane(✔)# show gateway communities
  ━━━━━━━ Community mappings ━━━━━━━
     rank community       
        0 65000:800       
        9 65000:809       
        7 65000:807       
        1 65000:801       
        5 65000:805       
        4 65000:804       
        3 65000:803       
        8 65000:808       
        6 65000:806       
        2 65000:802       
dataplane(✔)# show gateway groups
 ━━━━━━━━━━ Gateway groups ━━━━━━━━━━
 gw-group-1:
   name             prio  address                                 
   GW1              10    7.0.0.100                               
   GW2              0     7.0.0.101                               
 gw-group-2:
   name             prio  address                                 
   GW1              5     7.0.0.100                               
   GW2              20    7.0.0.101       
dataplane(✔)# show port-forwarding rules
 ────────────────────────────────────── Port forwarding table ───────────────────────────────────────
 VNI(3000) tcp: 20.10.90.0/24:2222 -> 192.168.90.0/24:22 at VNI(4000) timers:[init:10s estab:1800s]
 VNI(3000) udp: 20.10.90.0/24:2053 -> 192.168.90.0/24:53 at VNI(4000) timers:[init:10s estab:30s]
dataplane(✔)# show flow-table entries
 ────────────────────────────────────── Flow Table (4 entries) ──────────────────────────────────────
key = { VPCs(VNI(2000) ICMP (192.168.128.7, 20.30.90.30)id:14592 }
data = 
      dst-vpcd:VNI(4000)
      nat-state:(unchanged, 192.168.90.100:5)[300s]
      status: Active, expires in 216s, related: no

key = { VPCs(VNI(3000) TCP (192.168.50.200:48472, 20.10.90.100:2222) }
data = 
      dst-vpcd:VNI(4000)
      port-forwarding:
        dnat to ip:192.168.90.100 port:22
        status: established
        rule:  VNI(3000) tcp: 20.10.90.0/24:2222 -> 192.168.90.0/24:22 at VNI(4000) timers:[init:10s estab:1800s]
      status: Active, expires in 1796s, related: yes

key = { VPCs(VNI(4000) TCP (192.168.90.100:22, 192.168.50.200:48472) }
data = 
      dst-vpcd:VNI(3000)
      port-forwarding:
        snat from ip:20.10.90.100 port:2222
        status: established
        rule:  VNI(3000) tcp: 20.10.90.0/24:2222 -> 192.168.90.0/24:22 at VNI(4000) timers:[init:10s estab:1800s]
      status: Active, expires in 1796s, related: yes

key = { VPCs(VNI(4000) ICMP (192.168.90.100, 192.168.128.7)id:5 }
data = 
      dst-vpcd:VNI(2000)
      nat-state:(20.30.90.30:14592, unchanged)[300s]
      status: Active, expires in 216s, related: no
dataplane(✔)# show flow-filter table
subtable for TCP/UDP:
  source VPC VNI(2000):
    source: 192.168.100.0/24
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      no remote default
    source: 192.168.128.0/27
      destination: 20.30.90.30/32, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: Stateful
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      no remote default
    no local default

  source VPC VNI(3000):
    source: 192.168.50.0/24
      destination: 20.10.90.0/24:2053-2053, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: PortForwarding(Udp)
      destination: 20.10.90.0/24:2222-2222, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: PortForwarding(Tcp)
      destination: 192.168.80.0/24, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: -
      destination: 192.168.100.0/24, data:
        destination VPC: VNI(2000), source NAT: -, destination NAT: -
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: -, destination NAT: -
      no remote default
    source: 192.168.60.0/24
      destination: 20.10.90.0/24:2053-2053, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: PortForwarding(Udp)
      destination: 20.10.90.0/24:2222-2222, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: PortForwarding(Tcp)
      destination: 192.168.80.0/24, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: -
      no remote default
    no local default

  source VPC VNI(4000):
    source: 192.168.80.0/24
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      destination: 192.168.60.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      no remote default
    source: 192.168.90.0/24:0-21
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: Stateful, destination NAT: -
      no remote default
    source: 192.168.90.0/24:22-22
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: PortForwarding(Tcp), destination NAT: -
      destination: 192.168.60.0/24, data:
        destination VPC: VNI(3000), source NAT: PortForwarding(Tcp), destination NAT: -
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: Stateful, destination NAT: -
      no remote default
    source: 192.168.90.0/24:23-52
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: Stateful, destination NAT: -
      no remote default
    source: 192.168.90.0/24:53-53
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: PortForwarding(Udp), destination NAT: -
      destination: 192.168.60.0/24, data:
        destination VPC: VNI(3000), source NAT: PortForwarding(Udp), destination NAT: -
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: Stateful, destination NAT: -
      no remote default
    source: 192.168.90.0/24:54-65535
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: Stateful, destination NAT: -
      no remote default
    no local default

subtable for ICMP:
  source VPC VNI(2000):
    source: 192.168.100.0/24
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      no remote default
    source: 192.168.128.0/27
      destination: 20.30.90.30/32, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: Stateful
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      no remote default
    no local default

  source VPC VNI(3000):
    source: 192.168.50.0/24
      destination: 192.168.80.0/24, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: -
      destination: 192.168.100.0/24, data:
        destination VPC: VNI(2000), source NAT: -, destination NAT: -
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: -, destination NAT: -
      no remote default
    source: 192.168.60.0/24
      destination: 192.168.80.0/24, data:
        destination VPC: VNI(4000), source NAT: -, destination NAT: -
      no remote default
    no local default

  source VPC VNI(4000):
    source: 192.168.80.0/24
      destination: 192.168.50.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      destination: 192.168.60.0/24, data:
        destination VPC: VNI(3000), source NAT: -, destination NAT: -
      no remote default
    source: 192.168.90.0/24
      destination: 192.168.128.0/27, data:
        destination VPC: VNI(2000), source NAT: Stateful, destination NAT: -
      no remote default
    no local default
dataplane(✔)# show static-nat rules
 ───────────────────────────────────────── Static NAT table ─────────────────────────────────────────
source VNI 2000:
  destination NAT:
  source NAT:

source VNI 3000:
  destination NAT:
    [20.10.90.0 .. 20.10.90.255] -> [192.168.90.0 .. 192.168.90.255] (offset: 0)
  source NAT:

source VNI 4000:
  destination NAT:
  source NAT:
    destination VNI 3000:
      [192.168.90.0 .. 192.168.90.255] -> [20.10.90.0 .. 20.10.90.255] (offset: 0)
dataplane(✔)# show masquerading state
 ────────────────────────────────── Masquerade NAT allocator table ──────────────────────────────────
source pools (IPv4):
  icmp | dest VPC: VNI(2000), for IPs: [ 192.168.90.0 .. 192.168.90.255 ]
    idle timeout: 300s
    IP ranges in pool:
      [20.30.90.30 .. 20.30.90.30]
    allocated IPs:
      (empty)
  tcp | dest VPC: VNI(2000), for IPs: [ 192.168.90.0 .. 192.168.90.255 ]
    idle timeout: 300s
    IP ranges in pool:
      [20.30.90.30 .. 20.30.90.30]
    allocated IPs:
      (empty)
  udp | dest VPC: VNI(2000), for IPs: [ 192.168.90.0 .. 192.168.90.255 ]
    idle timeout: 300s
    IP ranges in pool:
      [20.30.90.30 .. 20.30.90.30]
    allocated IPs:
      (empty)

source pools (IPv6):
  (empty)

destination pools (IPv4):
  icmp | dest VPC: VNI(4000), for IPs: [ 20.30.90.30 .. 20.30.90.30 ]
    idle timeout: 300s
    IP ranges in pool:
      [192.168.90.0 .. 192.168.90.255]
    allocated IPs:
      (empty)
  tcp | dest VPC: VNI(4000), for IPs: [ 20.30.90.30 .. 20.30.90.30 ]
    idle timeout: 300s
    IP ranges in pool:
      [192.168.90.0 .. 192.168.90.255]
    allocated IPs:
      (empty)
  udp | dest VPC: VNI(4000), for IPs: [ 20.30.90.30 .. 20.30.90.30 ]
    idle timeout: 300s
    IP ranges in pool:
      [192.168.90.0 .. 192.168.90.255]
    allocated IPs:
      (empty)

destination pools (IPv6):
  (empty)
dataplane(✔)# show config summary
 ────────────────────────────────────── Configuration summary ───────────────────────────────────────
  GenId created                   applied                   error 
      1 13:56:02 on 2026/03/13    13:56:04 on 2026/03/13    none 
      2 14:00:23 on 2026/03/13    14:00:25 on 2026/03/13    none 
      3 14:00:47 on 2026/03/13    14:00:49 on 2026/03/13    none 

@Fredi-raspall Fredi-raspall requested a review from qmonnet March 13, 2026 14:07
@Fredi-raspall Fredi-raspall requested a review from a team as a code owner March 13, 2026 14:07
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/dataplane-state-cli branch from 90bc3f1 to b0efe04 Compare March 13, 2026 14:10
@qmonnet qmonnet requested a review from Copilot March 13, 2026 14:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the dataplane troubleshooting CLI (Issue #1317) by plumbing additional runtime/config state into the routing CLI handler and adding display/providers for flow/NAT/filter data, while also consolidating common CLI formatting/provider utilities into a new shared crate.

Changes:

  • Add new show ... commands/actions for VPC summary/peerings, gateway groups/communities, flow-table, flow-filter, NAT (static/port-forwarding/masquerade), and config summary.
  • Introduce common crate with CliDataProvider + shared Heading/Frame/line formatting, and migrate existing per-crate helpers to it.
  • Track and publish applied GwConfig + config history from mgmt to routing over the router control channel for CLI rendering.

Reviewed changes

Copilot reviewed 48 out of 50 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
routing/src/router/rio.rs Store latest GwConfig + config history in RIO; pass CliSources into CLI request handling.
routing/src/router/mod.rs Add CliSources and thread it through Router::newstart_rio.
routing/src/router/ctl.rs Add new control messages + sender helpers to deliver config and history into routing.
routing/src/rib/vrftable.rs Switch tests to shared Frame helper.
routing/src/rib/vrf.rs Switch tests to shared Frame helper.
routing/src/lib.rs Export CliSources; stop exporting old CLI formatting types.
routing/src/frr/test.rs Update router constructor call signature.
routing/src/cli/pretty_utils.rs Remove local formatting helpers (migrated to common).
routing/src/cli/mod.rs Remove pretty_utils module from routing CLI.
routing/src/cli/handler.rs Add handlers for new CLI actions; render from GwConfig, history, and external providers.
routing/src/cli/display.rs Switch to shared Heading/line formatting.
routing/Cargo.toml Add dependency on common crate.
nat/src/stateless/setup/display.rs Use shared Heading; implement CliDataProvider for NatTables.
nat/src/stateless/natrw.rs Expose inner() read handle for CLI provider plumbing.
nat/src/stateful/apalloc/display.rs Use shared Heading; implement CliDataProvider for masquerade allocator.
nat/src/stateful/allocator_writer.rs Expose inner() for CLI provider plumbing.
nat/src/portfw/portfwtable/display.rs Use shared Heading; implement CliDataProvider for port-forwarding table.
nat/src/portfw/portfwtable/access.rs Expose inner() read handle for CLI provider plumbing.
nat/src/portfw/flow_state.rs Reduce log noise when flow expiry extension is not applied.
nat/Cargo.toml Add dependency on common crate.
mgmt/src/tests/mgmt.rs Update VPC display usage + router constructor signature.
mgmt/src/processor/proc.rs Rework config apply/rollback + history updates; send config + history to routing control channel.
mgmt/src/processor/mod.rs Remove old mgmt display module.
mgmt/src/processor/mgmt_client.rs Change mgmt client API to always return Arc<GwConfig>/GenId (blank default).
mgmt/src/processor/k8s_less_client.rs Adjust generation logic for new “always present” config/genid behavior.
mgmt/src/processor/k8s_client.rs Adjust status building to read apply time from ArcSwap meta.
mgmt/src/processor/gwconfigdb.rs Store applied config as Arc<GwConfig> (blank default) and centralize history logging.
mgmt/src/processor/display.rs Remove old config history display (moved to config crate display).
mgmt/src/processor/confbuild/router.rs Accept Arc<GwConfig> in router config generation.
mgmt/src/processor/confbuild/internal.rs Remove warning for configs without BGP (behavioral tweak).
flow-filter/src/tables.rs Make internal tables accessible to display module; move Display impls out.
flow-filter/src/lib.rs Add display module.
flow-filter/src/filter_rw.rs Expose inner() read handle for CLI provider plumbing.
flow-filter/src/display.rs New: Display + CliDataProvider for flow-filter table dumps.
flow-filter/Cargo.toml Add dependency on common crate.
flow-entry/src/flow_table/display.rs Use shared Heading; implement CliDataProvider for flow-table dumps.
flow-entry/Cargo.toml Add dependency on common crate.
dataplane/src/packet_processor/mod.rs Wire real dataplane state into routing CLI via CliSources.
config/src/lib.rs Re-export ConfigSummary.
config/src/gwconfig.rs Store GwConfigMeta in ArcSwap; add rollback flag.
config/src/external/overlay/tests.rs Update to new VPC summary/detailed display helpers.
config/src/display.rs Add new summary/peerings views and config history summary display.
config/Cargo.toml Add common and arc-swap dependencies; adjust chrono features.
common/src/lib.rs New crate root for shared utilities.
common/src/cliprovider.rs New: shared CLI provider trait + formatting helpers.
common/Cargo.toml New workspace crate for shared CLI utilities.
cli/src/cliproto.rs Add new CLI actions for troubleshooting.
cli/bin/cmdtree_dp.rs Add new show ... command tree nodes mapping to new actions.
Cargo.toml Add common to workspace members and workspace deps.
Cargo.lock Lockfile updates for new crate and dependency versions.

You can also share your feedback on Copilot code review. Take the survey.

@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/dataplane-state-cli branch from b0efe04 to 3f8c686 Compare March 13, 2026 18:11
@Fredi-raspall Fredi-raspall enabled auto-merge March 13, 2026 18:12
@Fredi-raspall Fredi-raspall added the ci:+vlab Enable VLAB tests label Mar 14, 2026
This crate is meant to include miscellaneous types or traits that
other traits may refer to, with the goal of avoiding circular
dependencies.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Tidy up start_router() and reorder declarations as this will be
needed to pass extra info to the router so that it is accessible
from the cli handler.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The trait will be implemented by types capable of providing
data to the CLI.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/dataplane-state-cli branch from a86252b to 5005e47 Compare March 16, 2026 08:35
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to have these new commands!! Thanks for this.

Some high-level comments:

  • Unless you plan to add more code to the common crate, I'd rename it for now, because its contents are specific to the CLI. Maybe cli_common or cli_display?

  • Regarding the new ArcSwap-based rollback system: in some upcoming work I'd like to do some processing of the VpcExpose at validation time, and store it somewhere as part of the internal config to avoid doing it again at NAT set-up time. I don't expect it to be an issue after your changes, right? Just checking to be sure.

  • Please let's try to be accurate with regards to commit title prefixes, something like “clean up X” or “move Y to Z” should probably use refactor(...): rather than feat(...).

I also have some minor comments or questions inline below.

@Fredi-raspall
Copy link
Contributor Author

Fredi-raspall commented Mar 17, 2026

Great to have these new commands!! Thanks for this.

Some high-level comments:

  • Unless you plan to add more code to the common crate, I'd rename it for now, because its contents are specific to the CLI. Maybe cli_common or cli_display?

The intent is to put miscellaneous stuff there, not just cli stuff. Hence the "common" name. I'd not rename it because of this and we should probably remember that the "common" crate is just for that: store/declare things that are needed by multiple crates, without the risk of introducing circular dependencies.

  • Regarding the new ArcSwap-based rollback system: in some upcoming work I'd like to do some processing of the VpcExpose at validation time, and store it somewhere as part of the internal config to avoid doing it again at NAT set-up time. I don't expect it to be an issue after your changes, right? Just checking to be sure.

I don't think that'd be an issue. The ArcSwap affects only the metadata and the config is Arc'ed once the internal config has been built, which happens only if validation was successful. So, you still have a chance to mutate it if that's the question.

  • Please let's try to be accurate with regards to commit title prefixes, something like “clean up X” or “move Y to Z” should probably use refactor(...): rather than feat(...).

I also have some minor comments or questions inline below.

Ok!

Adds new commands to the cli and remove some that were never
implemented in the end.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The CliSources contains type-erased CliDataProviders for the
Cli, currently living in the routing crate, to have access
to them.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Implement CliDataProvider trait for some NFs and add method
inner() to provide a ReadHandle<T> from the left-right wrapper
types we use.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
This commit is a small refactor of the configuration database
that simplifies the code and:

- avoids &mut when possible
- removes unnecessary methods
- uses Arc<> for the GW config to avoid expensive clones and
  further simplifies the code.
- registers rollbacks in the configuration history
- uses arcswap to keep the configuration metadata

These changes simplify the code and make it easier to export
the configuration. The use of arcswap is motivated by the fact
that, once a config is applied, we want to make it immutable.
However, the metadata should be allowed to change.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Clean-up and simplify existing code to deal with the history
of configuration changes and augment the cli handler to display
them.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The current flow timer implementation relies on AtomicInstant,
which cannot go backwards. Do not show errors if we can't shrink
a flow lifetime.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Simplify the mgmt code given that there is always an applied
configuration (even if blank).

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Move the declaration of tracing target "port-frwarding" to the
modules' root so that it governs all port-forwarding logs.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The types represent the values that the user entered in the API.
So, if nothing is specified, None should be the value. We could
set defaults in the config, but the default values should come
from the NF implementing the functionality. Since we don't
want to add circular dependencies, let's make those optional and
let the NF set the default as appropriate.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The port-forwarding uses two timeouts, idle and established, while
the API currently only exposes one (idle). Map the API idle
timeout to the port-forwarding established timeout, which is
the one that users may care the most.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/dataplane-state-cli branch from 5005e47 to 8ad4837 Compare March 17, 2026 09:24
@Fredi-raspall Fredi-raspall requested a review from qmonnet March 17, 2026 13:31
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, and I have no newer comment. Please make sure to address or reply to all comments from the first review 😕

Remove some logs that are not anymore needed now that the
state can be inspected with the cli, as well as logs that
are produced periodically and add little information.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Add custom tracing targets to, by default, disable debug logs
from several 3rd party crates that clutter the logs.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
@Fredi-raspall Fredi-raspall requested a review from qmonnet March 17, 2026 18:13
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@Fredi-raspall Fredi-raspall added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit f38ec9e Mar 17, 2026
21 checks passed
@Fredi-raspall Fredi-raspall deleted the pr/fredi/dataplane-state-cli branch March 17, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:+vlab Enable VLAB tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend CLI to show relevant state for troubleshooting

3 participants