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.
This is a bugfix for TCP statistics visible from opteadm dump-tcp-flows.
| #![feature(extern_types)] | ||
| #![feature(panic_info_message)] | ||
| #![no_std] | ||
| #![allow(non_camel_case_types)] |
There was a problem hiding this comment.
Redundant allow wrt. below block dedicated to ip.rs/bindgen.
| 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.
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.
| "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.
Mandated by latest nightly compilers after a related change in rust 1.77.
.github/buildomat/jobs/opte-api.sh
Outdated
| #: 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.
Dumb question, but why doesn't rust-toolchain.toml work here?
There was a problem hiding this comment.
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_macrofrom 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+Syncon, e.g.,KStatNamed.