Skip to content

Commit 5ccaffc

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 <[email protected]>
1 parent 0b1080d commit 5ccaffc

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

@@ -61,6 +62,7 @@ pub(crate) fn start_router<Buf: PacketBufferMut>(
6162
let pipeline_builder = move || {
6263
// Build network functions
6364
let stage_ingress = Ingress::new("Ingress", iftr_factory.handle());
65+
let pktio1 = PktIo::new(10_000usize, 100).set_name("pkt-io");
6466
let stage_egress = Egress::new("Egress", iftr_factory.handle(), atabler_factory.handle());
6567
let dst_vpcd_lookup = DstVpcdLookup::new("dst-vni-lookup", vpcdtablesr_factory.handle());
6668
let iprouter1 = IpForwarder::new("IP-Forward-1", fibtr_factory.handle());
@@ -83,6 +85,7 @@ pub(crate) fn start_router<Buf: PacketBufferMut>(
8385
.add_stage(flow_lookup_nf)
8486
.add_stage(stateless_nat)
8587
.add_stage(iprouter2)
88+
.add_stage(pktio1)
8689
.add_stage(stage_egress)
8790
.add_stage(dumper2)
8891
.add_stage(flow_expirations_nf)

0 commit comments

Comments
 (0)