Skip to content

Commit

Permalink
Rename core and utils modules
Browse files Browse the repository at this point in the history
  • Loading branch information
eshikafe committed Sep 24, 2024
1 parent 1c99103 commit bece139
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
File renamed without changes.
11 changes: 6 additions & 5 deletions src/core/traffic_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
// #include "utils/simd.h"
// #include "utils/time.h"

use traffic_class_initializer_types::*;
use std::collections::HashMap;
use once_cell::sync::Lazy;
use lazy_static::lazy_static;

// using bess::utils::extended_priority_queue;

// A large default priority.
Expand All @@ -18,6 +23,7 @@ const STRIDE1: u32 = 1 << 20;
const QUANTUM: u32 = 1 << 10;

// Resource types that can be accounted for.
#[derive(PartialEq, Eq, Hash)]
pub enum Resource {
Count = 0, // Count of how many times scheduled
Cycle, // CPU cycles
Expand Down Expand Up @@ -78,10 +84,6 @@ mod traffic_class_initializer_types {
}
}

use traffic_class_initializer_types::*;
use std::collections::HashMap;
use once_cell::sync::Lazy;

const TRAFFIC_POLICY_NAME: [&str; TrafficPolicy::NumPolicies as usize] = [
"priority",
"weighted_fair",
Expand All @@ -107,7 +109,6 @@ static RESOURCE_NAME: Lazy<HashMap<Resource, &'static str>> = Lazy::new(|| {
m.insert(Resource::Bit, "bit");
m
});

/* acc += x */
// #define ACCUMULATE(acc, x) \
// { \
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions src/core/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ pub enum WorkerStatus {
Finished,
}


struct PacketPool;
struct Task;


pub struct Worker {
status: WorkerStatus,
wid: usize, // always [0, K_MAX_WORKERS - 1]
Expand Down Expand Up @@ -69,10 +67,10 @@ impl Worker {
// ----------------------------------------------------------------------
// functions below are invoked by worker threads
// ----------------------------------------------------------------------

pub fn is_pause_requested(&self) -> bool {
self.status == WorkerStatus::Paused
}

// Block myself. Return nonzero if the worker needs to die
pub fn block_worker(&self) -> i32 {
todo!();
Expand Down

0 comments on commit bece139

Please sign in to comment.