From 29cc0a6e285c35f4aa0d34308448692d2940166b Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 22 Sep 2023 13:13:21 +0800 Subject: [PATCH] ddma/subkernel: fix wrong destination reported --- src/libksupport/src/lib.rs | 93 -------------------------------------- src/satman/src/main.rs | 10 ++-- 2 files changed, 5 insertions(+), 98 deletions(-) diff --git a/src/libksupport/src/lib.rs b/src/libksupport/src/lib.rs index 8d35b49d..630f19ed 100644 --- a/src/libksupport/src/lib.rs +++ b/src/libksupport/src/lib.rs @@ -47,99 +47,6 @@ pub struct RPCException { pub function: u32, } -#[cfg(has_drtio)] -#[derive(Debug, Clone)] -pub enum SubkernelStatus { - NoError, - Timeout, - IncorrectState, - CommLost, - OtherError, -} - -#[derive(Debug, Clone)] -pub enum Message { - LoadRequest(Vec), - LoadCompleted, - LoadFailed, - StartRequest, - KernelFinished(u8), - KernelException( - &'static [Option>], - &'static [eh_artiq::StackPointerBacktrace], - &'static [(usize, usize)], - u8, - ), - RpcSend { - is_async: bool, - data: Vec, - }, - RpcRecvRequest(*mut ()), - RpcRecvReply(Result), - - CacheGetRequest(String), - CacheGetReply(Vec), - CachePutRequest(String, Vec), - - DmaPutRequest(DmaRecorder), - DmaEraseRequest(String), - DmaGetRequest(String), - DmaGetReply(Option<(i32, i64, bool)>), - #[cfg(has_drtio)] - DmaStartRemoteRequest { - id: i32, - timestamp: i64, - }, - #[cfg(has_drtio)] - DmaAwaitRemoteRequest(i32), - #[cfg(has_drtio)] - DmaAwaitRemoteReply { - timeout: bool, - error: u8, - channel: u32, - timestamp: u64, - }, - - #[cfg(has_drtio)] - UpDestinationsRequest(i32), - #[cfg(has_drtio)] - UpDestinationsReply(bool), - - #[cfg(has_drtio)] - SubkernelLoadRunRequest { - id: u32, - run: bool, - }, - #[cfg(has_drtio)] - SubkernelLoadRunReply { - succeeded: bool, - }, - #[cfg(has_drtio)] - SubkernelAwaitFinishRequest { - id: u32, - timeout: u64, - }, - #[cfg(has_drtio)] - SubkernelAwaitFinishReply { - status: SubkernelStatus, - }, - #[cfg(has_drtio)] - SubkernelMsgSend { - id: u32, - data: Vec, - }, - #[cfg(has_drtio)] - SubkernelMsgRecvRequest { - id: u32, - timeout: u64, - }, - #[cfg(has_drtio)] - SubkernelMsgRecvReply { - status: SubkernelStatus, - count: u8, - }, -} - pub static mut SEEN_ASYNC_ERRORS: u8 = 0; pub const ASYNC_ERROR_COLLISION: u8 = 1 << 0; diff --git a/src/satman/src/main.rs b/src/satman/src/main.rs index 0ec8cbc7..9c73ca34 100644 --- a/src/satman/src/main.rs +++ b/src/satman/src/main.rs @@ -119,10 +119,10 @@ fn process_aux_packet( } drtioaux::Packet::DestinationStatusRequest { - destination: _destination, + destination, } => { #[cfg(has_drtio_routing)] - let hop = _routing_table.0[_destination as usize][*_rank as usize]; + let hop = _routing_table.0[destination as usize][*_rank as usize]; #[cfg(not(has_drtio_routing))] let hop = 0; @@ -135,7 +135,7 @@ fn process_aux_packet( drtioaux::send( 0, &drtioaux::Packet::DmaPlaybackStatus { - destination: *_rank, + destination: destination, id: status.id, error: status.error, channel: status.channel, @@ -160,7 +160,7 @@ fn process_aux_packet( Some(meta) => drtioaux::send( 0, &drtioaux::Packet::SubkernelMessage { - destination: *_rank, + destination: destination, id: kernel_manager.get_current_id().unwrap(), last: meta.last, length: meta.len as u16, @@ -209,7 +209,7 @@ fn process_aux_packet( let repno = hop - 1; match _repeaters[repno].aux_forward( &drtioaux::Packet::DestinationStatusRequest { - destination: _destination, + destination: destination, }, timer, ) {