Skip to content

Commit

Permalink
[catpowder] Enhancement: Improve XDP LibOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ppenna committed Jul 8, 2024
1 parent 0b0b411 commit 0939093
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/rust/catpowder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
mod win;

#[cfg(target_os = "windows")]
pub use win::runtime::CatpowderRuntime;
pub use win::runtime::SharedCatpowderRuntime;

#[cfg(target_os = "linux")]
mod linux;

#[cfg(target_os = "linux")]
pub use linux::LinuxRuntime as CatpowderRuntime;
pub use linux::LinuxRuntime as SharedCatpowderRuntime;
10 changes: 5 additions & 5 deletions src/rust/catpowder/win/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use ::std::borrow::{

/// A LibOS built on top of Windows XDP.
#[derive(Clone)]
pub struct CatpowderRuntime(SharedObject<CatpowderRuntimeInner>);
pub struct SharedCatpowderRuntime(SharedObject<CatpowderRuntimeInner>);

/// The inner state of the Catpowder runtime.
struct CatpowderRuntimeInner {
Expand All @@ -54,7 +54,7 @@ struct CatpowderRuntimeInner {
//======================================================================================================================
// Implementations
//======================================================================================================================
impl CatpowderRuntime {
impl SharedCatpowderRuntime {
///
/// Number of buffers in the rings.
///
Expand All @@ -64,7 +64,7 @@ impl CatpowderRuntime {
const RING_LENGTH: u32 = 1;
}

impl NetworkRuntime for CatpowderRuntime {
impl NetworkRuntime for SharedCatpowderRuntime {
/// Instantiates a new XDP runtime.
fn new(config: &Config) -> Result<Self, Fail> {
let ifindex: u32 = config.local_interface_index()?;
Expand Down Expand Up @@ -167,7 +167,7 @@ impl CatpowderRuntimeInner {
//======================================================================================================================

/// Memory runtime trait implementation for XDP Runtime.
impl MemoryRuntime for CatpowderRuntime {}
impl MemoryRuntime for SharedCatpowderRuntime {}

/// Runtime trait implementation for XDP Runtime.
impl Runtime for CatpowderRuntime {}
impl Runtime for SharedCatpowderRuntime {}
10 changes: 5 additions & 5 deletions src/rust/demikernel/libos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use self::name::LibOSName;
#[cfg(feature = "catnip-libos")]
use crate::catnip::runtime::SharedDPDKRuntime;
#[cfg(feature = "catpowder-libos")]
use crate::catpowder::CatpowderRuntime;
use crate::catpowder::SharedCatpowderRuntime;
#[cfg(any(
feature = "catnap-libos",
feature = "catnip-libos",
Expand Down Expand Up @@ -142,12 +142,12 @@ impl LibOS {
#[cfg(feature = "catpowder-libos")]
LibOSName::Catpowder => {
// TODO: Remove some of these clones once we are done merging the libOSes.
let transport: CatpowderRuntime = CatpowderRuntime::new(&config)?;
let transport: SharedCatpowderRuntime = SharedCatpowderRuntime::new(&config)?;
// This is our transport for Catpowder.
let inetstack: SharedInetStack<CatpowderRuntime> =
SharedInetStack::<CatpowderRuntime>::new(&config, runtime.clone(), transport).unwrap();
let inetstack: SharedInetStack<SharedCatpowderRuntime> =
SharedInetStack::<SharedCatpowderRuntime>::new(&config, runtime.clone(), transport).unwrap();
Self::NetworkLibOS(NetworkLibOSWrapper::Catpowder(SharedNetworkLibOS::<
SharedInetStack<CatpowderRuntime>,
SharedInetStack<SharedCatpowderRuntime>,
>::new(
config.local_ipv4_addr()?,
runtime.clone(),
Expand Down
4 changes: 2 additions & 2 deletions src/rust/demikernel/libos/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::catnap::transport::SharedCatnapTransport;
#[cfg(feature = "catnip-libos")]
use crate::catnip::runtime::SharedDPDKRuntime;
#[cfg(feature = "catpowder-libos")]
use crate::catpowder::CatpowderRuntime;
use crate::catpowder::SharedCatpowderRuntime;

//======================================================================================================================
// Structures
Expand All @@ -53,7 +53,7 @@ use crate::catpowder::CatpowderRuntime;
/// Network LIBOS.
pub enum NetworkLibOSWrapper {
#[cfg(feature = "catpowder-libos")]
Catpowder(SharedNetworkLibOS<SharedInetStack<CatpowderRuntime>>),
Catpowder(SharedNetworkLibOS<SharedInetStack<SharedCatpowderRuntime>>),
#[cfg(all(feature = "catnap-libos"))]
Catnap(SharedNetworkLibOS<SharedCatnapTransport>),
#[cfg(feature = "catnip-libos")]
Expand Down

0 comments on commit 0939093

Please sign in to comment.