Skip to content

Commit

Permalink
[vrfmgrd]: UPdate State DB (sonic-net#627)
Browse files Browse the repository at this point in the history
Signed-off-by: Marian Pritsak <[email protected]>
  • Loading branch information
marian-pritsak authored and lguohan committed Sep 24, 2018
1 parent b05beb3 commit 5166b0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cfgmgr/vrfmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
using namespace swss;

VrfMgr::VrfMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames) :
Orch(cfgDb, tableNames)
Orch(cfgDb, tableNames),
m_stateVrfTable(stateDb, STATE_VRF_TABLE_NAME)
{
for (uint32_t i = VRF_TABLE_START; i < VRF_TABLE_END; i++)
{
Expand Down Expand Up @@ -154,6 +155,10 @@ void VrfMgr::doTask(Consumer &consumer)
SWSS_LOG_ERROR("Failed to create vrf netdev %s", vrfName.c_str());
}

vector<FieldValueTuple> fvVector;
fvVector.emplace_back("state", "ok");
m_stateVrfTable.set(vrfName, fvVector);

SWSS_LOG_NOTICE("Created vrf netdev %s", vrfName.c_str());
}
else if (op == DEL_COMMAND)
Expand All @@ -163,6 +168,8 @@ void VrfMgr::doTask(Consumer &consumer)
SWSS_LOG_ERROR("Failed to remove vrf netdev %s", vrfName.c_str());
}

m_stateVrfTable.del(vrfName);

SWSS_LOG_NOTICE("Removed vrf netdev %s", vrfName.c_str());
}
else
Expand Down
2 changes: 2 additions & 0 deletions cfgmgr/vrfmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class VrfMgr : public Orch

map<string, uint32_t> m_vrfTableMap;
set<uint32_t> m_freeTables;

Table m_stateVrfTable;
};

}
Expand Down

0 comments on commit 5166b0e

Please sign in to comment.