Skip to content
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

mlx5 #404

Merged
merged 52 commits into from
Jul 28, 2021
Merged

mlx5 #404

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
80f718b
weird Cargo.lock changes
Ramla-I Nov 6, 2020
233e782
fixed cargo
Ramla-I Nov 6, 2020
0d1785f
cargo changes
Ramla-I Dec 10, 2020
a37d083
latest main update
Ramla-I Dec 10, 2020
0477430
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Jan 28, 2021
94d2c8d
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Feb 14, 2021
10f033f
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Mar 23, 2021
c9d9721
started crates
Ramla-I Mar 24, 2021
9587d7f
initialization segment
Ramla-I Apr 9, 2021
54c1f14
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Apr 9, 2021
9a4345a
initialization function
Ramla-I Apr 9, 2021
5fe1fe6
added functions for command interface
Ramla-I Apr 12, 2021
c511528
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Apr 19, 2021
ba834b8
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Apr 20, 2021
484aa03
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Apr 27, 2021
2d80219
updates
Ramla-I Apr 30, 2021
82e25bc
cargo.lock
Ramla-I Apr 30, 2021
3d7f50f
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I May 17, 2021
b1d194a
...
Ramla-I May 21, 2021
9f6e765
basic commands working
Ramla-I Jun 1, 2021
489d7d0
manage pages command
Ramla-I Jun 7, 2021
f7840a4
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Jun 8, 2021
fd531c8
way too may init pages requested
Ramla-I Jun 15, 2021
53c44a0
fixed output status issues
Ramla-I Jun 21, 2021
0c6bb41
solved init pages issue, mailbox ptr has to be aligned
Ramla-I Jun 29, 2021
22f87dd
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Jun 29, 2021
cbd1791
completed documentation, needs a review
Ramla-I Jul 2, 2021
f843f48
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Jul 6, 2021
4db0826
updated comments
Ramla-I Jul 6, 2021
a9641ed
cleaned code
Ramla-I Jul 6, 2021
b60bfb4
updated pci passthrough book
Ramla-I Jul 6, 2021
5d7767c
PR improvements
Ramla-I Jul 16, 2021
528a3ef
pr fixes
Ramla-I Jul 19, 2021
a5371a1
PR changes
Ramla-I Jul 19, 2021
27458b9
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Jul 23, 2021
1f06fac
doc changes
Ramla-I Jul 23, 2021
13140ba
used num_enum to derive from
Ramla-I Jul 23, 2021
b7c4505
debug
Ramla-I Jul 23, 2021
7300024
fixed incorrect functions to write to command queue entry
Ramla-I Jul 23, 2021
3039ddb
removed unused code
Ramla-I Jul 23, 2021
6ca8a23
removed comment
Ramla-I Jul 23, 2021
9ab39ee
removed white space
Ramla-I Jul 23, 2021
e62652a
removed {} from around return statements
Ramla-I Jul 27, 2021
acab8fc
removed unknown from enums
Ramla-I Jul 27, 2021
f92bd2d
fix spacing in book file
kevinaboos Jul 28, 2021
798bb35
remove false doc link
kevinaboos Jul 28, 2021
b8716ef
renamed mellanox crate
Ramla-I Jul 28, 2021
ca6eb97
Merge branch 'theseus_main' of https://github.com/theseus-os/Theseus …
Ramla-I Jul 28, 2021
2236766
Merge branch 'mlx5_pr' of https://github.com/Ramla-I/Theseus into mlx…
Ramla-I Jul 28, 2021
ecd6a2a
allow private doc links
kevinaboos Jul 28, 2021
f5addb7
Merge branch 'mlx5_pr' of github.com:Ramla-I/Theseus into mlx5_pr
kevinaboos Jul 28, 2021
7dd12ab
build private intra-doc links for all Theseus crates
kevinaboos Jul 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 68 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ RUSTDOC_OUT_FILE := $(RUSTDOC_OUT)/___Theseus_Crates___/index.html
## The entire project is built as normal using the `cargo doc` command (`rustdoc` under the hood).
docs: doc
doc: check_rustc
@cargo doc --workspace --no-deps $(addprefix --exclude , $(APP_CRATE_NAMES))
@RUSTDOCFLAGS="$$RUSTDOCFLAGS -A private_intra_doc_links" cargo doc --workspace --no-deps $(addprefix --exclude , $(APP_CRATE_NAMES))
@rustdoc --output target/doc --crate-name "___Theseus_Crates___" $(ROOT_DIR)/kernel/_doc_root.rs
@rm -rf $(RUSTDOC_OUT)
@mkdir -p $(RUSTDOC_OUT)
Expand Down
7 changes: 7 additions & 0 deletions book/src/running/virtual_machine/pci_passthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ e.g. `echo 15b3 1019 > /sys/bus/pci/drivers/vfio-pci/new_id`

Now, QEMU can be launched with direct access to the device.

### Return device to the Host OS
To reset the device, you can either reboot the system or return the device to the host OS using the following commands (replacing `$slot_info` with the value previously retrieved):
```sh
echo 1 > /sys/bus/pci/devices/$slot_info/remove
echo 1 > /sys/bus/pci/rescan
```

### Note: access for unprivileged users
To give access to an unprivileged user to this VFIO device, find the IOMMU group the device belongs to:
```sh
Expand Down
2 changes: 2 additions & 0 deletions kernel/device_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ path = "../ixgbe"
[dependencies.io]
path = "../io"

[dependencies.mlx5]
path = "../mlx5"

[lib]
crate-type = ["rlib"]
5 changes: 5 additions & 0 deletions kernel/device_manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ extern crate fatfs;
extern crate io;
extern crate bare_io;
#[macro_use] extern crate derive_more;
extern crate mlx5;

use mpmc::Queue;
use event_types::Event;
Expand Down Expand Up @@ -121,6 +122,10 @@ pub fn init(key_producer: Queue<Event>, mouse_producer: Queue<Event>) -> Result<
ixgbe_devs.push(ixgbe_nic);
continue;
}
if dev.vendor_id == mlx5::MLX_VEND && dev.device_id == mlx5::CONNECTX5_DEV {
info!("mlx5 PCI device found at: {:?}", dev.location);
mlx5::ConnectX5Nic::init(dev)?;
}

// here: check for and initialize other ethernet cards
}
Expand Down
34 changes: 34 additions & 0 deletions kernel/mlx5/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
authors = ["Ramla Ijaz <[email protected]>"]
name = "mlx5"
description = "Driver for the Mellanox ConnectX-5 NIC"
version = "0.1.0"
build = "../../build.rs"

[dependencies]
spin = "0.9.0"
owning_ref = { git = "https://github.com/theseus-os/owning-ref-rs" }

[dependencies.log]
version = "0.4.8"

[dependencies.irq_safety]
git = "https://github.com/theseus-os/irq_safety"

[dependencies.memory]
path = "../memory"

[dependencies.pci]
path = "../pci"

[dependencies.nic_initialization]
path = "../nic_initialization"

[dependencies.mlx_ethernet]
path = "../mlx_ethernet"

[dependencies.kernel_config]
path = "../kernel_config"

[lib]
crate-type = ["rlib"]
Loading