summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/mdia/mdiasm.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/diag/mdia/mdiasm.C')
-rw-r--r--src/usr/diag/mdia/mdiasm.C32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C
index 126ce9338..e201d83e3 100644
--- a/src/usr/diag/mdia/mdiasm.C
+++ b/src/usr/diag/mdia/mdiasm.C
@@ -188,7 +188,6 @@ errlHndl_t StateMachine::run(const WorkFlowAssocMap & i_list)
if((*wit)->log)
{
errlCommit((*wit)->log, MDIA_COMP_ID);
- // TODO (component, actions, etc)
}
}
@@ -203,6 +202,8 @@ void StateMachine::setup(const WorkFlowAssocMap & i_list)
reset();
+ AttributeTraits<TARGETING::ATTR_EFF_DIMM_SIZE>::Type effDimmSizeAttr;
+
mutex_lock(&iv_mutex);
WorkFlowProperties * p = 0;
@@ -222,7 +223,27 @@ void StateMachine::setup(const WorkFlowAssocMap & i_list)
p->log = 0;
p->timer = 0;
p->restartCommand = false;
- p->memSize = 0; // TODO
+ p->memSize = 0;
+
+ // get the memsize attached to this mba
+
+ if(it->first->tryGetAttr<TARGETING::ATTR_EFF_DIMM_SIZE>(
+ effDimmSizeAttr))
+ {
+ for(uint64_t port = 0;
+ port < sizeof(effDimmSizeAttr)/sizeof(*effDimmSizeAttr);
+ ++port)
+ {
+ for(uint64_t dimm = 0;
+ dimm <
+ sizeof(effDimmSizeAttr[0])/sizeof(*effDimmSizeAttr[0]);
+ ++dimm)
+ {
+ p->memSize += effDimmSizeAttr[port][dimm];
+ }
+ }
+ }
+
p->data = NULL;
p->chipUnit = it->first->getAttr<ATTR_CHIP_UNIT>();
@@ -322,8 +343,11 @@ bool StateMachine::scheduleWorkItem(WorkFlowProperties & i_wfp)
// the priority is the number of iterations
// through the memory multiplied by the memory size
- // TODO - multiply by memory size
- uint64_t priority = getRemainingWorkItems(i_wfp);
+ // multiply by memory size
+ // assume 1 GB DIMMS if figuring out the memory
+ // size failed
+ uint64_t priority = getRemainingWorkItems(i_wfp)
+ * (i_wfp.memSize ? i_wfp.memSize : 1);
if(!iv_tp)
{
OpenPOWER on IntegriCloud