Skip to content

Management config processing logic #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 64 commits into from
May 14, 2025
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6356232
feat(mgmt): scaffold mgmt processor logic and
Fredi-raspall Apr 22, 2025
df7aff0
feat(mgmt): add minimal OSPF config to model
Fredi-raspall Apr 23, 2025
5ab64cb
feat(mgmt): add utils to impl FRR cfg driver
Fredi-raspall Apr 11, 2025
cd4befe
feat(mgmt): implement FRR renderer
Fredi-raspall Apr 11, 2025
a808a94
feat(mgmt): impl Render for Ospf configs
Fredi-raspall Apr 23, 2025
aa3582d
feat(mgmt): remove duplicate markers in frr render
Fredi-raspall Apr 24, 2025
23b8468
style(mgmt): Fix Clippy reports
qmonnet May 1, 2025
cb0f0f0
feat(mgmt): add tracing-test dependency
Fredi-raspall Apr 23, 2025
d9bbece
feat(mgmt): reorganize code and add logs
Fredi-raspall Apr 22, 2025
05bd40d
feat(mgmt): impl Default for BgpOptions
Fredi-raspall Apr 23, 2025
11ef1fd
feat(mgmt): augment test w/ OSPF + small changes
Fredi-raspall Apr 23, 2025
3a90b8b
feat(mgmt): reject config if missing BGP section
Fredi-raspall Apr 23, 2025
71bacaa
feat(mgmt): test util made pub
Fredi-raspall Apr 27, 2025
cb9200a
feat(mgmt): add interface to frr-agent
Fredi-raspall Apr 29, 2025
cb6bbf8
feat(mgmt): let frrmi be async
Fredi-raspall Apr 29, 2025
25cdc50
feat(dataplane): add mgmt as dependency
Fredi-raspall Apr 29, 2025
d004b1a
feat(mgmt): add basic OSPF config handler to gRPC
sergeymatov Apr 29, 2025
e71bb15
feat(mgmt): handle config requests async
Fredi-raspall Apr 30, 2025
dc3f024
feat(dataplane): start mgmt service from dataplane
Fredi-raspall Apr 30, 2025
175f400
feat(mgmt): do not apply config if applied
Fredi-raspall Apr 30, 2025
42b1354
feat(mgmt): blank config & reject duplicates
Fredi-raspall Apr 30, 2025
f49af5a
feat(mgmt): make open_unix_sock_async to fix test
Fredi-raspall Apr 30, 2025
f01ae31
feat(mgmt): fix test with faked frr-agent
Fredi-raspall Apr 30, 2025
5031bdd
feat(mgmt): change start_mgmt
Fredi-raspall Apr 30, 2025
ac23e6f
feat(mgmt): let open_unix_sock_async create paths
Fredi-raspall May 5, 2025
15b8429
feat(mgmt): clippy gRPC server
Fredi-raspall May 5, 2025
f3fe9ff
feat(mgmt): hardening frrmi
Fredi-raspall May 5, 2025
9df49f2
feat(mgmt): hardening frrmi II
Fredi-raspall May 5, 2025
932efa0
feat(mgmt): add faked frr-agent for testing
Fredi-raspall May 5, 2025
23b00b1
feat(mgmt): fix logs
Fredi-raspall May 6, 2025
ef1c3a0
feat(mgmt): split grpc server convert code
sergeymatov May 6, 2025
2de30e5
feat(mgmt): increase frrmi rx/tx buffer size
sergeymatov May 6, 2025
ee62ab0
refactor(mgmt): fix clippy reports for grpc converter
sergeymatov May 6, 2025
214ba8e
feat(mgmt): bump gateway-config to 0.2.0
sergeymatov May 6, 2025
6ee9485
feat(mgmt): reorganize code
Fredi-raspall May 5, 2025
f1814bb
feat(mgmt): add ConfigProcessor entity
Fredi-raspall May 6, 2025
c23c25d
feat(mgmt): disentangle gRPC and mgmt processor
Fredi-raspall May 6, 2025
651449d
feat(mgmt): rename ApiError and ApiResult
Fredi-raspall May 6, 2025
aad1df9
feat(mgmt): box configs over channel to processor
Fredi-raspall May 6, 2025
17b74e0
feat(mgmt): let gRPC converters not be async
Fredi-raspall May 7, 2025
f43d965
feat(mgmt): logs & make validate methods not async
Fredi-raspall May 7, 2025
0c8b54d
feat(mgmt): move validation from grpc to internal
Fredi-raspall May 7, 2025
4010a15
feat(mgmt): move validation from grpc to internal
Fredi-raspall May 7, 2025
02b8a26
feat(mgmt): build blank config
Fredi-raspall May 7, 2025
f4b2314
feat(mgmt): impl Default for VrfConfig
Fredi-raspall May 7, 2025
c48bb4a
feat(mgmt): cleanup and apply blank config
Fredi-raspall May 7, 2025
eb65e5e
feat(dataplane): disable tonic/h2 logs
Fredi-raspall May 7, 2025
1e7b324
feat(dataplane): don't log parsing issues with lo
Fredi-raspall May 9, 2025
e2bdee1
feat(mgmt): send genId to frr-agent
Fredi-raspall May 9, 2025
a1f2be4
feat(mgmt): fix logs & delete failed configs
Fredi-raspall May 9, 2025
0063966
feat(routing): impl fallible Prefix builder
Fredi-raspall May 10, 2025
47fc64e
feat(routing): Prefix convertter as test-only
Fredi-raspall May 10, 2025
75ed9e6
feat(routing): add testing feature
Fredi-raspall May 10, 2025
feaccec
feat(frrmi): rename timeout const and frrmi member
Fredi-raspall May 11, 2025
69902eb
feat(frrmi): replace unix datagram by stream socks
Fredi-raspall May 11, 2025
69a9f16
feat(mgmt): fix removal of configs
Fredi-raspall May 12, 2025
4f4bd90
feat(mgmt): relax validation of BGP config
Fredi-raspall May 13, 2025
4f6c44c
feat(frrmi): simplify connect code
Fredi-raspall May 13, 2025
ba47fd8
feat(mgmt): simplify error prop & improve logs
Fredi-raspall May 13, 2025
4a87727
feat(mgmt): probe FRR before applying a config
Fredi-raspall May 13, 2025
e21ff7b
chore: add chrono as dependency
Fredi-raspall May 13, 2025
886f244
feat(mgmt): sketch display of configs for testing
Fredi-raspall May 13, 2025
570027f
feat(mgmt): add grpc server addr option
sergeymatov May 12, 2025
9505130
feat(mgmt): remove nix dependency
Fredi-raspall May 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 191 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -40,11 +40,11 @@ dpdk-sys = { path = "./dpdk-sys", package = "dataplane-dpdk-sys" }
dpdk-sysroot-helper = { path = "./dpdk-sysroot-helper", package = "dataplane-dpdk-sysroot-helper" }
dplane-rpc = { git = "https://github.com/githedgehog/dplane-rpc.git", version = "1.0.0" }
errno = { path = "./errno", package = "dataplane-errno" }
gateway_config = { git = "https://github.com/githedgehog/gateway-proto", tag = "v0.2.0", version = "0.1.0" }
gateway_config = { git = "https://github.com/githedgehog/gateway-proto", version = "0.2.0" }
id = { path = "./id", package = "dataplane-id" }
interface-manager = { path = "./interface-manager", package = "dataplane-interface-manager" }
net = { path = "./net", package = "dataplane-net", features = ["test_buffer"] }
mgmt = { path = "./mgmt", package = "dataplane-mgmt"}
net = { path = "./net", package = "dataplane-net", features = ["test_buffer"] }
pipeline = { path = "./pipeline", package = "dataplane-pipeline" }
rekon = { path = "./rekon", package = "dataplane-rekon" }
routing = { path = "./routing", package = "dataplane-routing" }
@@ -62,6 +62,7 @@ bolero = { version = "0.13.3", default-features = false, features = [] }
bytes = { version = "1.10.1", default-features = false, features = [] }
clap = { version = "4.5.38", default-features = true, features = [] }
ctrlc = { version = "3.4.7", default-features = false, features = [] }
chrono = { version = "0.4.41", default-features = false, features = ["clock"] }
derive_builder = { version = "0.20.2", default-features = false, features = ["default"] }
doxygen-bindgen = { version = "0.1.3", default-features = false, features = [] }
dyn-iter = { version = "1.0.1", default-features = false, features = [] }
@@ -73,7 +74,7 @@ iptrie = { version = "0.10.3", default-features = false, features = [] }
mio = { version = "1.0.3", default-features = false, features = [] }
multi_index_map = { version = "0.13.0", default-features = false, features = [] }
netdev = { version = "0.34.0", default-features = false, features = [] }
nix = { version = "0.30.1", default-features = false, features = [] }
nix = { version = "0.30.1", default-features = false, features = ["socket"] }
ordermap = { version = "0.5.7", default-features = false, features = [] }
rtnetlink = { version = "0.16.0", default-features = false, features = [] }
serde = { version = "1.0.219", default-features = false, features = [] }
1 change: 1 addition & 0 deletions dataplane/Cargo.toml
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ dpdk = { workspace = true }
dyn-iter = { workspace = true }
id = { workspace = true }
iptrie = { workspace = true }
mgmt = { workspace = true }
mio = { workspace = true, features = ["os-ext", "net"] }
net = { workspace = true, features = ["test_buffer"] }
netdev = { workspace = true }
21 changes: 21 additions & 0 deletions dataplane/src/args.rs
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
#![allow(unused)]

