Skip to content

Conversation

@Kyle6012
Copy link
Owner

This commit addresses several issues identified during a codebase review:

  • Corrected typos in README.md and Cargo.toml (edition year).
  • Fixed a syntax error in a test within netmap-min-sys/src/lib.rs.
  • Enhanced Frame to use Cow<'a, [u8]>, allowing it to handle both borrowed (sys) and owned (fallback) data. This makes the Frame API more consistent across modes.
  • Updated fallback::FallbackRxRing to return Option<Frame<'static>> using owned data.
  • Added fallback::create_fallback_channel to facilitate testing of connected fallback rings.
  • Refactored tests/mock.rs to use create_fallback_channel and corrected test logic for ring capacity. Fallback tests now pass.
  • Adjusted src/lib.rs prelude for better conditional exports based on features.
  • Updated Cargo.toml to correctly associate core_affinity with fallback and sys features, and reed-solomon-erasure with the sys feature for relevant examples.
  • Gated sys-dependent examples (ping_pong.rs, sliding_window_arq.rs, fec.rs) with #[cfg(feature = "sys")] to prevent compilation errors when the sys feature is not active.
  • Modified examples/thread_per_ring.rs to operate conditionally based on the sys feature, allowing it to compile and run core pinning logic in fallback mode.
  • Addressed various clippy warnings, including unused imports, incorrect doc comment styles, and unnecessary mutable variables. Added #[allow(unused_imports)] for a thiserror macro that clippy flagged under specific fallback-only builds, believed to be a false positive.

Note: Testing of the sys feature was not possible in the current sandboxed environment due to missing Netmap system dependencies. The changes aim to ensure the fallback mode is robust and well-tested.

This commit addresses several issues identified during a codebase review:

- Corrected typos in README.md and Cargo.toml (edition year).
- Fixed a syntax error in a test within `netmap-min-sys/src/lib.rs`.
- Enhanced `Frame` to use `Cow<'a, [u8]>`, allowing it to handle both borrowed (sys) and owned (fallback) data. This makes the `Frame` API more consistent across modes.
- Updated `fallback::FallbackRxRing` to return `Option<Frame<'static>>` using owned data.
- Added `fallback::create_fallback_channel` to facilitate testing of connected fallback rings.
- Refactored `tests/mock.rs` to use `create_fallback_channel` and corrected test logic for ring capacity. Fallback tests now pass.
- Adjusted `src/lib.rs` prelude for better conditional exports based on features.
- Updated `Cargo.toml` to correctly associate `core_affinity` with `fallback` and `sys` features, and `reed-solomon-erasure` with the `sys` feature for relevant examples.
- Gated `sys`-dependent examples (`ping_pong.rs`, `sliding_window_arq.rs`, `fec.rs`) with `#[cfg(feature = "sys")]` to prevent compilation errors when the `sys` feature is not active.
- Modified `examples/thread_per_ring.rs` to operate conditionally based on the `sys` feature, allowing it to compile and run core pinning logic in fallback mode.
- Addressed various clippy warnings, including unused imports, incorrect doc comment styles, and unnecessary mutable variables. Added `#[allow(unused_imports)]` for a `thiserror` macro that clippy flagged under specific fallback-only builds, believed to be a false positive.

Note: Testing of the `sys` feature was not possible in the current sandboxed environment due to missing Netmap system dependencies. The changes aim to ensure the `fallback` mode is robust and well-tested.
This commit addresses several issues identified during a codebase review:

- Corrected typos in README.md and Cargo.toml (edition year).
- Fixed a syntax error in a test within `netmap-min-sys/src/lib.rs`.
- Enhanced `Frame` to use `Cow<'a, [u8]>`, allowing it to handle both borrowed (sys) and owned (fallback) data. This makes the `Frame` API more consistent across modes.
- Updated `fallback::FallbackRxRing` to return `Option<Frame<'static>>` using owned data.
- Added `fallback::create_fallback_channel` to facilitate testing of connected fallback rings.
- Refactored `tests/mock.rs` to use `create_fallback_channel` and corrected test logic for ring capacity. Fallback tests now pass.
- Adjusted `src/lib.rs` prelude for better conditional exports based on features.
- Updated `Cargo.toml` to correctly associate `core_affinity` with `fallback` and `sys` features, and `reed-solomon-erasure` with the `sys` feature for relevant examples.
- Gated `sys`-dependent examples (`ping_pong.rs`, `sliding_window_arq.rs`, `fec.rs`) with `#[cfg(feature = "sys")]` to prevent compilation errors when the `sys` feature is not active.
- Modified `examples/thread_per_ring.rs` to operate conditionally based on the `sys` feature, allowing it to compile and run core pinning logic in fallback mode.
- Addressed various clippy warnings, including unused imports, incorrect doc comment styles, and unnecessary mutable variables. Added `#[allow(unused_imports)]` for a `thiserror` macro that clippy flagged under specific fallback-only builds, believed to be a false positive.

Note: Testing of the `sys` feature was not possible in the current sandboxed environment due to missing Netmap system dependencies. The CI failure is related to the C-level Netmap kernel module compilation against an incompatible kernel version in the CI environment, not directly due to these Rust-level changes.
@Kyle6012 Kyle6012 merged commit 726bf73 into main Jun 25, 2025
1 of 13 checks passed
@Kyle6012 Kyle6012 deleted the jules/codebase-cleanup-and-fixes branch June 26, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants