From e1d29fc77510a36e64d57800177e0d1cabd1ddcf Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Fri, 22 Jun 2018 05:14:15 -0500 Subject: Workaround for vector pool issue Change-Id: I2a158ecbd6125a46341456ec5699c9c87d242a14 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61167 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta (cherry picked from commit 82b4709602c4265d780518394ffed58ba74ccaa8) Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61168 --- src/sbefw/core/pool.C | 12 +++++++++--- src/sbefw/core/pool.H | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/sbefw/core/pool.C b/src/sbefw/core/pool.C index 93c67bb4..c79dafa8 100644 --- a/src/sbefw/core/pool.C +++ b/src/sbefw/core/pool.C @@ -5,7 +5,8 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -35,7 +36,8 @@ vectorMemPool_t g_pool[G_POOLSIZE]; vectorMemPool_t * allocMem() { vectorMemPool_t *pool = NULL; - for( size_t idx = 0; idx < G_POOLSIZE; idx++ ) + size_t idx; + for( idx = 0; idx < G_POOLSIZE; idx++ ) { if( 0 == g_pool[idx].refCount ) { @@ -44,7 +46,11 @@ vectorMemPool_t * allocMem() break; } } - SBE_DEBUG(" Giving pool 0x%08X", pool); + if(NULL == pool ) + { + SBE_ERROR("NULL pool idx:%u", idx); + pk_halt(); + } return pool; } diff --git a/src/sbefw/core/pool.H b/src/sbefw/core/pool.H index 325a5aa6..040729ff 100644 --- a/src/sbefw/core/pool.H +++ b/src/sbefw/core/pool.H @@ -5,7 +5,8 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -29,10 +30,10 @@ namespace SBEVECTORPOOL { // Size of a block for a vector -static const size_t G_BLOCKSIZE = 512; +static const size_t G_BLOCKSIZE = 256; //Pool size -static const size_t G_POOLSIZE = 4; +static const size_t G_POOLSIZE = 6; typedef struct { -- cgit v1.2.1