Skip to content

Commit 87bbea3

Browse files
committed
feat(dataplane): add single pkt-io to pipeline
Add a pkt-io instance to pipeline before egress stage. The injection buffer is 10K packets. The punting buffer is only 100 packets large. This is temporary: we currently mark some packets as local, but do not handle them yet. Therefore, the first 100 of local packets will be cached (forever) and the rest removed. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
1 parent 390b94b commit 87bbea3

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dataplane/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ once_cell = { workspace = true }
3030
ordermap = { workspace = true, features = ["std"] }
3131
parking_lot = { workspace = true }
3232
pipeline = { workspace = true }
33+
pkt-io = { workspace = true }
3334
pkt-meta = { workspace = true }
3435
routing = { workspace = true }
3536
serde = { workspace = true, features = ["derive"] }

dataplane/src/packet_processor/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use super::packet_processor::ipforward::IpForwarder;
1212

1313
use concurrency::sync::Arc;
1414

15+
use pkt_io::PktIo;
1516
use pkt_meta::dst_vpcd_lookup::{DstVpcdLookup, VpcDiscTablesWriter};
1617
use pkt_meta::flow_table::{ExpirationsNF, FlowTable, LookupNF};
1718

@@ -63,6 +64,7 @@ pub(crate) fn start_router<Buf: PacketBufferMut>(
6364
let pipeline_builder = move || {
6465
// Build network functions
6566
let stage_ingress = Ingress::new("Ingress", iftr_factory.handle());
67+
let pktio1 = PktIo::new(10_000usize, 100).set_name("pkt-io");
6668
let stage_egress = Egress::new("Egress", iftr_factory.handle(), atabler_factory.handle());
6769
let dst_vpcd_lookup = DstVpcdLookup::new("dst-vni-lookup", vpcdtablesr_factory.handle());
6870
let iprouter1 = IpForwarder::new("IP-Forward-1", fibtr_factory.handle());
@@ -87,6 +89,7 @@ pub(crate) fn start_router<Buf: PacketBufferMut>(
8789
.add_stage(stateless_nat)
8890
.add_stage(stateful_nat)
8991
.add_stage(iprouter2)
92+
.add_stage(pktio1)
9093
.add_stage(stage_egress)
9194
.add_stage(dumper2)
9295
.add_stage(flow_expirations_nf)

0 commit comments

Comments
 (0)