Skip to content

Commit fa4cbc1

Browse files
committed
feat(dataplane): create taps at initialization
Create taps for the interfaces specified via cmd line args. Taps should be created before drivers start so that the latter can learn their during their initialization. Signed-off-by: Fredi Raspall <[email protected]>
1 parent 89d825c commit fa4cbc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dataplane/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use pyroscope::PyroscopeAgent;
2020
use pyroscope_pprofrs::{PprofConfig, pprof_backend};
2121

2222
use net::buffer::{TestBuffer, TestBufferPool};
23-
use pkt_io::start_io;
23+
use pkt_io::{start_io, tap_init};
2424

2525
use routing::RouterParamsBuilder;
2626
use tracectl::{custom_target, get_trace_ctl, trace_target};
@@ -137,11 +137,14 @@ fn main() {
137137
// populate it with [`PortSpec`]s and return the writer
138138
let (_handle, iom_ctl) = {
139139
match &launch_config.driver {
140-
args::DriverConfigSection::Dpdk(_section) => {
140+
args::DriverConfigSection::Dpdk(section) => {
141+
tap_init(&section.interfaces).expect("Tap initialization failed");
142+
141143
info!("Using driver DPDK...");
142144
todo!();
143145
}
144146
args::DriverConfigSection::Kernel(section) => {
147+
tap_init(&section.interfaces).expect("Tap initialization failed");
145148
info!("Using driver kernel...");
146149
DriverKernel::start(
147150
section.interfaces.clone().into_iter(),

0 commit comments

Comments
 (0)