summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@us.ibm.com>2013-04-12 10:19:28 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-22 17:22:34 -0500
commit6340a95a7e95dc55fc947ecaaabb9b60b88a2915 (patch)
tree54c72ff3b9e3ce7f0541cf14ca188763f4fdec60 /src
parent3e99599f66ac6e9037a1e7de66a15096bbc477b8 (diff)
downloadtalos-hostboot-6340a95a7e95dc55fc947ecaaabb9b60b88a2915.tar.gz
talos-hostboot-6340a95a7e95dc55fc947ecaaabb9b60b88a2915.zip
MDIA: Avoid starting commands on same Centaur
RTC: 38370 Change-Id: I55fb7d9046e54fbcc31dab595bc597724a9a09d4 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4050 Tested-by: Jenkins Server Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/diag/mdia/mdiasm.C8
-rw-r--r--src/usr/diag/mdia/mdiasmimpl.H5
-rw-r--r--src/usr/diag/mdia/mdiaworkitem.C60
-rw-r--r--src/usr/diag/mdia/mdiaworkitem.H57
-rw-r--r--src/usr/diag/mdia/test/mdiatestsm.H12
-rw-r--r--src/usr/diag/mdia/test/mdiatestworkitem.H102
6 files changed, 165 insertions, 79 deletions
diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C
index 138887cea..e664b8b63 100644
--- a/src/usr/diag/mdia/mdiasm.C
+++ b/src/usr/diag/mdia/mdiasm.C
@@ -224,6 +224,7 @@ void StateMachine::setup(const WorkFlowAssocMap & i_list)
p->restartCommand = false;
p->memSize = 0; // TODO
p->data = NULL;
+ p->chipUnit = it->first->getAttr<ATTR_CHIP_UNIT>();
iv_workFlowProperties.push_back(p);
}
@@ -331,10 +332,11 @@ bool StateMachine::scheduleWorkItem(WorkFlowProperties & i_wfp)
iv_tp->start();
}
- MDIA_FAST("sm: dispatching work item %d for: %p, priority: %d",
- *i_wfp.workItem, getTarget(i_wfp), priority);
+ MDIA_FAST("sm: dispatching work item %d for: %p, priority: %d, "
+ "unit: %d", *i_wfp.workItem, getTarget(i_wfp), priority,
+ i_wfp.chipUnit);
- iv_tp->insert(new WorkItem(*this, &i_wfp, priority));
+ iv_tp->insert(new WorkItem(*this, &i_wfp, priority, i_wfp.chipUnit));
return true;
}
diff --git a/src/usr/diag/mdia/mdiasmimpl.H b/src/usr/diag/mdia/mdiasmimpl.H
index 5ebd672c6..d91c14d58 100644
--- a/src/usr/diag/mdia/mdiasmimpl.H
+++ b/src/usr/diag/mdia/mdiasmimpl.H
@@ -81,6 +81,11 @@ struct WorkFlowProperties
* @brief pointer to single work item scoped data
*/
void * data;
+
+ /**
+ * @brief mba position on membuf (0/1)
+ */
+ uint8_t chipUnit;
};
/**
diff --git a/src/usr/diag/mdia/mdiaworkitem.C b/src/usr/diag/mdia/mdiaworkitem.C
index 2f6f8207e..410d322f1 100644
--- a/src/usr/diag/mdia/mdiaworkitem.C
+++ b/src/usr/diag/mdia/mdiaworkitem.C
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/diag/mdia/mdiaworkitem.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/mdia/mdiaworkitem.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file mdiaworkitem.C
* @brief threadpool workitem implementation
@@ -55,17 +55,27 @@ int64_t WorkItem::compare(const WorkItem & i_r) const
// if the state machine computed priority is the same,
// give higher priority to mbas on different dmi busses
- // TODO
+ if(iv_chipUnit < i_r.iv_chipUnit)
+ {
+ return -1;
+ }
+
+ if(i_r.iv_chipUnit < iv_chipUnit)
+ {
+ return 1;
+ }
return 0;
}
WorkItem::WorkItem(StateMachine & i_sm,
WorkFlowProperties * i_wfp,
- uint64_t i_priority) :
+ uint64_t i_priority,
+ uint8_t i_chipUnit) :
iv_sm(i_sm),
iv_wfp(i_wfp),
- iv_priority(i_priority)
+ iv_priority(i_priority),
+ iv_chipUnit(i_chipUnit)
{
}
diff --git a/src/usr/diag/mdia/mdiaworkitem.H b/src/usr/diag/mdia/mdiaworkitem.H
index a2f86ae6e..04200e01b 100644
--- a/src/usr/diag/mdia/mdiaworkitem.H
+++ b/src/usr/diag/mdia/mdiaworkitem.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/diag/mdia/mdiaworkitem.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/mdia/mdiaworkitem.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __MDIA_MDIAWORKITEM_H
#define __MDIA_MDIAWORKITEM_H
@@ -65,9 +65,10 @@ class WorkItem
* @param[in] i_sm state machine to forward call to
* @param[in] i_wfp state machine state snapshot
* @param[in] i_priority work item priority
+ * @param[in] i_chipUnit mba position (0/1)
*/
WorkItem(StateMachine & i_sm, WorkFlowProperties * i_wfp,
- uint64_t i_priority);
+ uint64_t i_priority, uint8_t i_chipUnit);
private:
@@ -87,6 +88,11 @@ class WorkItem
uint64_t iv_priority;
/**
+ * @brief the mba number on the membuf (0/1)
+ */
+ uint8_t iv_chipUnit;
+
+ /**
* @brief copy disabled
*/
WorkItem(const WorkItem &);
@@ -95,6 +101,11 @@ class WorkItem
* @brief assignment disabled
*/
WorkItem & operator=(const WorkItem &);
+
+ /**
+ * @brief provide internal access to unit test
+ */
+ friend class ::MdiaWorkItemTest;
};
/**
diff --git a/src/usr/diag/mdia/test/mdiatestsm.H b/src/usr/diag/mdia/test/mdiatestsm.H
index f7fe5bf1a..11e675029 100644
--- a/src/usr/diag/mdia/test/mdiatestsm.H
+++ b/src/usr/diag/mdia/test/mdiatestsm.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012 */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
/* */
/* p1 */
/* */
@@ -33,6 +33,7 @@
#include "../mdiasm.H"
#include "../mdiasmimpl.H"
#include <diag/mdia/mdiamevent.H>
+#include <targeting/common/utilFilter.H>
#include "../mdiatrace.H"
#include "../mdiamonitor.H"
#include "../mdiafwd.H"
@@ -48,11 +49,14 @@ class MdiaSmTest : public CxxTest::TestSuite
void getTargets(uint64_t i_count, TARGETING::TargetHandleList & o_list)
{
- TARGETING::TargetHandle_t first = 0;
+ TargetHandleList tmp;
+ TARGETING::getAllChiplets(tmp, TYPE_MBA);
- while(i_count-- != 0)
+ TargetHandleList::iterator it = tmp.end();
+
+ while(i_count-- != 0 && it-- != tmp.begin())
{
- o_list.push_back(first + i_count);
+ o_list.push_back(*it);
}
}
diff --git a/src/usr/diag/mdia/test/mdiatestworkitem.H b/src/usr/diag/mdia/test/mdiatestworkitem.H
index 111cd23cc..91b4deed6 100644
--- a/src/usr/diag/mdia/test/mdiatestworkitem.H
+++ b/src/usr/diag/mdia/test/mdiatestworkitem.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/diag/mdia/test/mdiatestworkitem.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/mdia/test/mdiatestworkitem.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TEST_MDIATESTWORKITEM_H
#define __TEST_MDIATESTWORKITEM_H
@@ -47,8 +47,8 @@ class MdiaWorkItemTest : public CxxTest::TestSuite
StateMachine s;
WorkFlowProperties * notUsed = 0;
- WorkItem wi1(s, notUsed, 2222),
- wi2(s, notUsed, 1111);
+ WorkItem wi1(s, notUsed, 2222, 0),
+ wi2(s, notUsed, 1111, 0);
if(wi2 < wi1)
{
@@ -60,6 +60,60 @@ class MdiaWorkItemTest : public CxxTest::TestSuite
TS_FAIL("wi1 !< wi2");
}
+ wi1.iv_priority = 1111;
+ wi2.iv_priority = 1111;
+ wi1.iv_chipUnit = 0;
+ wi2.iv_chipUnit = 0;
+
+ if(wi2 < wi1)
+ {
+ TS_FAIL("wi2 < wi1");
+ }
+
+ if(wi1 < wi2)
+ {
+ TS_FAIL("wi1 < wi2");
+ }
+
+ wi1.iv_chipUnit = 1;
+ wi2.iv_chipUnit = 1;
+
+ if(wi2 < wi1)
+ {
+ TS_FAIL("wi2 < wi1");
+ }
+
+ if(wi1 < wi2)
+ {
+ TS_FAIL("wi1 < wi2");
+ }
+
+ wi1.iv_chipUnit = 0;
+
+ if(wi2 < wi1)
+ {
+ TS_FAIL("wi2 < wi1");
+ }
+
+ if(!(wi1 < wi2))
+ {
+ TS_FAIL("wi1 !< wi2");
+ }
+
+ wi1.iv_chipUnit = 1;
+ wi2.iv_chipUnit = 0;
+
+ if(!(wi2 < wi1))
+ {
+ TS_FAIL("wi2 !< wi1");
+ }
+
+ if(wi1 < wi2)
+ {
+ TS_FAIL("wi1 < wi2");
+ }
+
+
TS_TRACE(EXIT_MRK "testWorkItem");
}
};
OpenPOWER on IntegriCloud