Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
- Handle table name change
- Remove BufferOrch's constructor which isnt used

Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Sep 11, 2020
1 parent 6c60a7d commit 15b8235
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cfgmgr/buffer_pool_mellanox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ local statistics = {}
-- Fetch sizes of all of the profiles, accumulate them
local accumulative_occupied_buffer = 0
for i = 1, #profiles, 1 do
if profiles[i][1] ~= "BUFFER_PROFILE_KEY_SET" and profiles[i][1] ~= "BUFFER_PROFILE_DEL_SET" then
if profiles[i][1] ~= "BUFFER_PROFILE_TABLE_KEY_SET" and profiles[i][1] ~= "BUFFER_PROFILE_TABLE_DEL_SET" then
local size = tonumber(redis.call('HGET', profiles[i][1], 'size'))
if size ~= nil then
if profiles[i][1] == "BUFFER_PROFILE_TABLE:ingress_lossy_profile" then
Expand Down
3 changes: 2 additions & 1 deletion cfgmgr/buffermgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ void BufferMgr::transformReference(string &name)
* One thing we need to handle is to transform the separator from | to :
* The following items contain separator:
* - keys of each item
* - pool in BUFFER_POOL
* - pool in BUFFER_PROFILE
* - profile in BUFFER_PG
* - profile_list in BUFFER_PORT_INGRESS_PROFILE_LIST and BUFFER_PORT_EGRESS_PROFILE_LIST
*/
void BufferMgr::doBufferTableTask(Consumer &consumer, ProducerStateTable &applTable)
{
Expand Down
18 changes: 1 addition & 17 deletions orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@ BufferOrch::BufferOrch(DBConnector *applDb, DBConnector *confDb, DBConnector *st
initBufferConstants();
};

BufferOrch::BufferOrch(DBConnector *applDb, DBConnector *confDb, DBConnector *stateDb, vector<TableConnector> &tableConnectors) :
Orch(tableConnectors),
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
m_flexCounterTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_TABLE)),
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE)),
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
m_countersDbRedisClient(m_countersDb.get()),
m_stateBufferMaximumValueTable(stateDb, STATE_BUFFER_MAXIMUM_VALUE_TABLE)
{
SWSS_LOG_ENTER();
initTableHandlers();
initBufferReadyLists(confDb);
initFlexCounterGroupTable();
initBufferConstants();
};

void BufferOrch::initTableHandlers()
{
SWSS_LOG_ENTER();
Expand Down Expand Up @@ -132,7 +116,7 @@ void BufferOrch::initBufferConstants()
status = sai_switch_api->get_switch_attribute(gSwitchId, 1, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to get Maxiuum memory size, rv:%d", status);
SWSS_LOG_ERROR("Failed to get Maximum memory size, rv:%d", status);
// This is not a mandatory attribute so in case of failure we just return
return;
}
Expand Down
1 change: 0 additions & 1 deletion orchagent/bufferorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class BufferOrch : public Orch
{
public:
BufferOrch(DBConnector *applDb, DBConnector *confDb, DBConnector *stateDb, vector<string> &tableNames);
BufferOrch(DBConnector *applDb, DBConnector *confDb, DBConnector *stateDb, vector<TableConnector> &tableConnectors);
bool isPortReady(const std::string& port_name) const;
static type_map m_buffer_type_maps;
void generateBufferPoolWatermarkCounterIdList(void);
Expand Down

0 comments on commit 15b8235

Please sign in to comment.