-
Notifications
You must be signed in to change notification settings - Fork 9
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
General Repository Cleanup #480
Conversation
Since the recent refactor, count + bytes have all been ending up in `segs_in`/`bytes_in`, which can make for some confusing reading at the best of times.
Unfortunately the Arc around non Send+Sync will need some fairly intrusive bound insertion, by the looks of things. When we do that it should be its own PR.
match *dir { | ||
TcpDirection::In { .. } => { | ||
tfes.segs_in += 1; | ||
tfes.bytes_in += pkt_len; | ||
} | ||
TcpDirection::Out { .. } => { | ||
tfes.segs_out += 1; | ||
tfes.bytes_out += pkt_len; | ||
} | ||
} |
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.
This is a bugfix for TCP statistics visible from opteadm dump-tcp-flows
.
@@ -8,7 +8,6 @@ | |||
#![feature(extern_types)] | |||
#![feature(panic_info_message)] | |||
#![no_std] | |||
#![allow(non_camel_case_types)] |
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.
Redundant allow
wrt. below block dedicated to ip.rs/bindgen.
@@ -307,13 +308,13 @@ struct XdeDev { | |||
#[no_mangle] | |||
unsafe extern "C" fn _init() -> c_int { | |||
xde_devs.init(KRwLockType::Driver); | |||
mac::mac_init_ops(&mut xde_devops, XDE_STR); | |||
mac::mac_init_ops(addr_of_mut!(xde_devops), XDE_STR); |
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.
This (and any other addr_of
/addr_of_mut
) is a UB fix we've been warned about for a month or two, but will become mandatory in the next edition.
@@ -2,7 +2,7 @@ | |||
"arch": "x86_64", | |||
"code-model": "kernel", | |||
"cpu": "x86-64", | |||
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", | |||
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", |
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.
Mandated by latest nightly compilers after a related change in rust 1.77.
.github/buildomat/jobs/opte-api.sh
Outdated
@@ -3,7 +3,7 @@ | |||
#: name = "opte-api" | |||
#: variety = "basic" | |||
#: target = "helios-2.0" | |||
#: rust_toolchain = "nightly-2024-02-06" | |||
#: rust_toolchain = "nightly-2024-04-25" |
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.
Dumb question, but why doesn't rust-toolchain.toml
work here?
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.
I believe this is down to us needing several nightly format options from cargo fmt
across the repo. However, everything apart from XDE compiles on a stable toolchain version (as XDE is reliant on several unstable feature flags).
This has also caught a bad feature flag in one spot (debug_assert vs. debug_assertions).
This PR brings some code cleanliness changes and a bugfix:
addr_of_mut!()
/addr_of!()
macros where shared mutable statics are used as part of MAC registration.c""
syntax post-rust 1.77.0 (for non-bindgen code, at least).derror_macro
from being pulled into Omicron's lockfile.I spent a little time looking into the non-Send+Sync in Arc clippy lints, but those will require a separate PR to assess the safety of
impl Send+Sync
on, e.g.,KStatNamed
.