-
Notifications
You must be signed in to change notification settings - Fork 6
Release prep part 2: use dpdk (will break the pipeline if merged before unified with part 3) #964
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
base: main
Are you sure you want to change the base?
Conversation
9193aa4 to
5b4d4cc
Compare
5b4d4cc to
a25b971
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the dataplane initialization process by introducing a two-stage initialization system with a dedicated dataplane-init binary and secure configuration passing via sealed memory file descriptors. The key changes include moving default constants to a centralized location, implementing type-safe configuration structures with serialization, and establishing a more robust launch architecture.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| routing/src/router.rs | Updates import paths to use default constants from args module |
| routing/src/rio.rs | Removes default constant definitions now centralized in args module |
| routing/Cargo.toml | Adds args workspace dependency |
| mgmt/src/processor/launch.rs | Updates imports and uses GrpcAddress from args module, removes duplicate type definition |
| mgmt/Cargo.toml | Adds args workspace dependency |
| init/src/main.rs | Complete rewrite implementing new two-stage initialization with hardware scanning and config passing |
| init/Cargo.toml | Adds dependencies for new initialization features |
| dataplane/src/main.rs | Updates to receive configuration via file descriptors instead of command-line parsing |
| dataplane/src/drivers/dpdk.rs | Removes unused init_eal function, updates DriverDpdk::start to return resources |
| dataplane/Cargo.toml | Adds rkyv dependency |
| args/src/lib.rs | Major expansion with secure config types, memfd handling, and LaunchConfiguration structure |
| args/Cargo.toml | Adds numerous dependencies for new functionality |
| Dockerfile | Updates entrypoint to use dataplane-init |
| Cargo.lock | Dependency updates including new crates |
Comments suppressed due to low confidence (1)
dataplane/src/drivers/dpdk.rs:37
yaml\nconfidence: 9\ntags: [logic]\n\n\nTheinit_ealfunction appears to be dead code that was replaced by direct calls toeal::init. Consider removing it to avoid confusion and reduce code maintenance burden.
fn init_eal(args: impl IntoIterator<Item = impl AsRef<str>>) -> Eal {
let rte = eal::init(args);
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
.with_target(true)
.with_thread_ids(true)
.with_line_number(true)
.with_thread_names(true)
.init();
rte
}
init/src/main.rs
Outdated
|
|
||
| #![doc = include_str!("../README.md")] | ||
| #![deny(clippy::pedantic, missing_docs)] | ||
| // #![deny(clippy::pedantic, missing_docs)] // TEMP: don't merge till uncommented |
Copilot
AI
Nov 3, 2025
•
edited by daniel-noland
Loading
edited by daniel-noland
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confidence: 10
tags: [other]This comment explicitly states the code should not be merged until the lint/doc checks are uncommented, which contradicts the PR being ready for review. This temporary bypass should be addressed before merging.
| // #![deny(clippy::pedantic, missing_docs)] // TEMP: don't merge till uncommented | |
| #![deny(clippy::pedantic, missing_docs)] |
| .into_diagnostic() | ||
| .wrap_err("failed to serialize launch configuration as yaml") | ||
| .unwrap(); | ||
| info!("interpreted requested lanunch configuration as\n---\n{launch_config_yaml}"); |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: 'lanunch' should be 'launch'.
| info!("interpreted requested lanunch configuration as\n---\n{launch_config_yaml}"); | |
| info!("interpreted requested launch configuration as\n---\n{launch_config_yaml}"); |
init/src/main.rs
Outdated
| let launch_config = launch_config.to_owned_fd(); | ||
|
|
||
| let io_err = std::process::Command::new( | ||
| "/home/dnoland/code/githedgehog/dataplane/target/x86_64-unknown-linux-gnu/debug/dataplane", |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yaml\nconfidence: 10\ntags: [logic]\n\n\nHardcoded absolute path to a user's home directory. This will fail in any other environment. The path should be made configurable or use a relative path/environment variable.
| use tokio::io; | ||
| use tokio::net::UnixListener; | ||
| use tokio::sync::mpsc::Sender; |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] yaml\nconfidence: 8\ntags: [style]\n\n\nThe import of tokio::io on line 14 is split from other tokio imports on lines 15-16. Consider grouping all tokio imports together for better readability.
| use tokio::io; | |
| use tokio::net::UnixListener; | |
| use tokio::sync::mpsc::Sender; | |
| use tokio::net::UnixListener; | |
| use tokio::sync::mpsc::Sender; | |
| use tokio::io; |
| GrpcAddress::Tcp(addr) => ServerAddress::Tcp(addr), | ||
| GrpcAddress::UnixSocket(path) => ServerAddress::Unix(path.to_path_buf()), | ||
| args::GrpcAddress::Tcp(addr) => ServerAddress::Tcp(addr), | ||
| args::GrpcAddress::UnixSocket(path) => ServerAddress::Unix(path.into()), |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] yaml\nconfidence: 7\ntags: [style]\n\n\nThe change from path.to_path_buf() to path.into() is less explicit about the type conversion happening. While functionally equivalent, the original was clearer about converting to PathBuf.
| args::GrpcAddress::UnixSocket(path) => ServerAddress::Unix(path.into()), | |
| args::GrpcAddress::UnixSocket(path) => ServerAddress::Unix(path.to_path_buf()), |
| // if args.tracing_config_generate() { | ||
| // let out = get_trace_ctl() | ||
| // .as_config_string() | ||
| // .unwrap_or_else(|e| e.to_string()); | ||
| // println!("{out}"); | ||
| // std::process::exit(0); | ||
| // } |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yaml\nconfidence: 8\ntags: [other]\n\n\nCommented-out code should be removed rather than left in the codebase. If this functionality is needed in the future, it can be recovered from version control.
| // if args.tracing_config_generate() { | |
| // let out = get_trace_ctl() | |
| // .as_config_string() | |
| // .unwrap_or_else(|e| e.to_string()); | |
| // println!("{out}"); | |
| // std::process::exit(0); | |
| // } |
| #[rkyv(attr(derive(PartialEq, Eq, Debug)))] | ||
| pub enum GrpcAddress { | ||
| Tcp(SocketAddr), | ||
| UnixSocket(String), |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] yaml\nconfidence: 7\ntags: [other]\n\n\nThe GrpcAddress::UnixSocket variant changed from PathBuf to String. This is less type-safe as PathBuf better represents filesystem paths and their associated operations.
| UnixSocket(String), | |
| UnixSocket(PathBuf), |
46cbe0e to
d797cd7
Compare
a25b971 to
1dee052
Compare
|
|
||
| [dependencies] | ||
| # internal | ||
| args = { workspace = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the mgmt crate need anything from args? Sounds like a weird "backwards" dependency.
|
|
||
| [dependencies] | ||
| # internal | ||
| args = { workspace = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
| cpi_sock_path: Some(DEFAULT_DP_UX_PATH.to_string()), | ||
| cli_sock_path: Some(DEFAULT_DP_UX_PATH_CLI.to_string()), | ||
| frrmi_sock_path: Some(DEFAULT_FRR_AGENT_PATH.to_string()), | ||
| cpi_sock_path: Some(args::DEFAULT_DP_UX_PATH.to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. This reveals the dependency. I see the goal, but personally dislike this in that you're making an internal function depend on an external thing. IMO:
- every internal function (crate) should define its defaults.
- those should be made available to users of the crate.
I see the merit of defining the defaults closer to the user/caller. But then we should ditch the defaults from the inner functions (routing in this case) so that we don't have that "backwards" dependency and require callers to always provide specific values (which they can default).
That said, leave it like that.
Fredi-raspall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Since we can't merge this now as-is without breaking the pipeline, can we "freeze" this branch as an integration one on which we can stack further developments that don't break the pipeline?
|
@daniel-noland There seems to be an issue with the memfd in the CI job. @Frostman could it be that this is caused by not invoking |
qmonnet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The args crate is now has a wider scope: it is not just responsible
for parsing and validating arguments, it is (partly) responsible for
handing the dataplane a memfd file with parsed and acted on data.
I'm not sure I understand: Why reuse the args crate for that? Wouldn't it make more sense to add a new crate for handling the memfd file, specifically? I liked the idea of having something a bit more self-contained for parsing the arguments.
If it is necessary to have the new parts in args, should we consider renaming that crate?
args/src/lib.rs
Outdated
| /// A type wrapper around [`MemFile`] for memfd files which are emphatically NOT intended for any kind of data mutation | ||
| /// ever again. | ||
| /// | ||
| /// Multiple protections are in place to deny all attempts to mutat the memory contents of these files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Multiple protections are in place to deny all attempts to mutat the memory contents of these files. | |
| /// Multiple protections are in place to deny all attempts to mutate the memory contents of these files. |
51a8366 to
b0f0f8c
Compare
1dee052 to
2cd696e
Compare
7f67473 to
08722af
Compare
This commit takes care of the actual passing of a memfd from dataplane init down into dataplane after a hardware scan and argument parsing. It basically takes care of the TODO from last time. Signed-off-by: Daniel Noland <daniel@githedgehog.com>
08722af to
c619ba2
Compare
With this commit the dataplane now consumes and acts on the memfd created by dataplane init from the previous commit. Signed-off-by: Daniel Noland <daniel@githedgehog.com>
c619ba2 to
6afb8b5
Compare
|
Moved this back to draft since we may need to rework this a bit. Now that the kernel driver has good performance we should only merge this with a working kernel driver. |
on top of #963
this is up for early review to facilitate cooperation and minimize merge conflicts.
It is still a little too messy to merge but it does deserve discussion.
At the same time, rebase onto this is
but I don't really know what to do about that at this point.