Skip to content

Refactor dladm crate#1134

Open
daniel-levin wants to merge 1 commit intomasterfrom
single-dladm-commit
Open

Refactor dladm crate#1134
daniel-levin wants to merge 1 commit intomasterfrom
single-dladm-commit

Conversation

@daniel-levin
Copy link
Copy Markdown

This is a large, but self-contained change that
fixes up a few things in the dladm crate. In the
future I have Big Plans for running Bayesian
optimization loops on various link parameters,
and will need to use this crate. While this change is merely preparatory, I decided to fix some
things along the way.

First, dladm_handle_t is changed to no longer use the empty enum as an FFI type, which is unsound.
See: https://doc.rust-lang.org/nomicon/ffi.html

The crate no longer shells out to dladm.
It struck me as a bit gross to shell out to dladm
when we're linking against libdladm in the first place.

I renamed Handle to Dladm and called its most imporant method describe. In addition, some fields that
dladm furnishes us with anyway (upon calling
dladm_name2info) have been added to LinkInfo and
exported for use in Propolis.

Several disabled unit tests are added, which are useful for hacking on this crate.

Finally, I made it clear that this crate does no allocations. It's just one less thing to think about when reasoning about code linked into our VMM.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 385 files.

Valid Invalid Ignored Fixed
293 1 91 0
Click to see the invalid file list
  • crates/dladm/tests/dladm.rs
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Comment thread crates/dladm/tests/dladm.rs
This is a large, but self-contained change that
fixes up a few things in the dladm crate. In the
future I have Big Plans for running Bayesian
optimization loops on various link parameters,
and will need to use this crate. While this change is
merely preparatory, I decided to fix some
things along the way.

First, dladm_handle_t is changed to no longer use the
empty enum as an FFI type, which is unsound.
See: https://doc.rust-lang.org/nomicon/ffi.html

The crate no longer shells out to dladm.
It struck me as a bit gross to shell out to dladm
when we're linking against libdladm in the first place.

I renamed Handle to Dladm and called its most imporant
method describe. In addition, some fields that
dladm furnishes us with anyway (upon calling
dladm_name2info) have been added to LinkInfo and
exported for use in Propolis.

Several disabled unit tests are added, which are useful for
hacking on this crate.

Finally, I made it clear that this crate does no allocations.
It's just one less thing to think about when reasoning about
code linked into our VMM.

Update crates/dladm/tests/dladm.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant