Skip to content

Commit

Permalink
Fix p9_mss_eff_grouping for 2 ports/group
Browse files Browse the repository at this point in the history
Group 2 ports on same MCS first before attempt on 2 ports
of different MCS.

Change-Id: I6cec06616eebca91282e6f48eba8b4086f295799
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35623
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com>
Dev-Ready: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: CHRISTINA L. GRAVES <clgraves@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35624
Reviewed-by: Hostboot Team <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>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
ibmthi authored and dcrowell77 committed Feb 1, 2017
1 parent cedbd4f commit 4ae1304
Showing 1 changed file with 45 additions and 14 deletions.
59 changes: 45 additions & 14 deletions src/import/chips/p9/procedures/hwp/nest/p9_mss_eff_grouping.C
Expand Up @@ -1823,13 +1823,49 @@ void grouping_group2PortsPerGroup(const EffGroupingMemInfo& i_memInfo,
EffGroupingData& o_groupData)
{
FAPI_DBG("Entering");

// Any two ports with the same amount of memory can be grouped together
FAPI_INF("grouping_group2PortsPerGroup: Attempting to group 2 MC ports");
uint8_t& g = o_groupData.iv_numGroups;
const uint8_t PORTS_PER_GROUP = 2;

for (uint8_t pos = 0; pos < NUM_MC_PORTS_PER_PROC; pos++)
// First, try to group 2 ports that are in the same MCS (highest priority)
for (uint8_t pos = 0; pos < NUM_MC_PORTS_PER_PROC; pos += 2)
{
FAPI_DBG("Trying to group 2 ports of the same MCS.. ports %u %u", pos, pos + 1);

// Skip if port is already grouped or has no memory
if ( (o_groupData.iv_portGrouped[pos]) ||
(i_memInfo.iv_portSize[pos] == 0) )
{
FAPI_DBG("Port %u already grouped or has no memory, skip", pos);
continue;
}

if ( (o_groupData.iv_portGrouped[pos + 1]) ||
(i_memInfo.iv_portSize[pos + 1] != i_memInfo.iv_portSize[pos]) )
{
FAPI_DBG("Port %u already grouped or memory not matched with port %u, skip", pos + 1, pos);
continue;
}

// Successfully find 2 ports to group
o_groupData.iv_data[g][PORT_SIZE] = i_memInfo.iv_portSize[pos];
o_groupData.iv_data[g][PORTS_IN_GROUP] = PORTS_PER_GROUP;
o_groupData.iv_data[g][GROUP_SIZE] =
PORTS_PER_GROUP * i_memInfo.iv_portSize[pos];
o_groupData.iv_data[g][MEMBER_IDX(0)] = pos;
o_groupData.iv_data[g][MEMBER_IDX(1)] = pos + 1;
g++;

// Record which MC ports were grouped
o_groupData.iv_portGrouped[pos] = true;
o_groupData.iv_portGrouped[pos + 1] = true;

FAPI_INF("grouping_group2PortsPerGroup: Successfully grouped 2 (same MCS) "
"MC ports: %u, %u", pos, pos + 1);
}

// Group the remaining 2 ports of different MCS
for (uint8_t pos = 0; pos < (NUM_MC_PORTS_PER_PROC - 1); pos++)
{
FAPI_DBG("Trying to group port %u with another port..", pos);

Expand Down Expand Up @@ -1866,18 +1902,13 @@ void grouping_group2PortsPerGroup(const EffGroupingMemInfo& i_memInfo,
continue;
}

// Check if 'pos' and 'ii' are on different MCS
if ( (pos / 2) != (ii / 2) )
// These 2 ports are on different MCS, can't group if they are odd
// ports and their even port is not empty
if ( ((pos % 2) && (i_memInfo.iv_portSize[pos - 1] != 0)) ||
((ii % 2) && (i_memInfo.iv_portSize[ii - 1] != 0)) )
{
// Ports 'pos' and 'ii' are on different MCS.
// Can't not group if they are odd ports and their even port
// is not empty
if ( ((pos % 2) && (i_memInfo.iv_portSize[pos - 1] != 0)) ||
((ii % 2) && (i_memInfo.iv_portSize[ii - 1] != 0)) )
{
FAPI_DBG("Crossed MCS, can't group port %u and %u because even port is not empty", pos, ii);
continue;
}
FAPI_DBG("Crossed MCS, can't group port %u and %u because even port is not empty", pos, ii);
continue;
}

// Successfully find 2 ports to group
Expand Down

0 comments on commit 4ae1304

Please sign in to comment.