-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend the Mellanox driver to support packet transmit (#490)
* `test_mlx5`: an application crate for testing the Mellanox driver * `device_manger`: now initializes the Mellanox NIC * `mlx5_ethernet`: extended the command queue to support more commands and added additional modules for send queues, receive queues, completion queues, flow tables, etc. * `mlx5`: added additional command executions to create the send and receive queues, and supporting objects.
- Loading branch information
Showing
17 changed files
with
4,027 additions
and
506 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "test_mlx5" | ||
version = "0.1.0" | ||
authors = ["Ramla Ijaz <ijazramla@gmail.com>"] | ||
build = "../../build.rs" | ||
|
||
[dependencies] | ||
|
||
[dependencies.log] | ||
version = "0.4.8" | ||
|
||
[dependencies.terminal_print] | ||
path = "../../kernel/terminal_print" | ||
|
||
[dependencies.ixgbe] | ||
path = "../../kernel/ixgbe" | ||
|
||
[dependencies.mlx5] | ||
path = "../../kernel/mlx5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//! Application which checks the functionality of the mlx5 driver. | ||
//! Currently we use functions directly provided by the driver for sending and receiving packets. | ||
|
||
#![no_std] | ||
extern crate alloc; | ||
// #[macro_use] extern crate log; | ||
#[macro_use] extern crate terminal_print; | ||
extern crate mlx5; | ||
extern crate ixgbe; | ||
|
||
use alloc::vec::Vec; | ||
use alloc::string::String; | ||
use ixgbe::{ | ||
test_packets::create_raw_packet, | ||
}; | ||
|
||
|
||
pub fn main(_args: Vec<String>) -> isize { | ||
println!("mlx5 test application"); | ||
|
||
match rmain() { | ||
Ok(()) => { | ||
println!("mlx5 test was successful"); | ||
return 0; | ||
} | ||
Err(e) => { | ||
println!("mlx5 test failed with error : {:?}", e); | ||
return -1; | ||
} | ||
} | ||
} | ||
|
||
fn rmain() -> Result<(), &'static str> { | ||
|
||
let mut nic = mlx5::get_mlx5_nic().ok_or("mlx5 nic isn't initialized")?.lock(); | ||
let mac_address = nic.mac_address(); | ||
let num_packets = 8192; | ||
|
||
let buffer = create_raw_packet(&[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF], &mac_address, &[1;46])?; | ||
let buffer_slice = buffer.as_slice(0, 46)?; | ||
|
||
for _ in 0..num_packets { | ||
nic.send_fastpath(buffer.phys_addr, buffer_slice); | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.