diff options
author | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-12-15 13:49:39 -0500 |
---|---|---|
committer | spashabk-in <shakeebbk@in.ibm.com> | 2016-12-20 05:18:56 -0600 |
commit | 3b3ebd1701ff73de280498858c97812db9153928 (patch) | |
tree | 70bce1b89f150498bfc6e3d20c4f69659f4e1600 /src/import/chips/p9/xip | |
parent | 1a3a8543f8c589f8f1ecb633798096e1d21417b0 (diff) | |
download | talos-sbe-3b3ebd1701ff73de280498858c97812db9153928.tar.gz talos-sbe-3b3ebd1701ff73de280498858c97812db9153928.zip |
Reverting RS4v3 changes
Revert "TOR reduction: Ditching DeltaRingLayout and RingLayout_t"
This reverts commit 0ea8cddae37eb5186571e6c66469dad694de9c5a.
Revert "Shrinking RS4 header"
This reverts commit c1a7c86e800e8bb38f6549b443bb4801feb4f1e3.
Change-Id: I7832e23491ea34f86db3cbdc5d25c98e3a9f1821
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33985
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33990
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips/p9/xip')
-rw-r--r-- | src/import/chips/p9/xip/p9_xip_tool.C | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/import/chips/p9/xip/p9_xip_tool.C b/src/import/chips/p9/xip/p9_xip_tool.C index 680735d0..50200153 100644 --- a/src/import/chips/p9/xip/p9_xip_tool.C +++ b/src/import/chips/p9/xip/p9_xip_tool.C @@ -50,7 +50,6 @@ using namespace P9_TOR; #endif - #define LINE_SIZE_MAX 1024 // Max size of a single snprintf dump. #define RING_BUF_SIZE_MAX 1000000 @@ -1753,6 +1752,9 @@ int dissectRingSectionTor( void* i_ringSection, void* ringBlockPtr; uint32_t ringBlockSize; char ringName[32]; + void* hostRs4Container; + uint32_t compressedBits = 0, ringLength = 0; + double compressionPct = 0; uint32_t ringSeqNo = 0; // Ring sequence number // @@ -1863,15 +1865,13 @@ int dissectRingSectionTor( void* i_ringSection, // if (rc == TOR_RING_FOUND) { - uint32_t l_ringSize = htobe16(((CompressedScanData*)ringBlockPtr)->iv_size); // Check ring block size. - if ( l_ringSize != ringBlockSize || l_ringSize == 0 ) + if ( htobe32(((RingLayout_t*)ringBlockPtr)->sizeOfThis) != ringBlockSize ) { fprintf(stderr, "tor_access_ring() was successful and found a ring but " - "RS4 header's iv_size(=0x%08x) is either zero or doesn't match " - "size of ring buffer (ringBlockSize=0x%08x).\n", - l_ringSize, ringBlockSize); + "sizeOfThis(=0x%08x) != ringBlockSize(=0x%08x) is a bug.\n", + htobe32(((RingLayout_t*)ringBlockPtr)->sizeOfThis), ringBlockSize); exit(1); } @@ -1910,6 +1910,12 @@ int dissectRingSectionTor( void* i_ringSection, // Summarize all characteristics of the ring block if "normal" or "long" (default). if ( i_listingModeId == LMID_NORMAL || i_listingModeId == LMID_LONG ) { + // Calculate RS4 compression efficiency. + hostRs4Container = (void*)( (uintptr_t)ringBlockPtr + sizeof(RingLayout_t) ); + compressedBits = htobe32(((CompressedScanData*)hostRs4Container)->iv_algorithmReserved) * 4; + ringLength = htobe32(((CompressedScanData*)hostRs4Container)->iv_length); + compressionPct = (double)compressedBits / (double)ringLength * 100.0; + sizeDisLine = snprintf( lineDis, LINE_SIZE_MAX, "-----------------------------\n" "%i.\n" @@ -1919,10 +1925,13 @@ int dissectRingSectionTor( void* i_ringSection, "ringName = %s\n" "ringVariant = %s\n" "instanceId = 0x%02x\n" - "ringBlockSize = 0x%08x\n", + "ringBlockSize = 0x%08x\n" + "RS4 ring size [bits] = %u\n" + "Raw ring size [bits] = %u\n" + "Compression [%%] = %0.2f\n", ringSeqNo, ddLevel, ppeTypeName[ppeType], ringId, ringName, ringVariantName[ringVariant], instanceId, - ringBlockSize); + ringBlockSize, compressedBits, ringLength, compressionPct ); if (sizeDisLine >= LINE_SIZE_MAX) { |