pub(crate) use clap::Parser;
use std::net::SocketAddr;
use tracing::debug;

#[derive(Parser)]
@@ -30,7 +31,16 @@ pub(crate) struct CmdArgs {
driver: Option<String>,
#[arg(long, value_name = "name of kernel interface")]
interface: Vec<String>,

// gRPC server address
#[arg(
long,
value_name = "gRPC server address",
default_value = "[::1]:50051"
)]
grpc_address: String,
}

impl CmdArgs {
pub fn get_driver_name(&self) -> &str {
match &self.driver {
@@ -92,4 +102,15 @@ impl CmdArgs {

out
}

/// Get the gRPC server address
pub fn get_grpc_address(&self) -> SocketAddr {
match self.grpc_address.parse() {
Ok(addr) => addr,
Err(e) => {
eprintln!("Error: Invalid gRPC address '{}': {}", self.grpc_address, e);
panic!("Process receives unexpected gRPC address. Aborting...");
}
}
}
}
4 changes: 3 additions & 1 deletion dataplane/src/drivers/kernel.rs
Original file line number Diff line number Diff line change
@@ -217,7 +217,9 @@ impl DriverKernel {
pkts.push(incoming);
}
Err(e) => {
error!("Failed to parse packet!!:\n{e}");
if interface.name != "lo" {
error!("Failed to parse packet!!:\n{e}");
}
}
}
}
Loading
Loading