Skip to content

Commit

Permalink
eRepair: Fix to invalidate vpd records correctly
Browse files Browse the repository at this point in the history
- During fabric restore in ipl any stale reocrds found in vpd that
  doesn't exist on both end of bus should be invalidated.

Change-Id: Id74c857daa6e7d3cb3180db71ae522d30748b812
CQ:SW443246
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65154
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65350
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65355
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
sumitk56 authored and crgeddes committed Aug 29, 2018
1 parent 64499fa commit f4aa6c6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ void invalidateNonMatchingFailLanes(std::vector<uint8_t>& io_endp1_txFaillanes,
std::vector<uint8_t>::iterator l_itDrv;
std::vector<uint8_t>::iterator l_itRcv;

FAPI_INF("invalidateNonMatchingFailLanes - endp1Tx size:%llu endp2Rx size:%llu",
io_endp1_txFaillanes.size(), io_endp2_rxFaillanes.size());

for(unsigned long i = 0; (i < io_endp1_txFaillanes.size() && io_endp1_txFaillanes.size() != 0); i++)
{
FAPI_INF("Endp1Tx(%lu):%llu ", i, io_endp1_txFaillanes[i]);
}

for(unsigned long i = 0; (i < io_endp2_rxFaillanes.size() && io_endp2_rxFaillanes.size() != 0); i++)
{
FAPI_INF("Endp2Rx(%lu):%llu ", i, io_endp2_rxFaillanes[i]);
}

o_invalidFails_inTx_Ofendp1 = false;
o_invalidFails_inRx_Ofendp2 = false;

Expand Down Expand Up @@ -149,6 +162,9 @@ void combineFieldandMnfgLanes(std::vector<uint8_t>& i_mnfgFaillanes,
{
std::vector<uint8_t>::iterator l_it;

FAPI_INF("combineFieldandMnfgLanes - mnfgFailLanes size:%llu fieldFailLanes size:%llu",
i_mnfgFaillanes.size(), i_fieldFaillanes.size());

// Merge the Field and Mnfg fail lanes
l_it = o_allFaillanes.begin();
o_allFaillanes.insert(l_it,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ fapi2::ReturnCode erepairGetRestoreLanes(
fapi2::TargetType l_endp1_tgtType = fapi2::TARGET_TYPE_NONE;
fapi2::TargetType l_endp2_tgtType = fapi2::TARGET_TYPE_NONE;

FAPI_DBG(">>erepairGetRestoreLanes");
FAPI_INF(">>erepairGetRestoreLanes - ClkGrp:%d", i_clkGroup);

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_MNFG_FLAGS,
fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
Expand Down Expand Up @@ -1206,6 +1206,37 @@ fapi2::ReturnCode erepairGetRestoreLanes(
} // end of else block of "if(l_mnfgModeIPL)"


/***** Remove invalid lane numbers *****/

// Check if there are invalid lanes in Tx side of endp1.
// If found, erase them from the vector
o_endp1_txFaillanes.erase(std::remove(o_endp1_txFaillanes.begin(),
o_endp1_txFaillanes.end(),
EREPAIR::INVALID_FAIL_LANE_NUMBER),
o_endp1_txFaillanes.end());

// Check if there are invalid lanes in Rx side of endp1.
// If found, erase them from the vector
o_endp1_rxFaillanes.erase(std::remove(o_endp1_rxFaillanes.begin(),
o_endp1_rxFaillanes.end(),
EREPAIR::INVALID_FAIL_LANE_NUMBER),
o_endp1_rxFaillanes.end());

// Check if there are invalid lanes in Tx side of endp2.
// If found, erase them from the vector
o_endp2_txFaillanes.erase(std::remove(o_endp2_txFaillanes.begin(),
o_endp2_txFaillanes.end(),
EREPAIR::INVALID_FAIL_LANE_NUMBER),
o_endp2_txFaillanes.end());

// Check if there are invalid lanes in Rx side of endp2.
// If found, erase them from the vector
o_endp2_rxFaillanes.erase(std::remove(o_endp2_rxFaillanes.begin(),
o_endp2_rxFaillanes.end(),
EREPAIR::INVALID_FAIL_LANE_NUMBER),
o_endp2_rxFaillanes.end());


/***** Check for threshold exceed conditions *****/

// Get the eRepair threshold limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

namespace EREPAIR
{
const uint8_t INVALID_FAIL_LANE_NUMBER = 0;
const uint8_t INVALID_FAIL_LANE_NUMBER = 0xFF;

// X-Bus is 16+1 lanes wide in 2 byte mode
// Data lanes numbering: 0 - 15 in 2 byte mode
Expand Down

0 comments on commit f4aa6c6

Please sign in to comment.