Sd 22337 monarch fine grained control real time telemetry selection feature - #19
Conversation
This reverts commit f48314f.
… NAK processed logic
…that hook into the tlmpacketizer
…fied time not nanosec)
… fail build until this commit's change
… input before), as per recommendation of Michael Starch
|
|
||
| @ Maximum number of per-packet config entries carried in a single push batch. | ||
| @ Sized so one fully-serialized batch stays well within FW_COM_BUFFER_MAX_SIZE. | ||
| constant TLM_PACKET_CONFIG_BATCH_MAX = 32 |
There was a problem hiding this comment.
note this "batched config write" feature is required b/c of the FW_COM_BUFFER_MAX_SIZE (~2k) limitation means we can only send out the configOut port so many per-packet override configs serialized at a time...
There was a problem hiding this comment.
This should be moved to TlmPackizerCfg.fpp
| this->invoke_to_TlmRecv(0, 100, ts, buff); // second channel | ||
| buff.resetSer(); | ||
| (void)buff.serializeFrom(static_cast<U8>(14)); | ||
| this->invoke_to_TlmRecv(0, 333, ts, buff); // third channel |
There was a problem hiding this comment.
skipping the fourth channel is intentionally...following same pattern of skipping found in many other unit tests throughout this file
| return outIndex; | ||
| } | ||
|
|
||
| Svc::PacketConfig TlmPacketizer::effectiveConfig(FwIndexType section, FwChanIdType pkt, FwChanIdType group) const { |
There was a problem hiding this comment.
"effective" in the sense of prioritize the per-packet override...and if there's none -> then use the group config of which the packet is a part
| rateLogic: RateLogic @< Rate logic | ||
| minDelta: U32 @< Minimum Sched ticks between sends (ON_CHANGE_MIN logic) | ||
| maxDelta: U32 @< Maximum Sched ticks between sends (EVERY_MAX logic) | ||
| ) \ |
There was a problem hiding this comment.
the three functions above mirror the same functionality available for the "group"-level...now we're exposes the "per-packet" more 'fine-grain' level
| telemetry SectionEnabled: SectionEnabled id 1 | ||
|
|
||
| @ Effective per-packet configuration, emitted in response to GET_PACKET_CONFIG | ||
| telemetry QueriedPacketConfig: PacketConfigEntry id 2 |
There was a problem hiding this comment.
notice the comment here...esp useful for debugging
|
|
||
| @ Per-packet configuration reload from the persistence storage component | ||
| @ That storage component pushes it's config into this port when commanded to do so (usually at boot-up) | ||
| async input port configIn: TlmPacketConfigUpdate |
There was a problem hiding this comment.
this was motivated by the use-case...
somehow the TlmPacketizer needs to get the persisted packet-overrides after a reboot...this port is the way you get this config in here
| async command GET_PACKET_CONFIG( | ||
| packetId: U32 @< Packet identifier | ||
| section: TelemetrySection @< Section to query | ||
| ) \ |
There was a problem hiding this comment.
after sending this command check the QueriedPacketConfig telemetry channel for the latest packet config asked for!
| //! CONFIGURE_PACKET_RATES commands. When m_packetOverridden is set, this value wins over | ||
| //! the group-derived policy for that packet/section. This is the per-packet control layer; | ||
| //! group config remains the base for non-overridden packets. Each change is mirrored out | ||
| //! configOut to the passive TlmPacketConfig for persistence. |
There was a problem hiding this comment.
packet override >> group policy
| rateLogic: RateLogic @< Rate logic configuration | ||
| min: U32 @< Minimum Sched ticks between sends when using ON_CHANGE_MIN logic | ||
| max: U32 @< Maximum Sched ticks between sends when using EVERY_MAX logic | ||
| } |
There was a problem hiding this comment.
PacketConfig mirrors the struct GroupConfig
Brian-Campuzano
left a comment
There was a problem hiding this comment.
Recommend updating the SDD to keep track of how packet level overrides interact with the existing "knobs". Also need to update the component port interface definition.
|
|
||
| @ Maximum number of per-packet config entries carried in a single push batch. | ||
| @ Sized so one fully-serialized batch stays well within FW_COM_BUFFER_MAX_SIZE. | ||
| constant TLM_PACKET_CONFIG_BATCH_MAX = 32 |
There was a problem hiding this comment.
This should be moved to TlmPackizerCfg.fpp
| } | ||
| s = static_cast<FwSizeType>(section.e); | ||
| if (not this->m_packetOverridden[s][pkt]) { | ||
| this->m_packetOverride[s][pkt] = TlmPacketizer::defaultPacketConfig(); |
There was a problem hiding this comment.
Should this be overriding with the effectiveConfig() instead of the defaultPacketConfig()?
| if (this->m_packetOverridden[s][pkt]) { | ||
| return this->m_packetOverride[s][pkt]; |
There was a problem hiding this comment.
Once a packet has been overridden, how is it cleared? Do we need a new command?
| // Not overridden: derive from the group policy for this packet's level (legacy behavior). | ||
| const TlmPacketizer_GroupConfig& gc = this->m_groupConfigs[s][group]; | ||
| Svc::PacketConfig eff; | ||
| eff.set_enabled(gc.get_enabled()); | ||
| eff.set_forceEnabled(gc.get_forceEnabled()); | ||
| eff.set_rateLogic(gc.get_rateLogic()); | ||
| eff.set_min(gc.get_min()); | ||
| eff.set_max(gc.get_max()); | ||
| return eff; |
There was a problem hiding this comment.
This and the return on 652 is building/copying a new PacketConfig and returning by value every evaluation cycle. Consider refactoring to return a reference a performance improvement.
| void TlmPacketizer ::configIn_handler(FwIndexType portNum, FwSizeType count, const Svc::PacketConfigBatch& batch) { | ||
| // load overrides from an external component's persistant storage of the overrides (intended to be used after a reboot) | ||
| const FwSizeType cap = static_cast<FwSizeType>(Svc::PacketConfigBatch::SIZE); | ||
| const FwSizeType n = (count < cap) ? count : cap; |
There was a problem hiding this comment.
Consider a warning EVR if the cap is exceeded.
SD-22337-monarch-fine-grained-control-real-time-telemetry-selection-featureChange Description
support per-packet configuration, write out the per-packet overrides to persistent storage via a
configOutport to a component of your choosing which manages the storage; at boot-up pull in config written to persistent storage viaconfigInportRationale
facilitates "finer-grain" control of packet telemetry configuration (rather than the more "coarse" control at the TlmPacketizer's group-level); this "finer-grain" per-packet control is being requested from some of FF's missions
Testing/Review Recommendations
ENABLE_PACKET()andFORCE_PACKET()influence run-time behavior as expectedFuture Work
n/a
AI Usage (see policy)
understood