Skip to content

Commit 586a08a

Browse files
author
rstade
committed
v0.5.1, rte_kni_update_link (untested), Note for using KNI: starting with 0.5.0 and DPDK 18.11 "carrier=on" required as parameter to kernel module rte_kni!
1 parent c2f5aa2 commit 586a08a

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

framework/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "e2d2"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
authors = ["Aurojit Panda <apanda@cs.berkeley.edu>", "rainer <rainer@spacebandit.de>"]
55
build = "build.rs"
66

framework/src/interface/port/phy_port.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ pub struct PmdPort {
4848
should_close: bool,
4949
csumoffload: bool,
5050
port: u16,
51-
kni: Option<Unique<RteKni>>,
5251
//must use Unique because raw ptr does not implement Send
53-
linux_if: Option<String>,
52+
kni: Option<Unique<RteKni>>,
5453
// used for kni interfaces
54+
linux_if: Option<String>,
5555
rxqs: u16,
5656
txqs: u16,
5757
n_rx_desc: u16,
@@ -571,7 +571,7 @@ impl PmdPort {
571571
txqs: 1,
572572
n_tx_desc: 1,
573573
n_rx_desc: 1,
574-
should_close: true, // sta, not clear what this is used for, and if to set true or false
574+
should_close: true, // closes the eth device and frees all resources, when PmdPort is dropped
575575
csumoffload: false,
576576
driver: DriverType::Unknown,
577577
stats_rx: (0..1).map(|_| Arc::new(PortStats::new())).collect(),

framework/src/native/zcsi/zcsi.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ extern "C" {
866866
) -> i32;
867867
pub fn free_pmd_port(port: u16) -> i32;
868868
pub fn fdir_get_infos(pmdport_id: u16);
869-
pub fn eth_rx_burst(port: u16, qid: u16, pkts: *mut *mut MBuf, len: u16) -> u32; // sta
869+
pub fn eth_rx_burst(port: u16, qid: u16, pkts: *mut *mut MBuf, len: u16) -> u32;
870870
pub fn eth_rx_queue_count(port_id: u16, queue_id: u16) -> i32;
871871
// rte_eth_tx_burst is inline C, we cannot directly use it here:
872872
pub fn eth_tx_burst(port: u16, qid: u16, pkts: *mut *mut MBuf, len: u16) -> u16;
@@ -896,12 +896,13 @@ extern "C" {
896896

897897
//usually called already by rte_eal_init when e.g. --vdev netkni0:
898898
pub fn rte_kni_init(max_kni_ifaces: u32);
899-
pub fn kni_alloc(port_id: u16, kni_port_params: *mut KniPortParams) -> *mut RteKni; // sta
900-
pub fn rte_kni_release(kni: *mut RteKni) -> i32; //sta
901-
pub fn rte_kni_handle_request(kni: *mut RteKni) -> i32; //sta
902-
pub fn rte_kni_rx_burst(kni: *mut RteKni, pkts: *mut *mut MBuf, len: u32) -> u32; //sta
903-
pub fn rte_kni_tx_burst(kni: *mut RteKni, pkts: *mut *mut MBuf, len: u32) -> u32; //sta
899+
pub fn kni_alloc(port_id: u16, kni_port_params: *mut KniPortParams) -> *mut RteKni;
900+
pub fn rte_kni_release(kni: *mut RteKni) -> i32;
901+
pub fn rte_kni_handle_request(kni: *mut RteKni) -> i32;
902+
pub fn rte_kni_rx_burst(kni: *mut RteKni, pkts: *mut *mut MBuf, len: u32) -> u32;
903+
pub fn rte_kni_tx_burst(kni: *mut RteKni, pkts: *mut *mut MBuf, len: u32) -> u32;
904904
pub fn rte_kni_get_name(kni: *const RteKni) -> *const c_char;
905+
pub fn rte_kni_update_link(kni: *mut RteKni, linkup: u32) -> i32;
905906

906907
pub fn rte_log_set_global_level(level: RteLogLevel);
907908
pub fn rte_log_get_global_level() -> u32;

0 commit comments

Comments
 (0)