From 519b09db143e87b3d43f39790486f6c5dc1be96b Mon Sep 17 00:00:00 2001 From: Marty Gloff Date: Tue, 13 Feb 2018 10:46:34 -0600 Subject: Support multiple nodes in HBRT - Concurrent Code Update Enable HBRT to prepare for a concurrent code update on a multiple node system. Modify preparation function called by Host to loop through all nodes on the system. Make additional updates to go from supporting only a single node to supporting multiple nodes. Change-Id: I2d72b26abf40812641815051b968d6b540d27b00 RTC: 186584 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53952 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes Reviewed-by: Prachi Gupta Reviewed-by: Daniel M. Crowell --- src/include/usr/runtime/rt_targeting.H | 8 +-- src/include/usr/targeting/attrrp.H | 51 +++++++++++--- src/include/usr/targeting/common/target.H | 90 +++++++++++++++++++++++- src/include/usr/targeting/common/targetservice.H | 25 ++++--- 4 files changed, 143 insertions(+), 31 deletions(-) (limited to 'src/include') diff --git a/src/include/usr/runtime/rt_targeting.H b/src/include/usr/runtime/rt_targeting.H index 9f3d96818..9070dbc88 100644 --- a/src/include/usr/runtime/rt_targeting.H +++ b/src/include/usr/runtime/rt_targeting.H @@ -67,12 +67,12 @@ namespace RT_TARG * into new LID Structure data * @param[in] Pointer to current Reserved Memory targeting binary data * @param[in/out] Pointer to new LID Structure targeting binary data - * @param[out] Error log userdata2 value associated with non-zero rtn code + * @param[in] Instance, ie, Node ID * @return nullptr on success, else error log */ errlHndl_t saveRestoreAttrs(void *i_rsvdMemPtr, void *io_lidStructPtr, - uint64_t& o_userdata2); + uint8_t i_instance); /** * @brief Validate LID Structure against Reserved Memory. Check that the @@ -82,13 +82,11 @@ namespace RT_TARG * @param[in] Pointer to new LID Structure targeting binary data * @param[in] Pointer to current Reserved Memory targeting binary data * @param[out] Total size of all sections in the new lid - * @param[out] Error log userdata2 value associated with non-zero rtn code * @return nullptr on success, else error log */ errlHndl_t validateData(void *i_lidStructPtr, void *i_rsvdMemPtr, - size_t& o_lidTotalSize, - uint64_t& o_userdata2); + size_t& o_lidTotalSize); /** * @brief Apply ATTR_TMP overrides to be available for run time diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H index 6eb367e17..897e6dec4 100644 --- a/src/include/usr/targeting/attrrp.H +++ b/src/include/usr/targeting/attrrp.H @@ -114,7 +114,7 @@ class AttrRP #else friend errlHndl_t RT_TARG::saveRestoreAttrs(void *, void *, - uint64_t&); + uint8_t); #endif public: @@ -306,14 +306,16 @@ class AttrRP #else /** - * @brief Fill in new attribute resource provider for HBRT. + * @brief Get node instance status of attribute resource provider + * which indicates if the attribute resource provider is handling + * a single node or multiple nodes * - * @param[in] i_header - * TargetingHeader to use with filling in the new RT AttrRP. - * - * @return void + * @return Node instance status */ - void fillInAttrRP(TargetingHeader* i_header); + NodeInstanceStatus getInstanceStatus() + { + return iv_instanceStatus; + } /** * @brief Get count of nodes handled by attribute resource provider. @@ -352,12 +354,39 @@ class AttrRP * @par Detailed Description: * Ensures member variables are initialized to sane values. */ - AttrRP(TargetingHeader* i_header) - : iv_isTempInstance(true), iv_instanceStatus(SINGLE_NODE), + AttrRP(TargetingHeader* i_header, + NODE_ID i_nodeId, + size_t i_nodeCount, + NodeInstanceStatus i_instanceStatus) + : iv_isTempInstance(true), iv_instanceStatus(i_instanceStatus), iv_isMpipl(false) { - // Fill in member variables - fillInAttrRP(i_header); + // Work with nodes before passed in node + for(NODE_ID l_nodeId = NODE0; l_nodeId < i_nodeCount; ++l_nodeId) + { + // Create local copy of container for node info struct + NodeInfo l_nodeCont; + + if(l_nodeId == i_nodeId) + { + // Initialize local copy of container for node info struct + errlHndl_t l_errl = nodeInfoInit(l_nodeCont, + i_header, + i_nodeId); + if (l_errl) + { + l_errl->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE); + + /* Commit the error */ + errlCommit(l_errl, TARG_COMP_ID); + + break; + } + } + + // Push back node info struct into the node container + iv_nodeContainer.push_back(l_nodeCont); + } }; #endif diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H index 7bdd16f54..21f3d7fba 100644 --- a/src/include/usr/targeting/common/target.H +++ b/src/include/usr/targeting/common/target.H @@ -64,7 +64,7 @@ namespace RT_TARG void adjustTargeting4Runtime(); ERRORLOG::ErrlEntry* saveRestoreAttrs(void *i_rsvdMemPtr, void *io_lidStructPtr, - uint64_t& o_userdata2); + uint8_t i_instance); } #endif @@ -179,6 +179,34 @@ class Target template typename AttributeTraits::Type getAttr() const; + /** + * @brief Get the target's specified attribute value + * + * Returns the target's specified attribute value. If the specified + * attribute does not exist for the associated target, the routine + * asserts. Thus callers must be sure the attribute exists for the + * given target. + * + * @param[in] i_attrRP Pointer to attribute resource provider + * @param[in] i_pAttrId Pointer to array of attribute IDs for target + * @param[in] i_ppAttrAddr Pointer to array of attribute addresses + * + * @pre Target service must be initialized + * + * @post Target's specified attribute value returned, or assert + * called if specified attribute doesn't exist for the + * associated target + * + * @return Data type associated with the attribute being returned + * + * @retval Varies The attribute data + */ + template + typename AttributeTraits::Type getAttr(AttrRP* i_attrRP, + ATTRIBUTE_ID* i_pAttrId, + AbstractPointer* + i_ppAttrAddr) const; + /** * @brief DEBUG ONLY! Returns the requested attribute as a string * @@ -479,6 +507,39 @@ class Target uint32_t i_size, void* io_attrData) const; + /** + * @brief Tries to get the target's specified attribute value without + * checking for valid values. Do not call this function + * directly. This function is private. + * + * Tries to get the target's specified attribute value + * + * @param[in] i_attr Attribute to retrieve + * @param[in] i_size Size of the attribute + * @param[in] i_attrRP Pointer to attribute resource provider + * @param[in] i_pAttrId Pointer to array of attribute IDs for target + * @param[in] i_ppAttrAddr Pointer to array of attribute addresses + * @param[in/out] io_attrData On input, location to store the attribute + * On output, location updated with attribute data + * + * @pre Target service must be initialized + * + * @post Caller notified if attribute retrieval succeeded or not. If + * so, the attribute data is stored at io_addrData + * + * @return bool indicating if attribute retrieval succeeded or not + * + * @retval true Attribute retrieval succeeded + * @retval false Attribute retrieval failed + */ + bool _tryGetAttrUnsafe( + ATTRIBUTE_ID i_attr, + uint32_t i_size, + AttrRP* i_attrRP, + ATTRIBUTE_ID* i_pAttrId, + AbstractPointer* i_ppAttrAddr, + void* io_attrData) const; + /** * @brief Tries to set the target's specified attribute value * @@ -704,7 +765,7 @@ class Target friend void RT_TARG::adjustTargeting4Runtime(); friend ERRORLOG::ErrlEntry* RT_TARG::saveRestoreAttrs(void *, void *, - uint64_t&); + uint8_t); #endif @@ -763,6 +824,31 @@ typename AttributeTraits::Type Target::getAttr() const return l_attrValue; } +template +typename AttributeTraits::Type Target::getAttr(AttrRP* i_attrRP, + ATTRIBUTE_ID* i_pAttrId, + AbstractPointer* + i_ppAttrAddr) const +{ + typename AttributeTraits::Type l_attrValue; + if(AttributeTraits::readable) { } + if(AttributeTraits::notHbMutex) { } + if(AttributeTraits::notFspMutex) { } + + bool l_read = _tryGetAttrUnsafe(A, + sizeof(l_attrValue), + i_attrRP, + i_pAttrId, + i_ppAttrAddr, + reinterpret_cast(&l_attrValue)); + + if (unlikely(!l_read)) + { + targAssert(GET_ATTR, A); + } + return l_attrValue; +} + template void Target::setAttr(typename AttributeTraits::Type const& i_attrValue) { diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H index c02826b77..82001c0ae 100644 --- a/src/include/usr/targeting/common/targetservice.H +++ b/src/include/usr/targeting/common/targetservice.H @@ -726,31 +726,30 @@ class TargetService void getMasterNodeTarget(Target*& o_masterNodeTarget) const; /** - * @brief Returns Target Range Filter information. + * @brief Returns Array of Targets from Targeting Image. * * @par Detailed Description: - * Returns the Target Range Filter information for the specified - * attribute data and resource provider. + * Returns a pointer to the Array of Targets found in the Targeting + * Image as provided by the Attribute Data. * * @param[in] i_attrData pointer to attribute data * - * @param[in] i_attrRP pointer to attribute resource provider + * @param[in] i_nodeId, node ID for the targeting image * - * @param[out] o_maxTargets maximum targets in the range + * @param[in] i_attrRP pointer to attribute resource provider * - * @param[in] i_nodeId, node ID for the target. + * @param[out] o_maxTargets maximum targets in image * * @pre TargetService must be initialized. * - * @post Returns the Target Range Filter information for the specified - * attribute data and resource provider. + * @post Returns pointer to Array of Targets from Targeting Image. * - * @return TargetRangeFilter + * @return Target* */ - TargetRangeFilter getTargetRangeFilter(void *i_attrData, - AttrRP *i_attrRP, - uint32_t &o_maxTargets, - NODE_ID i_nodeId); + Target* getTargetArray(void *i_attrData, + NODE_ID i_nodeId, + AttrRP *i_attrRP, + uint32_t &o_maxTargets); /** * @brief Returns Target Attribute information. -- cgit v1.2.1