Skip to content

Commit

Permalink
Fix yet an other error and remove a redundant variable
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Nov 13, 2020
1 parent 751ff99 commit dd13ec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
20 changes: 4 additions & 16 deletions cfgmgr/buffermgrdyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,25 +343,15 @@ void BufferMgrDynamic::recalculateSharedBufferPool()

auto &poolSizeStr = pairs[1];
unsigned long poolSizeNum = atol(poolSizeStr.c_str());
if (m_mmuSizeNumber > 0 && m_mmuSizeNumber >= poolSizeNum)
{
pool.total_size = poolSizeStr;
}
else
if (m_mmuSizeNumber > 0 && m_mmuSizeNumber < poolSizeNum)
{
SWSS_LOG_ERROR("Buffer pool %s: Invalid size %s, exceeding the mmu size %s",
poolName.c_str(), poolSizeStr.c_str(), m_mmuSize.c_str());
continue;
}

if (pool.initialized)
{
updateBufferPoolToDb(poolName, pool);
}
else
{
updateBufferPoolToDb(poolName, pool);
pool.initialized = true;
}
pool.total_size = poolSizeStr;
updateBufferPoolToDb(poolName, pool);

SWSS_LOG_NOTICE("Buffer pool %s had been updated with new size [%s]", poolName.c_str(), pool.total_size.c_str());
}
Expand Down Expand Up @@ -1170,7 +1160,6 @@ task_process_status BufferMgrDynamic::handleBufferPoolTable(Consumer &consumer)
// 2. Record the table in the internal cache m_bufferPoolLookup
buffer_pool_t &bufferPool = m_bufferPoolLookup[pool];

bufferPool.initialized = false;
bufferPool.dynamic_size = true;
for (auto i = kfvFieldsValues(tuple).begin(); i != kfvFieldsValues(tuple).end(); i++)
{
Expand Down Expand Up @@ -1199,7 +1188,6 @@ task_process_status BufferMgrDynamic::handleBufferPoolTable(Consumer &consumer)
}
if (!bufferPool.dynamic_size)
{
bufferPool.initialized = true;
m_applBufferPoolTable.set(pool, fvVector);
m_stateBufferPoolTable.set(pool, fvVector);
}
Expand Down
1 change: 0 additions & 1 deletion cfgmgr/buffermgrdyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace swss {
typedef struct {
bool ingress;
bool dynamic_size;
bool initialized;
std::string total_size;
std::string mode;
std::string xoff;
Expand Down

0 comments on commit dd13ec8

Please sign in to comment.