From 5bcd171108c99ac11290ba2bc79de6f437a9882f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 11:42:13 +0200 Subject: [PATCH 01/14] lot of debugging and trying out --- common/config/eive/definitions.h | 7 ++++--- mission/cfdp/CfdpHandler.cpp | 4 +--- mission/com/LiveTmTask.cpp | 12 +++++++++++- mission/com/LiveTmTask.h | 5 ++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 2edf434f..777e8924 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -48,7 +48,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; -static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 300; +static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 990; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; @@ -61,9 +61,10 @@ static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300; static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; -static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 250; +static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50; +static constexpr uint32_t CFDP_THROTTLE_PERIOD_MS = 200; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 20; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 99afb725..1382a760 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -72,9 +72,7 @@ ReturnValue_t CfdpHandler::initialize() { } fsmCount = 0; - if (throttleSignal) { - throttlePeriodOngoing = true; - } + throttlePeriodOngoing = throttleSignal; // CFDP can be throttled by the slowest live TM handler to handle back pressure in a sensible // way without requiring huge amounts of memory for large files. diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index f9b01c77..2b8bc50c 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -52,13 +52,16 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } + } else { + consecutiveNoBlockWriteCounter = 0; } if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. throttleCfdp(); } else if(!channel.isBusy() and throttlePeriodOngoing) { - if(minimumPeriodThrottleCd.hasTimedOut()) { + if(minimumPeriodThrottleCd.hasTimedOut() and consecutiveNoBlockWriteCounter >= 10) { + sif::debug << "releasing cfdp" << std::endl; releaseCfdp(); } } @@ -162,10 +165,14 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { return result; } + if(ptmeLocked) { + consecutiveNoBlockWriteCounter= 0; + } if (!ptmeLocked) { size_t partiallyWrittenSize = 0; result = channel.write(data, size, partiallyWrittenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { + consecutiveNoBlockWriteCounter = 0; // Already throttle CFDP. throttleCfdp(); result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); @@ -175,6 +182,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } + minimumPeriodThrottleCd.resetTimer(); + } else { + consecutiveNoBlockWriteCounter++; } } // Try delete in any case, ignore failures (which should not happen), it is more important to diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 73d2bf16..121fd44f 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -10,6 +10,8 @@ #include #include #include +#include +#include "eive/definitions.h" class LiveTmTask : public SystemObject, public HasModesIF, @@ -35,13 +37,14 @@ class LiveTmTask : public SystemObject, ModeHelper modeHelper; Mode_t mode = HasModesIF::MODE_OFF; Countdown tmFunnelCd = Countdown(100); + uint32_t consecutiveNoBlockWriteCounter = 0; PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; // This countdown ensures that the CFDP is always throttled with a minimum period. Only after // this period, the CFDP can be released if the channel is not busy. - Countdown minimumPeriodThrottleCd = Countdown(40); + Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; void readCommandQueue(void); -- 2.43.0 From c95964ce0f8d08acf2c03b858a5082600d0a2178 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 13:21:28 +0200 Subject: [PATCH 02/14] lets see if this works better --- mission/cfdp/CfdpHandler.cpp | 2 +- mission/cfdp/CfdpHandler.h | 2 +- mission/com/LiveTmTask.cpp | 35 ++++++++++++++++------------------- mission/com/LiveTmTask.h | 7 ++++--- mission/sysDefs.h | 1 + 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 1382a760..c1bb3273 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -16,7 +16,7 @@ using namespace returnvalue; using namespace cfdp; CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg, - const std::atomic_bool& throttleSignal) + const std::atomic_bool& throttleSignal) : SystemObject(fsfwHandlerParams.objectId), pduQueue(fsfwHandlerParams.tmtcQueue), cfdpRequestQueue(fsfwHandlerParams.cfdpQueue), diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 82f27b0b..b2f49678 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -63,7 +63,7 @@ struct CfdpHandlerCfg { class CfdpHandler : public SystemObject, public ExecutableObjectIF, public AcceptsTelecommandsIF { public: explicit CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg, - const std::atomic_bool& throttleSignal); + const std::atomic_bool& throttleSignal); [[nodiscard]] const char* getName() const override; [[nodiscard]] uint32_t getIdentifier() const override; diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 2b8bc50c..c89369fc 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -9,6 +9,7 @@ static constexpr bool DEBUG_TM_QUEUE_SPEED = false; std::atomic_bool signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; +std::atomic_uint32_t signals::CFDP_MSG_COUNTER = 0; LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, VirtualChannel& channel, const std::atomic_bool& ptmeLocked, @@ -52,16 +53,14 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } - } else { - consecutiveNoBlockWriteCounter = 0; } if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. throttleCfdp(); - } else if(!channel.isBusy() and throttlePeriodOngoing) { - if(minimumPeriodThrottleCd.hasTimedOut() and consecutiveNoBlockWriteCounter >= 10) { - sif::debug << "releasing cfdp" << std::endl; + } else if (!channel.isBusy() and throttlePeriodOngoing) { + // Half full/empty flow control: Release the CFDP is the queue is empty enough. + if (signals::CFDP_MSG_COUNTER <= config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2) { releaseCfdp(); } } @@ -144,16 +143,21 @@ void LiveTmTask::readCommandQueue(void) { } } -ReturnValue_t LiveTmTask::handleRegularTmQueue() { return handleGenericTmQueue(*regularTmQueue); } +ReturnValue_t LiveTmTask::handleRegularTmQueue() { + return handleGenericTmQueue(*regularTmQueue, false); +} -ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return handleGenericTmQueue(*cfdpTmQueue); } +ReturnValue_t LiveTmTask::handleCfdpTmQueue() { return handleGenericTmQueue(*cfdpTmQueue, true); } -ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { +ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfdp) { TmTcMessage message; ReturnValue_t result = queue.receiveMessage(&message); if (result == MessageQueueIF::EMPTY) { return result; } + if (signals::CFDP_MSG_COUNTER > 0) { + signals::CFDP_MSG_COUNTER--; + } store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; size_t size = 0; @@ -165,26 +169,19 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { return result; } - if(ptmeLocked) { - consecutiveNoBlockWriteCounter= 0; - } if (!ptmeLocked) { size_t partiallyWrittenSize = 0; result = channel.write(data, size, partiallyWrittenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { - consecutiveNoBlockWriteCounter = 0; // Already throttle CFDP. throttleCfdp(); result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. - sif::warning - << "LiveTmTask: Synchronous write of last segment failed with code 0x" - << std::setw(4) << std::hex << result << std::dec << std::endl; + sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" + << std::setw(4) << std::hex << result << std::dec << std::endl; } - minimumPeriodThrottleCd.resetTimer(); - } else { - consecutiveNoBlockWriteCounter++; + // minimumPeriodThrottleCd.resetTimer(); } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -195,7 +192,7 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) { void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; - minimumPeriodThrottleCd.resetTimer(); + // minimumPeriodThrottleCd.resetTimer(); signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; } diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 121fd44f..41b03ece 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -10,7 +10,9 @@ #include #include #include + #include + #include "eive/definitions.h" class LiveTmTask : public SystemObject, @@ -37,21 +39,20 @@ class LiveTmTask : public SystemObject, ModeHelper modeHelper; Mode_t mode = HasModesIF::MODE_OFF; Countdown tmFunnelCd = Countdown(100); - uint32_t consecutiveNoBlockWriteCounter = 0; PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; // This countdown ensures that the CFDP is always throttled with a minimum period. Only after // this period, the CFDP can be released if the channel is not busy. - Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); + // Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; void readCommandQueue(void); ReturnValue_t handleRegularTmQueue(); ReturnValue_t handleCfdpTmQueue(); - ReturnValue_t handleGenericTmQueue(MessageQueueIF& queue); + ReturnValue_t handleGenericTmQueue(MessageQueueIF& queue, bool isCfdp); MessageQueueId_t getCommandQueue() const override; diff --git a/mission/sysDefs.h b/mission/sysDefs.h index b7cbd4e0..8fade60a 100644 --- a/mission/sysDefs.h +++ b/mission/sysDefs.h @@ -15,6 +15,7 @@ namespace signals { extern std::atomic_bool CFDP_CHANNEL_THROTTLE_SIGNAL; extern std::atomic_uint16_t I2C_FATAL_ERRORS; +extern std::atomic_uint32_t CFDP_MSG_COUNTER; } // namespace signals -- 2.43.0 From be1fb22e39141ff8473c72bacf6dbb8c7de8c0d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 14:00:44 +0200 Subject: [PATCH 03/14] somethings wrong, i can feel it --- mission/cfdp/CfdpHandler.cpp | 13 +++++++++++-- mission/com/LiveTmTask.cpp | 11 +++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index c1bb3273..2e28aee0 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -60,7 +60,7 @@ ReturnValue_t CfdpHandler::initialize() { result = handleCfdpMessages(); if (result != OK) { } - uint32_t fsmCount = 0; + uint32_t fsmCount = 1; const DestHandler::FsmResult& destResult = destHandler.stateMachine(); while (destResult.callStatus == CallStatus::CALL_AGAIN) { if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER) { @@ -70,7 +70,7 @@ ReturnValue_t CfdpHandler::initialize() { destHandler.stateMachine(); fsmCount++; } - fsmCount = 0; + fsmCount = 1; throttlePeriodOngoing = throttleSignal; @@ -78,6 +78,9 @@ ReturnValue_t CfdpHandler::initialize() { // way without requiring huge amounts of memory for large files. if (!throttlePeriodOngoing) { const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine(); + if (srcResult.packetsSent > 0) { + signals::CFDP_MSG_COUNTER.fetch_add(srcResult.packetsSent, std::memory_order_relaxed); + } while (srcResult.callStatus == CallStatus::CALL_AGAIN) { // Limit number of messages. if (fsmCount == config::CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER) { @@ -85,6 +88,9 @@ ReturnValue_t CfdpHandler::initialize() { break; } srcHandler.stateMachine(); + if (srcResult.packetsSent > 0) { + signals::CFDP_MSG_COUNTER.fetch_add(srcResult.packetsSent, std::memory_order_relaxed); + } if (srcResult.result == cfdp::TM_STORE_FULL) { sif::warning << "CFDP Source Handler: TM store is full" << std::endl; } else if (srcResult.result == cfdp::TARGET_MSG_QUEUE_FULL) { @@ -92,6 +98,9 @@ ReturnValue_t CfdpHandler::initialize() { } fsmCount++; } + if (signals::CFDP_MSG_COUNTER > 0) { + sif::debug << "CFDP msg count: " << signals::CFDP_MSG_COUNTER << std::endl; + } } if (shortDelay) { TaskFactory::delayTask(config::CFDP_SHORT_DELAY_MS); diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index c89369fc..a723daa6 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -54,6 +54,9 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } + if (channel.isBusy()) { + sif::debug << "busy" << std::endl; + } if (channel.isBusy() and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. @@ -74,10 +77,10 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { readCommandQueue(); if (DEBUG_TM_QUEUE_SPEED) { if (consecutiveCfdpCounter > 0) { - sif::debug << "Concecutive CFDP TM handled: " << consecutiveCfdpCounter << std::endl; + sif::debug << "Consecutive CFDP TM handled: " << consecutiveCfdpCounter << std::endl; } if (consecutiveRegularCounter > 0) { - sif::debug << "Concecutive regular TM handled: " << consecutiveRegularCounter + sif::debug << "Consecutive regular TM handled: " << consecutiveRegularCounter << std::endl; } consecutiveRegularCounter = 0; @@ -181,7 +184,6 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } - // minimumPeriodThrottleCd.resetTimer(); } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -192,13 +194,14 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; - // minimumPeriodThrottleCd.resetTimer(); signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + sif::debug << "throttling CFDP" << std::endl; } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; + sif::debug << "releasing CFDP" << std::endl; } ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } -- 2.43.0 From 2279eab5e764e73b81560a54827010279f962460 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 14:20:50 +0200 Subject: [PATCH 04/14] maybe this works better? --- mission/com/LiveTmTask.cpp | 17 +++++++++++++---- mission/com/LiveTmTask.h | 2 ++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index a723daa6..5b337030 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -37,7 +37,8 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { // TODO: Must read CFDP TM queue and regular TM queue and forward them. Handle regular queue // first. handledTm = false; - if (!channel.isBusy()) { + updateBusyFlag(); + if (!channelIsBusy) { result = handleRegularTmQueue(); if (result == MessageQueueIF::EMPTY) { result = handleCfdpTmQueue(); @@ -54,14 +55,14 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { } } } - if (channel.isBusy()) { + if (channelIsBusy) { sif::debug << "busy" << std::endl; } - if (channel.isBusy() and !throttlePeriodOngoing) { + if (channelIsBusy and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. throttleCfdp(); - } else if (!channel.isBusy() and throttlePeriodOngoing) { + } else if (!channelIsBusy and throttlePeriodOngoing) { // Half full/empty flow control: Release the CFDP is the queue is empty enough. if (signals::CFDP_MSG_COUNTER <= config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2) { releaseCfdp(); @@ -184,6 +185,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } + // This is a bit of a hack: If a partial write was performed and synchronously finished, we + // treat this like a busy channel. + channelIsBusy = true; } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -204,6 +208,11 @@ void LiveTmTask::releaseCfdp() { sif::debug << "releasing CFDP" << std::endl; } +void LiveTmTask::updateBusyFlag() { + // We cache this as a member, because the busy bit can toggle very quickly.. + channelIsBusy = channel.isBusy(); +} + ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 41b03ece..0727bad1 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -47,6 +47,7 @@ class LiveTmTask : public SystemObject, // this period, the CFDP can be released if the channel is not busy. // Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; + bool channelIsBusy = false; void readCommandQueue(void); @@ -66,6 +67,7 @@ class LiveTmTask : public SystemObject, void announceMode(bool recursive) override; void throttleCfdp(); void releaseCfdp(); + void updateBusyFlag(); object_id_t getObjectId() const override; const HasHealthIF* getOptHealthIF() const override; -- 2.43.0 From 4431883b4ddd982dff6bd1ce446e6a048d7afce0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 15:10:52 +0200 Subject: [PATCH 05/14] okay, PAPB IF caches packet now --- bsp_q7s/objectFactory.cpp | 20 ++++++---- common/config/eive/definitions.h | 2 + linux/ipcore/PapbVcInterface.cpp | 51 +++++++++++++------------ linux/ipcore/PapbVcInterface.h | 15 +++++--- mission/com/LiveTmTask.cpp | 12 +++--- mission/com/TmStoreTaskBase.cpp | 7 ++-- mission/com/VirtualChannel.cpp | 21 ++++++---- mission/com/VirtualChannel.h | 6 +-- mission/com/VirtualChannelWithQueue.cpp | 6 +-- mission/tmtc/DirectTmSinkIF.h | 3 +- 10 files changed, 80 insertions(+), 63 deletions(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index 211aa071..c8e6f555 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -750,14 +750,18 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { gpioChecker(args.gpioComIF.addGpios(gpioCookiePtmeIp), "PTME PAPB VCs"); // Creating virtual channel interfaces - VirtualChannelIF* vc0 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC0); - VirtualChannelIF* vc1 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC1); - VirtualChannelIF* vc2 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC2); - VirtualChannelIF* vc3 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_EMPTY, - q7s::UIO_PTME, q7s::uiomapids::PTME_VC3); + VirtualChannelIF* vc0 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC0, config::MAX_SPACEPACKET_TC_SIZE); + VirtualChannelIF* vc1 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC1, config::MAX_SPACEPACKET_TC_SIZE); + VirtualChannelIF* vc2 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC2, config::MAX_SPACEPACKET_TC_SIZE); + VirtualChannelIF* vc3 = + new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME, + q7s::uiomapids::PTME_VC3, config::MAX_SPACEPACKET_TC_SIZE); // Creating ptme object and adding virtual channel interfaces Ptme* ptme = new Ptme(objects::PTME); ptme->addVcInterface(ccsds::VC0, vc0); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 777e8924..ee1fd5b7 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -35,6 +35,8 @@ static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50; static constexpr uint8_t LIVE_TM = 0; +static constexpr size_t MAX_SPACEPACKET_TC_SIZE = 2048; + /* Limits for filename and path checks */ static constexpr uint32_t MAX_PATH_SIZE = 200; static constexpr uint32_t MAX_FILENAME_SIZE = 100; diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 88684772..d5207c0b 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -8,8 +8,12 @@ #include "fsfw/serviceinterface/ServiceInterface.h" PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, - std::string uioFile, int mapNum) - : gpioComIF(gpioComIF), papbEmptyId(papbEmptyId), uioFile(std::move(uioFile)), mapNum(mapNum) {} + std::string uioFile, int mapNum, size_t maxPacketSize) + : gpioComIF(gpioComIF), + papbEmptyId(papbEmptyId), + packetBuf(maxPacketSize), + uioFile(std::move(uioFile)), + mapNum(mapNum) {} PapbVcInterface::~PapbVcInterface() {} @@ -29,9 +33,17 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w return returnvalue::FAILED; } // The user must call finishWrite before starting a new packet transfer. - if (partialWriteActive) { - return INCOMPLETE_PARTIAL_WRITE; + if (writeActive) { + return IS_BUSY; } + if (size > packetBuf.capacity()) { + sif::error << "PapbVcInterface: Packet with size " << size << " larger than maximum configured" + << " byte size " << packetBuf.capacity() << std::endl; + return returnvalue::FAILED; + } + std::memcpy(packetBuf.data(), data, size); + currentPacketSize = size; + currentPacketIndex = 0; if (pollReadyForPacket()) { startPacketTransfer(ByteWidthCfg::ONE); } else { @@ -41,14 +53,17 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w abortPacketTransfer(); return returnvalue::FAILED; } - return finishWriteInternal(data, 0, size, writtenSize, false); + return advanceWrite(writtenSize); } void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { *vcBaseReg = CONFIG_DATA_INPUT | initWidth; } -void PapbVcInterface::completePacketTransfer() { *vcBaseReg = CONFIG_END; } +void PapbVcInterface::completePacketTransfer() { + *vcBaseReg = CONFIG_END; + writeActive = false; +} bool PapbVcInterface::pollReadyForPacket() const { // Check if PAPB interface is ready to receive data. Use the configuration register for this. @@ -57,34 +72,20 @@ bool PapbVcInterface::pollReadyForPacket() const { return (reg >> 6) & 0b1; } -ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t start, - size_t remainingSize) { +ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { if (not pollReadyForPacket()) { - return returnvalue::FAILED; + return IS_BUSY; } - size_t dummy = 0; - return finishWriteInternal(data, start, remainingSize, dummy, true); -} - -ReturnValue_t PapbVcInterface::finishWriteInternal(const uint8_t* data, size_t start, - size_t remainingSize, size_t& writtenSize, - bool abortOnPartialWrite) { - for (size_t idx = 0; idx < remainingSize; idx++) { + for (size_t idx = currentPacketIndex; idx < currentPacketSize; idx++) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForPacket()) { - writtenSize = start + idx; - partialWriteActive = true; - if (abortOnPartialWrite) { - abortPacketTransfer(); - partialWriteActive = false; - return returnvalue::FAILED; - } return PARTIALLY_WRITTEN; } abortPacketTransfer(); return returnvalue::FAILED; } - *(vcBaseReg + DATA_REG_OFFSET) = static_cast(data[start + idx]); + *(vcBaseReg + DATA_REG_OFFSET) = static_cast(packetBuf[currentPacketIndex]); + writtenSize++; } if (not pollReadyForOctet(MAX_BUSY_POLLS)) { abortPacketTransfer(); diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index 35bd0439..eb707b62 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -6,6 +6,7 @@ #include #include +#include #include "OBSWConfig.h" #include "fsfw/returnvalues/returnvalue.h" @@ -30,7 +31,8 @@ class PapbVcInterface : public VirtualChannelIF { * @param uioFile UIO file providing access to the PAPB bus * @param mapNum Map number of UIO map associated with this virtual channel */ - PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, std::string uioFile, int mapNum); + PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, std::string uioFile, int mapNum, + size_t maxPacketSize); virtual ~PapbVcInterface(); bool isBusy() const override; @@ -42,9 +44,9 @@ class PapbVcInterface : public VirtualChannelIF { */ ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; - ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) override; - ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, - size_t& writtenSize, bool abortOnPartialWrite); + ReturnValue_t advanceWrite(size_t& remainingSize) override; + // ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, + // size_t& writtenSize, bool abortOnPartialWrite); void cancelTransfer() override; @@ -90,9 +92,12 @@ class PapbVcInterface : public VirtualChannelIF { /** High when external buffer memory of virtual channel is empty */ gpioId_t papbEmptyId = gpio::NO_GPIO; + std::vector packetBuf; std::string uioFile; int mapNum = 0; - bool partialWriteActive = false; + bool writeActive = false; + size_t currentPacketIndex = 0; + size_t currentPacketSize = 0; mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; const struct timespec BETWEEN_POLL_DELAY = {.tv_sec = 0, .tv_nsec = 10}; mutable struct timespec remDelay; diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 5b337030..15630be5 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -53,11 +53,11 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { consecutiveRegularCounter++; } } + } else if (result != MessageQueueIF::EMPTY) { + sif::warning << "LiveTmTask: TM queue failure, returncode 0x" << std::hex << std::setw(4) + << result << std::dec << std::endl; } } - if (channelIsBusy) { - sif::debug << "busy" << std::endl; - } if (channelIsBusy and !throttlePeriodOngoing) { // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling // it is the easiest way to handle back pressure for now in a sensible way. @@ -174,12 +174,12 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd } if (!ptmeLocked) { - size_t partiallyWrittenSize = 0; - result = channel.write(data, size, partiallyWrittenSize); + size_t writtenSize = 0; + result = channel.write(data, size, writtenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { // Already throttle CFDP. throttleCfdp(); - result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); + result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" diff --git a/mission/com/TmStoreTaskBase.cpp b/mission/com/TmStoreTaskBase.cpp index c51d6f9b..215cef08 100644 --- a/mission/com/TmStoreTaskBase.cpp +++ b/mission/com/TmStoreTaskBase.cpp @@ -138,11 +138,10 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store, return result; } dumpedLen = tmReader.getFullPacketLen(); - size_t partiallyWrittenSize = 0; - result = channel.write(tmReader.getFullData(), dumpedLen, partiallyWrittenSize); + size_t writtenSize = 0; + result = channel.write(tmReader.getFullData(), dumpedLen, writtenSize); if (result == VirtualChannelIF::PARTIALLY_WRITTEN) { - result = channel.handleLastWriteSynchronously(tmReader.getFullData(), partiallyWrittenSize, - dumpedLen - partiallyWrittenSize, 200); + result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "PersistentTmStore: Synchronous write of last segment failed with code 0x" diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index 7ada00aa..d6d792f4 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -21,11 +21,11 @@ ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size, size_t& wr uint8_t VirtualChannel::getVcid() const { return vcId; } -ReturnValue_t VirtualChannel::finishWrite(const uint8_t* data, size_t start, size_t remainingSize) { +ReturnValue_t VirtualChannel::advanceWrite(size_t& writtenSize) { if (!ptme.containsVc(vcId)) { return CHANNEL_DOES_NOT_EXIST; } - return ptme.getVirtChannel(vcId)->finishWrite(data, start, remainingSize); + return ptme.getVirtChannel(vcId)->advanceWrite(writtenSize); } const char* VirtualChannel::getName() const { return vcName.c_str(); } @@ -46,20 +46,27 @@ void VirtualChannel::cancelTransfer() { bool VirtualChannel::isTxOn() const { return txOn; } -ReturnValue_t VirtualChannel::handleLastWriteSynchronously(const uint8_t* data, size_t start, - size_t remLen, unsigned maxDelayMs) { +ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& writtenSize, + unsigned maxCompletionTimeMs) { unsigned delayMs = 0; while (true) { if (isBusy()) { - if (delayMs >= maxDelayMs) { + if (delayMs >= maxCompletionTimeMs) { break; } TaskFactory::delayTask(10); delayMs += 10; continue; } - sif::debug << "last write after" << delayMs << std::endl; - return finishWrite(data, start, remLen); + ReturnValue_t result = advanceWrite(writtenSize); + if (result == returnvalue::OK) { + sif::debug << "last write after" << delayMs << std::endl; + // Transfer complete + return result; + } else if (result != PARTIALLY_WRITTEN) { + // Some error where we can not or should not continue the transfer. + return result; + } } return returnvalue::FAILED; } diff --git a/mission/com/VirtualChannel.h b/mission/com/VirtualChannel.h index 3d61bd13..d8ac0228 100644 --- a/mission/com/VirtualChannel.h +++ b/mission/com/VirtualChannel.h @@ -32,9 +32,9 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { ReturnValue_t sendNextTm(const uint8_t* data, size_t size, size_t& writtenSize); bool isBusy() const override; ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; - ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) override; - ReturnValue_t handleLastWriteSynchronously(const uint8_t* data, size_t start, size_t remLen, - unsigned maxDelayMs); + ReturnValue_t advanceWrite(size_t& writtenSize) override; + ReturnValue_t handleWriteCompletionSynchronously(size_t& writtenSize, + unsigned maxCompletionTimeMs); void cancelTransfer() override; uint8_t getVcid() const; bool isTxOn() const; diff --git a/mission/com/VirtualChannelWithQueue.cpp b/mission/com/VirtualChannelWithQueue.cpp index 53f2ee52..0d9e4d11 100644 --- a/mission/com/VirtualChannelWithQueue.cpp +++ b/mission/com/VirtualChannelWithQueue.cpp @@ -37,11 +37,11 @@ ReturnValue_t VirtualChannelWithQueue::handleNextTm(bool performWriteOp) { } // TODO: Hnadle partial write handling - size_t partiallyWrittenSize = 0; + size_t writtenSize = 0; if (performWriteOp) { - result = write(data, size, partiallyWrittenSize); + result = write(data, size, writtenSize); if (result == PARTIALLY_WRITTEN) { - result = handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200); + result = handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index e1fcf54f..f5b43039 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -14,7 +14,6 @@ class DirectTmSinkIF { static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0); static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1); - static constexpr ReturnValue_t INCOMPLETE_PARTIAL_WRITE = returnvalue::makeCode(CLASS_ID, 2); /** * @brief Implements the functionality to write to a TM sink directly @@ -27,7 +26,7 @@ class DirectTmSinkIF { */ virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0; - virtual ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) = 0; + virtual ReturnValue_t advanceWrite(size_t& writtenSize) = 0; virtual bool isBusy() const = 0; }; -- 2.43.0 From b8beddc11b2ff7779d6ba1c7b51ccbf5fabb6a2f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 15:24:06 +0200 Subject: [PATCH 06/14] gens --- .../fsfwconfig/events/translateEvents.cpp | 2 +- .../fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 2 +- generators/bsp_q7s_returnvalues.csv | 2 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- linux/ipcore/PapbVcInterface.cpp | 28 +++++++++++++------ linux/ipcore/PapbVcInterface.h | 5 ++-- mission/com/VirtualChannel.cpp | 7 +++++ mission/com/VirtualChannel.h | 1 + mission/tmtc/DirectTmSinkIF.h | 25 ++++++++++++++--- tmtc | 2 +- 14 files changed, 61 insertions(+), 23 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 56112520..7c04e9f5 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 314 translations. * @details - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 7916bfeb..5cb8e295 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 174 translations. - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index e8d79402..1964e00e 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -521,5 +521,5 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h -0x6f02;TMS_IncompletePartialWrite;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 0d08c2b7..9aa12b12 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -616,6 +616,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h 0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h -0x6f02;TMS_IncompletePartialWrite;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h +0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h 0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h 0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 56112520..7c04e9f5 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 314 translations. * @details - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 96e07335..5b99d6f0 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 178 translations. - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 56112520..7c04e9f5 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 314 translations. * @details - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 96e07335..5b99d6f0 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 178 translations. - * Generated on: 2023-10-13 09:44:05 + * Generated on: 2023-10-13 15:23:30 */ #include "translateObjects.h" diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index d5207c0b..239ed091 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -32,8 +32,8 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w if (size < 4) { return returnvalue::FAILED; } - // The user must call finishWrite before starting a new packet transfer. - if (writeActive) { + // The user must call advance until completion before starting a new packet transfer. + if (writeActiveStatus) { return IS_BUSY; } if (size > packetBuf.capacity()) { @@ -60,11 +60,6 @@ void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { *vcBaseReg = CONFIG_DATA_INPUT | initWidth; } -void PapbVcInterface::completePacketTransfer() { - *vcBaseReg = CONFIG_END; - writeActive = false; -} - bool PapbVcInterface::pollReadyForPacket() const { // Check if PAPB interface is ready to receive data. Use the configuration register for this. // Bit 5, see PTME ptme_001_01-0-7-r2 Table 31. @@ -73,6 +68,9 @@ bool PapbVcInterface::pollReadyForPacket() const { } ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { + if (!writeActiveStatus) { + return NO_WRITE_ACTIVE; + } if (not pollReadyForPacket()) { return IS_BUSY; } @@ -95,6 +93,8 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) { return returnvalue::OK; } +bool PapbVcInterface::writeActive() const { return writeActiveStatus; } + bool PapbVcInterface::isVcInterfaceBufferEmpty() { ReturnValue_t result = returnvalue::OK; gpio::Levels papbEmptyState = gpio::Levels::HIGH; @@ -131,4 +131,16 @@ inline bool PapbVcInterface::pollReadyForOctet(uint32_t maxCycles) const { return false; } -void PapbVcInterface::abortPacketTransfer() { *vcBaseReg = CONFIG_ABORT; } +void PapbVcInterface::abortPacketTransfer() { + *vcBaseReg = CONFIG_ABORT; + writeActiveStatus = false; + currentPacketIndex = 0; + currentPacketSize = 0; +} + +void PapbVcInterface::completePacketTransfer() { + *vcBaseReg = CONFIG_END; + writeActiveStatus = false; + currentPacketIndex = 0; + currentPacketSize = 0; +} diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index eb707b62..bcda5709 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -50,6 +50,8 @@ class PapbVcInterface : public VirtualChannelIF { void cancelTransfer() override; + bool writeActive() const override; + ReturnValue_t initialize() override; private: @@ -95,12 +97,11 @@ class PapbVcInterface : public VirtualChannelIF { std::vector packetBuf; std::string uioFile; int mapNum = 0; - bool writeActive = false; + bool writeActiveStatus = false; size_t currentPacketIndex = 0; size_t currentPacketSize = 0; mutable struct timespec nextDelay = {.tv_sec = 0, .tv_nsec = 0}; const struct timespec BETWEEN_POLL_DELAY = {.tv_sec = 0, .tv_nsec = 10}; - mutable struct timespec remDelay; volatile uint32_t* vcBaseReg = nullptr; diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index d6d792f4..93c83eeb 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -28,6 +28,13 @@ ReturnValue_t VirtualChannel::advanceWrite(size_t& writtenSize) { return ptme.getVirtChannel(vcId)->advanceWrite(writtenSize); } +bool VirtualChannel::writeActive() const { + if (!ptme.containsVc(vcId)) { + return CHANNEL_DOES_NOT_EXIST; + } + return ptme.getVirtChannel(vcId)->writeActive(); +} + const char* VirtualChannel::getName() const { return vcName.c_str(); } bool VirtualChannel::isBusy() const { diff --git a/mission/com/VirtualChannel.h b/mission/com/VirtualChannel.h index d8ac0228..84cdafb3 100644 --- a/mission/com/VirtualChannel.h +++ b/mission/com/VirtualChannel.h @@ -35,6 +35,7 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF { ReturnValue_t advanceWrite(size_t& writtenSize) override; ReturnValue_t handleWriteCompletionSynchronously(size_t& writtenSize, unsigned maxCompletionTimeMs); + bool writeActive() const override; void cancelTransfer() override; uint8_t getVcid() const; bool isTxOn() const; diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index f5b43039..6ac182d2 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -14,21 +14,38 @@ class DirectTmSinkIF { static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0); static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1); + static constexpr ReturnValue_t NO_WRITE_ACTIVE = returnvalue::makeCode(CLASS_ID, 2); /** - * @brief Implements the functionality to write to a TM sink directly + * @brief Implements the functionality to write to a TM sink directly. + * + * The write might not be completed immediately! If PARTIALLY_WRITTEN is returned, the user + * should poll the ready for packet status bit and call @advanceWrite continuously until + * the transfer is completed. * * @param data Pointer to buffer holding the data to write * @param size Number of bytes to write - * @return returnvalue::OK on success, returnvalue::FAILED on failure, IS_BUSY - * if the TM sink is busy, PARTIALLY_WRITTEN if only a portion of the bytes could be - * written. + * @param writtenSize Size written during write call. + * @return returnvalue::OK on full write success, IS_BUSY if a previous write transfer has not + * been completed yet or the PAPB interface is not ready for a packet, PARTIALLY_WRITTEN + * if some bytes were written, but the transfer has not been completed yet. */ virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0; + /** + * Advances a active file transfer. + * @param writtenSize + * @return returnvalue::OK if the packet write process is complete, PARTIALLY_WRITTEN if + * some bytes were written but the transfer is not complete yet. + */ virtual ReturnValue_t advanceWrite(size_t& writtenSize) = 0; virtual bool isBusy() const = 0; + /** + * The PAPB interface is currently busy writing a packet and a new packet can not be written yet. + * @return + */ + virtual bool writeActive() const = 0; }; #endif /* MISSION_TMTC_DIRECTTMSINKIF_H_ */ diff --git a/tmtc b/tmtc index 10e163be..60f7ae54 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 10e163be752a6a259b6d3dabea825acc9c9725f8 +Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 -- 2.43.0 From 2f25ac8e7d1997637f6c1bbd74724c180b58b378 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:25:40 +0200 Subject: [PATCH 07/14] remove old printouts --- common/config/eive/definitions.h | 3 +-- linux/ipcore/PapbVcInterface.cpp | 1 + mission/cfdp/CfdpHandler.cpp | 3 --- mission/com/LiveTmTask.cpp | 2 -- mission/com/VirtualChannel.cpp | 1 - 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index ee1fd5b7..9274878f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,8 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_THROTTLE_PERIOD_MS = 200; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 20; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; diff --git a/linux/ipcore/PapbVcInterface.cpp b/linux/ipcore/PapbVcInterface.cpp index 239ed091..bc324489 100644 --- a/linux/ipcore/PapbVcInterface.cpp +++ b/linux/ipcore/PapbVcInterface.cpp @@ -58,6 +58,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) { *vcBaseReg = CONFIG_DATA_INPUT | initWidth; + writeActiveStatus = true; } bool PapbVcInterface::pollReadyForPacket() const { diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 2e28aee0..bb98b946 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -98,9 +98,6 @@ ReturnValue_t CfdpHandler::initialize() { } fsmCount++; } - if (signals::CFDP_MSG_COUNTER > 0) { - sif::debug << "CFDP msg count: " << signals::CFDP_MSG_COUNTER << std::endl; - } } if (shortDelay) { TaskFactory::delayTask(config::CFDP_SHORT_DELAY_MS); diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 15630be5..78382168 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -199,13 +199,11 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; - sif::debug << "throttling CFDP" << std::endl; } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; - sif::debug << "releasing CFDP" << std::endl; } void LiveTmTask::updateBusyFlag() { diff --git a/mission/com/VirtualChannel.cpp b/mission/com/VirtualChannel.cpp index 93c83eeb..e531727e 100644 --- a/mission/com/VirtualChannel.cpp +++ b/mission/com/VirtualChannel.cpp @@ -67,7 +67,6 @@ ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& written } ReturnValue_t result = advanceWrite(writtenSize); if (result == returnvalue::OK) { - sif::debug << "last write after" << delayMs << std::endl; // Transfer complete return result; } else if (result != PARTIALLY_WRITTEN) { -- 2.43.0 From a47ad98d90e8fd683a7421a6d44bd7a92c04d7b0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:29:02 +0200 Subject: [PATCH 08/14] delete some old code --- mission/com/LiveTmTask.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 0727bad1..4b5096de 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -43,9 +43,6 @@ class LiveTmTask : public SystemObject, CfdpTmFunnel& cfdpFunnel; VirtualChannel& channel; const std::atomic_bool& ptmeLocked; - // This countdown ensures that the CFDP is always throttled with a minimum period. Only after - // this period, the CFDP can be released if the channel is not busy. - // Countdown minimumPeriodThrottleCd = Countdown(config::CFDP_THROTTLE_PERIOD_MS); bool throttlePeriodOngoing = false; bool channelIsBusy = false; -- 2.43.0 From e7709b7091b435bb60b162a52754631726f661f2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:42:13 +0200 Subject: [PATCH 09/14] this is even better --- mission/com/LiveTmTask.cpp | 38 ++++++++++++++++++++++---------------- mission/com/LiveTmTask.h | 2 ++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 78382168..16f8b346 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -58,16 +58,9 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) { << result << std::dec << std::endl; } } - if (channelIsBusy and !throttlePeriodOngoing) { - // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling - // it is the easiest way to handle back pressure for now in a sensible way. - throttleCfdp(); - } else if (!channelIsBusy and throttlePeriodOngoing) { - // Half full/empty flow control: Release the CFDP is the queue is empty enough. - if (signals::CFDP_MSG_COUNTER <= config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2) { - releaseCfdp(); - } - } + + cfdpBackpressureHandling(); + if (!handledTm) { if (tmFunnelCd.hasTimedOut()) { pusFunnel.performOperation(0); @@ -159,9 +152,10 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd if (result == MessageQueueIF::EMPTY) { return result; } - if (signals::CFDP_MSG_COUNTER > 0) { + if (isCfdp and signals::CFDP_MSG_COUNTER > 0) { signals::CFDP_MSG_COUNTER--; } + sif::debug << "CFDP msg counter: " << signals::CFDP_MSG_COUNTER << std::endl; store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; size_t size = 0; @@ -177,17 +171,12 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd size_t writtenSize = 0; result = channel.write(data, size, writtenSize); if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { - // Already throttle CFDP. - throttleCfdp(); result = channel.handleWriteCompletionSynchronously(writtenSize, 200); if (result != returnvalue::OK) { // TODO: Event? Might lead to dangerous spam though.. sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" << std::setw(4) << std::hex << result << std::dec << std::endl; } - // This is a bit of a hack: If a partial write was performed and synchronously finished, we - // treat this like a busy channel. - channelIsBusy = true; } } // Try delete in any case, ignore failures (which should not happen), it is more important to @@ -199,11 +188,13 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; + sif::debug << "throttling CFDP" << std::endl; } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; + sif::debug << "releasing CFDP" << std::endl; } void LiveTmTask::updateBusyFlag() { @@ -211,6 +202,21 @@ void LiveTmTask::updateBusyFlag() { channelIsBusy = channel.isBusy(); } +void LiveTmTask::cfdpBackpressureHandling() { + if (channelIsBusy and !throttlePeriodOngoing) { + // Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling + // it is the easiest way to handle back pressure for now in a sensible way. + if (signals::CFDP_MSG_COUNTER >= (config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 2)) { + throttleCfdp(); + } + } else if (!channelIsBusy and throttlePeriodOngoing) { + // Half full/empty flow control: Release the CFDP is the queue is empty enough. + if (signals::CFDP_MSG_COUNTER <= (config::LIVE_CHANNEL_CFDP_QUEUE_SIZE / 4)) { + releaseCfdp(); + } + } +} + ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; } ReturnValue_t LiveTmTask::initialize() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 4b5096de..04409b5d 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -56,6 +56,8 @@ class LiveTmTask : public SystemObject, void getMode(Mode_t* mode, Submode_t* submode) override; + void cfdpBackpressureHandling(); + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode) override; -- 2.43.0 From 6c4149571d0c4abeeff267edd0c3fe3128e28d98 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:47:16 +0200 Subject: [PATCH 10/14] debug flags --- mission/com/LiveTmTask.cpp | 12 +++++++++--- mission/com/LiveTmTask.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 16f8b346..32916afb 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -155,7 +155,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd if (isCfdp and signals::CFDP_MSG_COUNTER > 0) { signals::CFDP_MSG_COUNTER--; } - sif::debug << "CFDP msg counter: " << signals::CFDP_MSG_COUNTER << std::endl; + if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + sif::debug << "LiveTmTask: CFDP message counter: " << signals::CFDP_MSG_COUNTER << std::endl; + } store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; size_t size = 0; @@ -188,13 +190,17 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd void LiveTmTask::throttleCfdp() { throttlePeriodOngoing = true; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = true; - sif::debug << "throttling CFDP" << std::endl; + if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + sif::debug << "Throttling CFDP" << std::endl; + } } void LiveTmTask::releaseCfdp() { throttlePeriodOngoing = false; signals::CFDP_CHANNEL_THROTTLE_SIGNAL = false; - sif::debug << "releasing CFDP" << std::endl; + if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + sif::debug << "Releasing CFDP" << std::endl; + } } void LiveTmTask::updateBusyFlag() { diff --git a/mission/com/LiveTmTask.h b/mission/com/LiveTmTask.h index 04409b5d..48bbb9f9 100644 --- a/mission/com/LiveTmTask.h +++ b/mission/com/LiveTmTask.h @@ -15,6 +15,8 @@ #include "eive/definitions.h" +static constexpr bool DEBUG_CFDP_TO_LIVE_TM_TASK = false; + class LiveTmTask : public SystemObject, public HasModesIF, public ExecutableObjectIF, -- 2.43.0 From ce60a639ce63cf31f9ded4c6597c3abbc60551d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:48:43 +0200 Subject: [PATCH 11/14] small tweak --- mission/com/LiveTmTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/com/LiveTmTask.cpp b/mission/com/LiveTmTask.cpp index 32916afb..48e7476c 100644 --- a/mission/com/LiveTmTask.cpp +++ b/mission/com/LiveTmTask.cpp @@ -155,7 +155,7 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd if (isCfdp and signals::CFDP_MSG_COUNTER > 0) { signals::CFDP_MSG_COUNTER--; } - if (DEBUG_CFDP_TO_LIVE_TM_TASK) { + if (DEBUG_CFDP_TO_LIVE_TM_TASK and signals::CFDP_MSG_COUNTER > 0) { sif::debug << "LiveTmTask: CFDP message counter: " << signals::CFDP_MSG_COUNTER << std::endl; } store_address_t storeId = message.getStorageId(); -- 2.43.0 From d486c046344778118b3c01e695fbc6f43b07b407 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:55:19 +0200 Subject: [PATCH 12/14] better docs --- linux/ipcore/PapbVcInterface.h | 11 +++-------- mission/tmtc/DirectTmSinkIF.h | 6 ++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/linux/ipcore/PapbVcInterface.h b/linux/ipcore/PapbVcInterface.h index bcda5709..ddc9c074 100644 --- a/linux/ipcore/PapbVcInterface.h +++ b/linux/ipcore/PapbVcInterface.h @@ -35,18 +35,13 @@ class PapbVcInterface : public VirtualChannelIF { size_t maxPacketSize); virtual ~PapbVcInterface(); + // See interface function documentation for docs on these functions. + bool isBusy() const override; - /** - * - * @param data - * @param size - * @return returnvalue::OK on successfull write, PAPB_BUSY if PAPB is busy. - */ + ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override; ReturnValue_t advanceWrite(size_t& remainingSize) override; - // ReturnValue_t finishWriteInternal(const uint8_t* data, size_t start, size_t remainingSize, - // size_t& writtenSize, bool abortOnPartialWrite); void cancelTransfer() override; diff --git a/mission/tmtc/DirectTmSinkIF.h b/mission/tmtc/DirectTmSinkIF.h index 6ac182d2..ff8ab6fe 100644 --- a/mission/tmtc/DirectTmSinkIF.h +++ b/mission/tmtc/DirectTmSinkIF.h @@ -37,9 +37,15 @@ class DirectTmSinkIF { * @param writtenSize * @return returnvalue::OK if the packet write process is complete, PARTIALLY_WRITTEN if * some bytes were written but the transfer is not complete yet. + * NO_WRITE_ACTIVE if this is called without a valid previous write call. */ virtual ReturnValue_t advanceWrite(size_t& writtenSize) = 0; + /** + * Is busy, so no write operation can not be started and write advancement + * is not possible. + * @return + */ virtual bool isBusy() const = 0; /** * The PAPB interface is currently busy writing a packet and a new packet can not be written yet. -- 2.43.0 From f14d792658af10aad5e9969dbad2ff50389eca61 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 16:56:10 +0200 Subject: [PATCH 13/14] this should work as well now --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 9274878f..78b577c1 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,7 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 80; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; -- 2.43.0 From c5c9692ded8bc5463e7040c2a14401cfc6bbf257 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Oct 2023 17:09:50 +0200 Subject: [PATCH 14/14] lets leave it like this. --- common/config/eive/definitions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 78b577c1..9274878f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -65,7 +65,7 @@ static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300; static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400; -static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 80; +static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60; static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300; static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50; static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200; -- 2.43.0