Skip to content

Commit eb2af41

Browse files
author
rstade
committed
adapted to rustc 1.62.0-nightly and bindgen 0.59.2, replaced asm.rs with native rust library code
1 parent 9e04ad3 commit eb2af41

39 files changed

Lines changed: 13098 additions & 19875 deletions

File tree

.idea/misc.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@ case $TASK in
128128
popd
129129
done
130130
;;
131-
131+
huge_pages)
132+
sudo dpdk-hugepages.py -p 2M --setup 8G
133+
sudo dpdk-hugepages.py -s
134+
;;
132135
test)
133136
native
137+
huge_pages
134138
pushd $BASE_DIR/framework
135139
export LD_LIBRARY_PATH="${NATIVE_LIB_PATH}:${DPDK_LD_PATH}:${TOOLS_BASE}:${LD_LIBRARY_PATH}"
136140
# sudo -E env "PATH=$PATH" ${CARGO} test --release
@@ -210,6 +214,7 @@ case $TASK in
210214
clean: Remove all built files
211215
dist_clean: Remove all support files
212216
env: Environment variables, run as eval \`./build.sh env\`.
217+
huge_pages: setup huge pages for dpdk
213218
endhelp
214219
;;
215220
esac

framework/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "e2d2"
3-
version = "1.0.6"
4-
authors = ["Aurojit Panda <apanda@cs.berkeley.edu>", "rainer <rainer@spacebandit.de>"]
3+
version = "1.0.7"
4+
authors = ["Aurojit Panda <apanda@cs.berkeley.edu>", "Rainer Stademann"]
55
build = "build.rs"
66

77
[lib]

framework/src/interface/port/phy_port.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(dead_code)]
12
use super::super::{PacketRx, PacketTx};
23
use super::PortStats;
34
use allocators::*;
@@ -20,6 +21,7 @@ use native::zcsi::{
2021
rte_kni_rx_burst, rte_kni_tx_burst, KniPortParams, MBuf, RteFdirConf, RteFlowError, RteKni,
2122
};
2223
use regex::Regex;
24+
use std::arch::x86_64::_rdtsc;
2325
use std::cell::RefCell;
2426
use std::cmp::min;
2527
use std::collections::VecDeque;
@@ -33,7 +35,7 @@ use std::rc::Rc;
3335
use std::string::ToString;
3436
use std::sync::atomic::Ordering;
3537
use std::sync::Arc;
36-
use utils::{rdtsc_unsafe, FiveTupleV4};
38+
use utils::FiveTupleV4;
3739

3840
/// A DPDK based PMD port. Send and receive should not be called directly on this structure but on the port queue
3941
/// structure instead.
@@ -284,7 +286,7 @@ impl PortQueue {
284286

285287
#[inline]
286288
fn recv_queue(&self, pkts: &mut [*mut MBuf], to_recv: u16) -> errors::Result<u32> {
287-
let start = rdtsc_unsafe();
289+
let start = unsafe { _rdtsc() };
288290
unsafe {
289291
let recv = if self.port.is_native_kni() {
290292
rte_kni_rx_burst(self.port.kni.unwrap().as_ptr(), pkts.as_mut_ptr(), to_recv as u32)
@@ -296,7 +298,7 @@ impl PortQueue {
296298
self.stats_rx.stats.store(update, Ordering::Relaxed);
297299

298300
if recv > 0 {
299-
let update = self.stats_rx.cycles.load(Ordering::Relaxed) + (rdtsc_unsafe() - start);
301+
let update = self.stats_rx.cycles.load(Ordering::Relaxed) + (_rdtsc() - start);
300302
self.stats_rx.cycles.store(update, Ordering::Relaxed);
301303
}
302304
Ok(recv)
@@ -420,7 +422,7 @@ impl PortQueueTxBuffered {
420422

421423
#[inline]
422424
fn send_queue(&mut self, pkts: &mut [*mut MBuf], to_send: u32) -> errors::Result<u32> {
423-
let stamp = rdtsc_unsafe();
425+
let stamp = unsafe { _rdtsc() };
424426
if self.tx_queue_is_empty() {
425427
let sent = self.port_queue.try_send(pkts, to_send);
426428
if sent < to_send {

framework/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![recursion_limit = "1024"]
2-
#![feature(asm)]
32
#![feature(log_syntax)]
43
#![feature(box_syntax)]
54
#![feature(min_specialization)]
@@ -9,7 +8,6 @@
98
#![feature(allocator_api)]
109
#![allow(unused_features)]
1110
#![feature(integer_atomics)]
12-
#![feature(llvm_asm)]
1311
#![allow(unused_doc_comments)]
1412
#![cfg_attr(feature = "dev", allow(unstable_features))]
1513
// Need this since PMD port construction triggers too many arguments.

framework/src/native/zcsi/rssflows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ impl rte_eth_dev_info {
6161
max_vfs: 0,
6262
max_vmdq_pools: 0,
6363
rx_seg_capa: rte_eth_rxseg_capa {
64+
_bitfield_align_1: [],
6465
_bitfield_1: Default::default(),
6566
max_nseg: 0,
6667
reserved: 0,

0 commit comments

Comments
 (0)