|
RMM API 2.0.0
|
Classe to manage the setup, configuration, and teardown of RMM rings. More...
#include <RMMRings.h>

Public Member Functions | |
| RMMRings (RMMRegisterAccess &RMMRegs) | |
Constructor for the RMMRings instance. | |
| rmmStatus | teardownAllRings () |
| Teardown all possible rings. | |
| rmmStatus | tearDownRing (RingId ringId, bool waitTime=true) |
| Teardown a specific ring of the RMM. | |
| rmmStatus | bringup (RingId ringId) |
| Bringup a ring. | |
| void | bringUpAllRings () |
| Initializes and configures all active rings. | |
| void | bringUpAllRingsInSequence () |
| Initializes and configures all active rings, one by one. | |
| ringStatus | checkRings () |
| Perform a slow control read from all FEs to confirm rings are active. | |
| ringStatus | checkRings (std::vector< int > &failedRings) |
| Perform a slow control read and identify specific failed rings. | |
| ringStatus | checkRing (RingId ringId) |
| Perform a slow control read from all FEs in the ring. | |
| void | resetPacketCounters () |
| Reset all packet counters back to 0. Useful if the counters start saturating at 0xFFFF_FFFF. | |
| rmmStatus | getPacketCounters (PacketCountMap *packets) |
| Return the updated packet counters.. There are 2 types of counters, one set that counts the per-fibre (odd and even) bulk data packets, and then one set that counts per-node in the output queues. | |
| rmmStatus | getSideChannelPacketCounter (uint8_t node, uint32_t *value) |
| Retrieves the packet counter value for a specific side channel. | |
| uint32_t | getNumberOfNodes (RingId ringId) |
| Retrieves the total number of Front-End Nodes registered in this ring. | |
| void | initialConfig () |
| Executes the initial RMM setup ready to bring up the rings. | |
| rmmStatus | setRingEnabled (RingId ringId, bool enable) |
| Sets the software-level enabled status for the specified ring. | |
| rmmStatus | setRingLogMask (RingId ringId, int mask) |
| Set the log mask for a specific ring. | |
| std::vector< int > | getActiveRings () const |
| Retrieves a list of indices for all currently active rings. | |
| RMMRing & | getRing (RingId ringId) |
| Provides direct access to a specific RMMRing object. | |
| bool | isRingActive (RingId ringId) |
| Checks if a specific ring is initialized and operational. | |
| int | getPollTimeout () |
| Gets the timeout for polling in seconds. | |
| void | setPollTimeout (int value) |
| Sets the timeout for polling in seconds. Timeout starts counting after the polling exceeds initial estimated, not at start of polling. | |
| void | setRingPollTimeout (RingId ringId, int value) |
| Sets the polling timeout value for a specific ring. | |
| int | getRingPollTimeout (RingId ringId) |
| Retrieves the current polling timeout value of a specific ring. | |
| RingState | getRingStatus (RingId ringId) const |
| Retrieves a snapshot of the current status for a specific ring. | |
| void | addFrontEndToRing (RingId ringId, std::shared_ptr< FrontEndBase > frontend) |
| Registers a Front-End Node (FEN) to a specific ring. | |
| void | configureAllNodesInRing (RingId ringId) |
| Iterates through all Front-End Nodes (FENs) in a ring and triggers their configuration. | |
| rmmStatus | getRingLogMsg (std::string *msg, RingId ringId) |
| Retrieves the latest log message from a specific ring's internal logger. | |
| rmmStatus | startBulkData () |
| Inform all FEs in the topology that they can start sending bulk data. | |
| rmmStatus | startRingBulkData (RingId ringId) |
| Inform all FEs in the ring that they can start sending bulk data. | |
Public Attributes | |
| RMMLog | rmmLog |
| Log handler for RMMRings messages. | |
Static Public Attributes | |
| static constexpr int | FE_DEFAULT_LOCK_TIME = 16 |
| Seconds typical for a FE jitter cleaner to lock to 95BC. | |
Classe to manage the setup, configuration, and teardown of RMM rings.
This class is responsible for configuring and managing RMM rings, handling packet counters, synchronizing nodes, and ensuring the correct operation of the transceivers. It interacts with the RMMRegisterAccess for hardware register manipulation.
| RMMRings::RMMRings | ( | RMMRegisterAccess & | RMMRegs | ) |
Constructor for the RMMRings instance.
| RMMRegs | Reference to an RMMRegisterAccess instance for hardware register control. |
| void RMMRings::addFrontEndToRing | ( | RingId | ringId, |
| std::shared_ptr< FrontEndBase > | frontend ) |
Registers a Front-End Node (FEN) to a specific ring.
This method acts as the entry point for building the system topology. It assigns the provided front-end object to the internal collection of the specified ring.
| ringId | The validated identifier of the ring where the FEN will be added. |
| frontend | A shared pointer to the FrontEndBase (or derived) instance. |
| rmmStatus RMMRings::bringup | ( | RingId | ringId | ) |
Bringup a ring.
| ringId | Ring identifier. |
| void RMMRings::bringUpAllRings | ( | ) |
Initializes and configures all active rings.
This method performs the setup required to bring up all rings in the system. It first calls commonRingSetup() to apply common configurations, then iterates over all active rings retrieved from the topology and asynchronously executes ringSetup() for each ring.
The setup tasks are executed concurrently using std::async to improve performance, and the method waits for all tasks to complete before returning.
| void RMMRings::bringUpAllRingsInSequence | ( | ) |
Initializes and configures all active rings, one by one.
same as RMMRings::bringUpAllRings, but with sequential execution. Intended to be used by developers who want to troubleshoot problematic ring so that error logs are not flooded by other rings that are working well.
| ringStatus RMMRings::checkRing | ( | RingId | ringId | ) |
Perform a slow control read from all FEs in the ring.
| ringId | Ring ID |
| ringStatus RMMRings::checkRings | ( | ) |
Perform a slow control read from all FEs to confirm rings are active.
| ringStatus RMMRings::checkRings | ( | std::vector< int > & | failedRings | ) |
Perform a slow control read and identify specific failed rings.
| [out] | failedRings | A vector to be populated with IDs of rings that failed the check. |
| void RMMRings::configureAllNodesInRing | ( | RingId | ringId | ) |
Iterates through all Front-End Nodes (FENs) in a ring and triggers their configuration.
This method retrieves the specified ring and calls the FrontEndBase::configFE method for every node registered in that ring's topology.
| ringId | The identifier of the ring to configure. |
| std::vector< int > RMMRings::getActiveRings | ( | ) | const |
Retrieves a list of indices for all currently active rings.
This method iterates through all managed rings and collects the indices of those that are both non-null and meet the operational criteria (enabled and in topology).
| uint32_t RMMRings::getNumberOfNodes | ( | RingId | ringId | ) |
Retrieves the total number of Front-End Nodes registered in this ring.
| rmmStatus RMMRings::getPacketCounters | ( | PacketCountMap * | packets | ) |
Return the updated packet counters.. There are 2 types of counters, one set that counts the per-fibre (odd and even) bulk data packets, and then one set that counts per-node in the output queues.
| packets | pointer to packets counters map to be updated. |
| int RMMRings::getPollTimeout | ( | ) |
Gets the timeout for polling in seconds.
| rmmStatus RMMRings::getRingLogMsg | ( | std::string * | msg, |
| RingId | ringId ) |
Retrieves the latest log message from a specific ring's internal logger.
| [out] | msg | Pointer to a string where the log message will be stored. |
| [in] | ringId | The identifier of the ring. |
| int RMMRings::getRingPollTimeout | ( | RingId | ringId | ) |
Retrieves the current polling timeout value of a specific ring.
| ringId | The validated identifier of the target ring. |
Retrieves a snapshot of the current status for a specific ring.
| ringId | The validated identifier of the target ring. |
| rmmStatus RMMRings::getSideChannelPacketCounter | ( | uint8_t | sideChIdx, |
| uint32_t * | value ) |
Retrieves the packet counter value for a specific side channel.
| [in] | sideChIdx | The side channel index for which the packet counter is requested. Valid indices are 0 and 1. |
| [out] | value | Pointer to a uint32_t variable where the packet counter value will be stored. |
rmmSuccess if the packet counter was successfully retrieved. rmmError if the side channel index is invalid. | void RMMRings::initialConfig | ( | ) |
Executes the initial RMM setup ready to bring up the rings.
This is run before we start bringing up the first ring
| bool RMMRings::isRingActive | ( | RingId | ringId | ) |
Checks if a specific ring is initialized and operational.
| ringId | The validated identifier for the ring to check. |
| void RMMRings::setPollTimeout | ( | int | value | ) |
Sets the timeout for polling in seconds. Timeout starts counting after the polling exceeds initial estimated, not at start of polling.
| [in] | value | value in seconds to set timeout. |
| rmmStatus RMMRings::setRingEnabled | ( | RingId | ringId, |
| bool | enable ) |
Sets the software-level enabled status for the specified ring.
| ringId | The target ring identifier. |
| enable | True to enable, false to disable. |
| rmmStatus RMMRings::setRingLogMask | ( | RingId | ringId, |
| int | mask ) |
Set the log mask for a specific ring.
Controls which log levels are enabled for the given ring id.
| ringId | Ring identifier. |
| mask | Bitmask of enabled log levels. |
| void RMMRings::setRingPollTimeout | ( | RingId | ringId, |
| int | value ) |
Sets the polling timeout value for a specific ring.
| ringId | The validated identifier of the target ring. |
| value | The timeout value to set (typically in milliseconds). |
| rmmStatus RMMRings::startRingBulkData | ( | RingId | ringId | ) |
Inform all FEs in the ring that they can start sending bulk data.
| ringId | The validated identifier of the target ring. |
| rmmStatus RMMRings::teardownAllRings | ( | ) |
Teardown all possible rings.
| rmmStatus RMMRings::tearDownRing | ( | RingId | ringId, |
| bool | waitTime = true ) |
Teardown a specific ring of the RMM.
| ringId | The index of the ring to tear down. |
| waitTime | If true, the function waits for the full teardown timeout. |