Skip to content

Commit

Permalink
Fix deconfigure parent rollup policy
Browse files Browse the repository at this point in the history
Change to specifically designate if a target is
allowed to be deconfigured by child rollup and if
it should rollup to its parent.
Need to cover the case where there are two different types of children
and only one is allowed to rollup to the parent.
Also prevent the deconfigure rollup from happening to the parent.

Change-Id: I514876a46e9c8180e1fc99a969e0ca4247fbf2d9
CQ:SW454562
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70759
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Jan 31, 2019
1 parent 23c66cc commit 8293d83
Show file tree
Hide file tree
Showing 5 changed files with 914 additions and 88 deletions.
98 changes: 74 additions & 24 deletions src/usr/hwas/common/deconfigGard.C
Original file line number Diff line number Diff line change
Expand Up @@ -1605,8 +1605,11 @@ void DeconfigGard::_deconfigAffinityParent( TARGETING::Target & i_child,
const DeconfigureFlags i_deconfigRule )
{
Target * l_parent = NULL;
TARGETING::ATTR_PARENT_DECONFIG_RULES_type l_child_rules =
i_child.getAttr<ATTR_PARENT_DECONFIG_RULES>();

if (!i_child.getAttr<ATTR_PARENT_DECONFIG_DISABLED>())
// Does this deconfigured child allow the deconfig to rollup to its parent
if (l_child_rules.deconfigureParent)
{
// General predicate to determine if target is functional
PredicateIsFunctional isFunctional;
Expand All @@ -1615,32 +1618,40 @@ void DeconfigGard::_deconfigAffinityParent( TARGETING::Target & i_child,

if ((l_parent != NULL) && isFunctional(l_parent))
{
// Now check if parent has any functional affinity children
// that match the same type/class as the child
if ( !anyFunctionalChildLikeMe(l_parent, &i_child) )
TARGETING::ATTR_PARENT_DECONFIG_RULES_type l_parent_rules =
l_parent->getAttr<ATTR_PARENT_DECONFIG_RULES>();
// Does the parent allow its deconfigured children to rollup their
// deconfigure to itself? This is a safety check to prevent
// essential resources from being deconfigured via rollup.
if (l_parent_rules.childRollupAllowed)
{
bool isDeconfigured = false;
HWAS_INF("_deconfigAffinityParent: deconfig functional parent 0x%.8X, EID 0x%.8X",
get_huid(l_parent), i_errlEid);
_deconfigureTarget(*l_parent, i_errlEid,
&isDeconfigured, i_deconfigRule);
if (isDeconfigured)
// Now check if parent has any functional affinity children
// that match the same type/class as the child
if ( !anyFunctionalChildLikeMe(l_parent, &i_child) )
{
HWAS_INF("_deconfigAffinityParent: roll-up parent 0x%.8X deconfig, EID 0x%.8X",
bool isDeconfigured = false;
HWAS_INF("_deconfigAffinityParent: deconfig functional parent 0x%.8X, EID 0x%.8X",
get_huid(l_parent), i_errlEid);
_deconfigureTarget(*l_parent, i_errlEid,
&isDeconfigured, i_deconfigRule);
if (isDeconfigured)
{
HWAS_INF("_deconfigAffinityParent: roll-up/down parent 0x%.8X deconfig, EID 0x%.8X",
get_huid(l_parent), i_errlEid);
// need to account for possible non-like functional children
_deconfigureByAssoc(*l_parent, i_errlEid, i_deconfigRule);
}
}
else
{
HWAS_INF("_deconfigAffinityParent: functional child found for parent 0x%.8X, EID 0x%.8X",
get_huid(l_parent), i_errlEid);

// Just need to rollup the deconfig
// (all children already marked as non-functional)
// Roll up deconfigure to parent's parent,
// call this to take care of special deconfig cases
_deconfigParentAssoc(*l_parent, i_errlEid, i_deconfigRule);
}
}
else
{
HWAS_INF("_deconfigAffinityParent: functional child found for parent 0x%.8X, EID 0x%.8X",
get_huid(l_parent), i_errlEid);

HWAS_INF("_deconfigAffinityParent: parent 0x%.8X does NOT allow deconfig via child rollup",
get_huid(l_parent));
}
}
else
Expand All @@ -1654,7 +1665,7 @@ void DeconfigGard::_deconfigAffinityParent( TARGETING::Target & i_child,
}
else
{
HWAS_INF("_deconfigAffinityParent: PARENT_DECONFIG_DISABLED for child 0x%.8X, EID 0x%.8X",
HWAS_INF("_deconfigAffinityParent: do not rollup deconfigured child 0x%.8X, EID 0x%.8X",
get_huid(&i_child), i_errlEid);
}
}
Expand Down Expand Up @@ -1898,6 +1909,44 @@ void DeconfigGard::_deconfigParentAssoc(TARGETING::Target & i_target,
break;
} // TYPE_EX

case TYPE_DIMM:
{
// Whenever a DIMM is deconfigured, we will also deconfigure
// the immediate parent target (e.g. MCA, MBA, etc) to ensure
// there is not an unbalanced load on the ports.

// General predicate to determine if target is functional
PredicateIsFunctional isFunctional;

// get immediate parent (MCA/MBA/etc)
TargetHandleList pParentList;
PredicatePostfixExpr funcParent;
funcParent.push(&isFunctional);
targetService().getAssociated(pParentList,
&i_target,
TargetService::PARENT_BY_AFFINITY,
TargetService::IMMEDIATE,
&funcParent);

HWAS_ASSERT((pParentList.size() <= 1),
"HWAS _deconfigParentAssoc: pParentList > 1");

// if parent hasn't already been deconfigured
// then deconfigure it
if (!pParentList.empty())
{
const Target *l_parentMba = pParentList[0];
HWAS_INF("_deconfigParentAssoc DIMM parent: %.8X",
get_huid(l_parentMba));
_deconfigureTarget(const_cast<Target &> (*l_parentMba),
i_errlEid, NULL, i_deconfigRule);
_deconfigureByAssoc(const_cast<Target &> (*l_parentMba),
i_errlEid, i_deconfigRule);
}

break;
} // TYPE_DIMM

// If target is a bus endpoint, deconfigure its peer
case TYPE_XBUS:
case TYPE_ABUS:
Expand All @@ -1918,6 +1967,7 @@ void DeconfigGard::_deconfigParentAssoc(TARGETING::Target & i_target,
}
break;
} // TYPE_XBUS, TYPE_ABUS, TYPE_PSI

case TYPE_OBUS:
{
// Only deconfigure peer endpoint if OBUS set to SMP mode
Expand All @@ -1940,7 +1990,7 @@ void DeconfigGard::_deconfigParentAssoc(TARGETING::Target & i_target,
}
}
break;
}
} // TYPE_OBUS

case TYPE_OBUS_BRICK:
{
Expand Down Expand Up @@ -2061,8 +2111,8 @@ void DeconfigGard::_deconfigParentAssoc(TARGETING::Target & i_target,
}
default:
{
// TYPE_MEMBUF, TYPE_MCA, TYPE_MCS, TYPE_MI, TYPE_DMI,
// TYPE_MBA, TYPE_DIMM, TYPE_PHB, TYPE_OBUS_BRICK, TYPE_PORE
// TYPE_MEMBUF, TYPE_MCA, TYPE_MCS, TYPE_MC, TYPE_MI, TYPE_DMI,
// TYPE_MBA, TYPE_PHB, TYPE_OBUS_BRICK, TYPE_EQ
_deconfigAffinityParent(i_target, i_errlEid, i_deconfigRule);
}
break;
Expand Down
44 changes: 34 additions & 10 deletions src/usr/hwas/test/hwasGardTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -62,6 +62,30 @@ bool compareAffinityCXX(const TargetInfo t1, const TargetInfo t2)
class HwasGardTest: public CxxTest::TestSuite
{
public:
/**
* @brief Test which verifies all targets have a valid deconfig rule
*/
void testParentDeconfigRules()
{
TS_TRACE(INFO_MRK "testParentDeconfigRules: Started");
HWAS_INF("testParentDeconfigRules: Started");

TARGETING::TargetIterator l_pTarget;
for( l_pTarget = TARGETING::targetService().begin();
l_pTarget != TARGETING::targetService().end();
++l_pTarget
)
{
TARGETING::ATTR_PARENT_DECONFIG_RULES_type l_rules =
l_pTarget->getAttr<ATTR_PARENT_DECONFIG_RULES>();
if (l_rules.valid == 0)
{
TS_FAIL("testParentDeconfigRules: 0x%.8X target has invalid ATTR_PARENT_DECONFIG_RULES",
TARGETING::get_huid(*l_pTarget));
}
}
HWAS_INF("testParentDeconfigRules: Ended");
}

/**
* @brief Test creating and getting a Deconfigure Record for a
Expand Down Expand Up @@ -4871,7 +4895,7 @@ public:
l_targets.push_back(l_TargetInfo);

presentByAssoc(l_targets, l_targToDeconfig);

// MI only
l_ep[1].addLast(TYPE_MC, 0);
l_ep[1].addLast(TYPE_MI, 0);
Expand All @@ -4881,7 +4905,7 @@ public:
l_targets.push_back(l_TargetInfo);

presentByAssoc(l_targets, l_targToDeconfig);

// DMI only
l_ep[2].addLast(TYPE_MC, 0);
l_ep[2].addLast(TYPE_MI, 0);
Expand Down Expand Up @@ -4980,7 +5004,7 @@ public:

// Add MC Group 0
//l_targets[0].pThisTarget = NULL;
l_targets[0].affinityPath.addLast(TYPE_MC, 0);
l_targets[0].affinityPath.addLast(TYPE_MC, 0);
l_ep[0] = l_targets[0].affinityPath; // SHOULD GET DECONFIGURED
l_targets[0].type = TYPE_MC;

Expand Down Expand Up @@ -5020,7 +5044,7 @@ public:
l_targets[4].affinityPath.addLast(TYPE_MI, 0);
l_ep[4] = l_targets[4].affinityPath;
l_targets[4].type = TYPE_MI;

// Add DMI Group 1
//l_targets[5].pThisTarget = NULL;
l_targets[5].affinityPath.addLast(TYPE_MC,1);
Expand Down Expand Up @@ -5154,7 +5178,7 @@ public:
l_targets[7].affinityPath.addLast(TYPE_MC, 0);
l_ep[7] = l_targets[7].affinityPath;
l_targets[7].type = TYPE_MC;

// Add MI
l_targets[8].pThisTarget = NULL;
l_targets[8].affinityPath.addLast(TYPE_MC, 0);
Expand Down Expand Up @@ -5214,14 +5238,14 @@ public:
l_targets[0].affinityPath.addLast(TYPE_MC, 0);
l_ep[0] = l_targets[0].affinityPath; // SHOULD BE DECONFIGURED
l_targets[0].type = TYPE_MC;

// Add MI Group 0
l_targets[1].pThisTarget = NULL;
l_targets[1].affinityPath.addLast(TYPE_MC, 0);
l_targets[1].affinityPath.addLast(TYPE_MI, 0);
l_ep[1] = l_targets[1].affinityPath; // SHOULD BE DECONFIGURED
l_targets[1].type = TYPE_MI;

// Add DMI Group 0
l_targets[2].pThisTarget = NULL;
l_targets[2].affinityPath.addLast(TYPE_MC, 0);
Expand Down Expand Up @@ -5472,7 +5496,7 @@ public:
l_targets[5].affinityPath.addLast(TYPE_MI, 0);
l_ep[5] = l_targets[5].affinityPath;
l_targets[5].type = TYPE_MI;

// Add MC Group 0
l_targets[6].pThisTarget = NULL;
l_targets[6].affinityPath.addLast(TYPE_MC, 0);
Expand Down Expand Up @@ -5630,7 +5654,7 @@ public:
l_targets[11].affinityPath.addLast(TYPE_MI, 0);
l_ep[11] = l_targets[11].affinityPath;
l_targets[11].type = TYPE_MI; // SHOULD BE DECONFIGURED

// Add MI 1
l_targets[12].pThisTarget = NULL;
l_targets[12].affinityPath.addLast(TYPE_MC, 0);
Expand Down
52 changes: 43 additions & 9 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5091,18 +5091,52 @@

<attribute>
<description>
Do not allow deconfiguration of this target to rollup to its parent
0x00 (false) = Allow parent deconfiguration rollup (default setting)
0x01 (true) = Do not allow parent deconfiguration rollup
Rules on how to handle a deconfigure to parent level
</description>
<id>PARENT_DECONFIG_DISABLED</id>
<id>PARENT_DECONFIG_RULES</id>
<persistency>non-volatile</persistency>
<readable/>
<simpleType>
<uint8_t>
<default>0x0</default>
</uint8_t>
</simpleType>
<complexType>
<description>Structure which defines a target's deconfigure rules.
Structure is read-only.
</description>
<field>
<bits>1</bits>
<default>0</default>
<description>Are the rule bits set correctly?
</description>
<name>valid</name>
<type>uint8_t</type>
</field>
<field>
<bits>1</bits>
<default>0</default>
<description>
0b0: Target should NOT be deconfigured by child rollup
0b1: Target allowed to be deconfigured by child rollup
</description>
<name>childRollupAllowed</name>
<type>uint8_t</type>
</field>
<field>
<bits>1</bits>
<default>0</default>
<description>
0b0: Target should NOT rollup its deconfigure to its parent
0b1: Target should deconfigure its parent if no more functioning
children of same type exist for its parent
</description>
<name>deconfigureParent</name>
<type>uint8_t</type>
</field>
<field>
<bits>5</bits>
<default>0</default>
<description>Reserved for future use</description>
<name>reserved</name>
<type>uint8_t</type>
</field>
</complexType>
<no_export/>
</attribute>

Expand Down
4 changes: 2 additions & 2 deletions src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5383,7 +5383,7 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
<default>physical:sys-0/node-0/proc-0/nx-0</default>
<default>affinity:sys-0/node-0/proc-0/nx-0</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
Expand Down Expand Up @@ -5736,7 +5736,7 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
<default>physical:sys-0/node-0/proc-1/nx-0</default>
<default>affinity:sys-0/node-0/proc-1/nx-0</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
Expand Down

0 comments on commit 8293d83

Please sign in to comment.