RMM API 2.0.0
Loading...
Searching...
No Matches
RMMRings Class Reference

Classe to manage the setup, configuration, and teardown of RMM rings. More...

#include <RMMRings.h>

Collaboration diagram for RMMRings:

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.
 
RMMRinggetRing (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RMMRings()

RMMRings::RMMRings ( RMMRegisterAccess & RMMRegs)

Constructor for the RMMRings instance.

Parameters
RMMRegsReference to an RMMRegisterAccess instance for hardware register control.

Member Function Documentation

◆ addFrontEndToRing()

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.

Parameters
ringIdThe validated identifier of the ring where the FEN will be added.
frontendA shared pointer to the FrontEndBase (or derived) instance.

◆ bringup()

rmmStatus RMMRings::bringup ( RingId ringId)

Bringup a ring.

Parameters
ringIdRing identifier.
Returns
rmmStatus

◆ bringUpAllRings()

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.

◆ bringUpAllRingsInSequence()

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.

◆ checkRing()

ringStatus RMMRings::checkRing ( RingId ringId)

Perform a slow control read from all FEs in the ring.

Parameters
ringIdRing ID
Returns
ringStatus An enumeration indicating the status of the operation.
See also
ringStatus

◆ checkRings() [1/2]

ringStatus RMMRings::checkRings ( )

Perform a slow control read from all FEs to confirm rings are active.

Returns
ringSuccess if all rings are healthy, ringError otherwise.

◆ checkRings() [2/2]

ringStatus RMMRings::checkRings ( std::vector< int > & failedRings)

Perform a slow control read and identify specific failed rings.

Parameters
[out]failedRingsA vector to be populated with IDs of rings that failed the check.
Returns
ringSuccess if all rings are healthy, ringError otherwise.

◆ configureAllNodesInRing()

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.

Parameters
ringIdThe identifier of the ring to configure.

◆ getActiveRings()

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).

Returns
std::vector<int> A vector containing the indices (0 to MAX_NUM_RINGS - 1) of the operational rings. If no rings are active, the vector will be empty.

◆ getNumberOfNodes()

uint32_t RMMRings::getNumberOfNodes ( RingId ringId)

Retrieves the total number of Front-End Nodes registered in this ring.

Returns
uint32_t The count of FENs.

◆ getPacketCounters()

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.

Parameters
packetspointer to packets counters map to be updated.
Returns
rmmStatus success

◆ getPollTimeout()

int RMMRings::getPollTimeout ( )

Gets the timeout for polling in seconds.

Returns
timeout for polling in seconds after estimated time.

◆ getRing()

RMMRing & RMMRings::getRing ( RingId ringId)

Provides direct access to a specific RMMRing object.

This method retrieves a reference to the ring at the specified index.

Parameters
ringIdThe validated identifier for the target ring.
Returns
RMMRing& A reference to the requested ring object.

◆ getRingLogMsg()

rmmStatus RMMRings::getRingLogMsg ( std::string * msg,
RingId ringId )

Retrieves the latest log message from a specific ring's internal logger.

Parameters
[out]msgPointer to a string where the log message will be stored.
[in]ringIdThe identifier of the ring.
Returns
rmmStatus rmmSuccess if a message was retrieved, rmmError otherwise.

◆ getRingPollTimeout()

int RMMRings::getRingPollTimeout ( RingId ringId)

Retrieves the current polling timeout value of a specific ring.

Parameters
ringIdThe validated identifier of the target ring.
Returns
int The current timeout value.

◆ getRingStatus()

RingState RMMRings::getRingStatus ( RingId ringId) const

Retrieves a snapshot of the current status for a specific ring.

Parameters
ringIdThe validated identifier of the target ring.
Returns
RingState A structure containing the current operational parameters.
See also
RMMRing::getStatus()
RingState

◆ getSideChannelPacketCounter()

rmmStatus RMMRings::getSideChannelPacketCounter ( uint8_t sideChIdx,
uint32_t * value )

Retrieves the packet counter value for a specific side channel.

Parameters
[in]sideChIdxThe side channel index for which the packet counter is requested. Valid indices are 0 and 1.
[out]valuePointer to a uint32_t variable where the packet counter value will be stored.
Returns
rmmSuccess if the packet counter was successfully retrieved.
rmmError if the side channel index is invalid.

◆ initialConfig()

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

◆ isRingActive()

bool RMMRings::isRingActive ( RingId ringId)

Checks if a specific ring is initialized and operational.

Parameters
ringIdThe validated identifier for the ring to check.
Returns
true if the ring is initialized and fully operational, false otherwise.

◆ setPollTimeout()

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.

Parameters
[in]valuevalue in seconds to set timeout.

◆ setRingEnabled()

rmmStatus RMMRings::setRingEnabled ( RingId ringId,
bool enable )

Sets the software-level enabled status for the specified ring.

Parameters
ringIdThe target ring identifier.
enableTrue to enable, false to disable.

◆ setRingLogMask()

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.

Parameters
ringIdRing identifier.
maskBitmask of enabled log levels.
Returns
rmmSuccess if the ring exists and the mask was applied, rmmError otherwise.

◆ setRingPollTimeout()

void RMMRings::setRingPollTimeout ( RingId ringId,
int value )

Sets the polling timeout value for a specific ring.

Parameters
ringIdThe validated identifier of the target ring.
valueThe timeout value to set (typically in milliseconds).

◆ startRingBulkData()

rmmStatus RMMRings::startRingBulkData ( RingId ringId)

Inform all FEs in the ring that they can start sending bulk data.

Parameters
ringIdThe validated identifier of the target ring.

◆ teardownAllRings()

rmmStatus RMMRings::teardownAllRings ( )

Teardown all possible rings.

Returns
status

◆ tearDownRing()

rmmStatus RMMRings::tearDownRing ( RingId ringId,
bool waitTime = true )

Teardown a specific ring of the RMM.

Parameters
ringIdThe index of the ring to tear down.
waitTimeIf true, the function waits for the full teardown timeout.
Returns
- rmmSuccess if the teardown completed successfully or was already in progress.
  • mmError if the ring index is out of range or an error occurred while writing registers.

The documentation for this class was generated from the following files: