Skip to content

Commit

Permalink
Merge branch 'master' into aggVoq
Browse files Browse the repository at this point in the history
  • Loading branch information
viveksrao-arista committed May 30, 2024
2 parents 8a9e3c6 + cc5a02c commit 789eafb
Show file tree
Hide file tree
Showing 17 changed files with 1,671 additions and 298 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
DIFF_COVER_ENABLE: 'true'
DIFF_COVER_COVERAGE_FILES: Cobertura.xml

pool: sonic-common-test
pool: sonictest

steps:
- script: |
Expand Down
29 changes: 28 additions & 1 deletion cfgmgr/tunnelmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static int cmdIpTunnelRouteDel(const std::string& pfx, std::string & res)
TunnelMgr::TunnelMgr(DBConnector *cfgDb, DBConnector *appDb, const std::vector<std::string> &tableNames) :
Orch(cfgDb, tableNames),
m_appIpInIpTunnelTable(appDb, APP_TUNNEL_DECAP_TABLE_NAME),
m_appIpInIpTunnelDecapTermTable(appDb, APP_TUNNEL_DECAP_TERM_TABLE_NAME),
m_cfgPeerTable(cfgDb, CFG_PEER_SWITCH_TABLE_NAME),
m_cfgTunnelTable(cfgDb, CFG_TUNNEL_TABLE_NAME)
{
Expand Down Expand Up @@ -223,6 +224,7 @@ bool TunnelMgr::doTunnelTask(const KeyOpFieldsValuesTuple & t)

const std::string & tunnelName = kfvKey(t);
const std::string & op = kfvOp(t);
std::string src_ip;
TunnelInfo tunInfo;

for (auto fieldValue : kfvFieldsValues(t))
Expand All @@ -237,6 +239,10 @@ bool TunnelMgr::doTunnelTask(const KeyOpFieldsValuesTuple & t)
{
tunInfo.type = value;
}
else if (field == "src_ip")
{
src_ip = value;
}
}

if (op == SET_COMMAND)
Expand All @@ -260,7 +266,27 @@ bool TunnelMgr::doTunnelTask(const KeyOpFieldsValuesTuple & t)
*/
if (m_tunnelReplay.find(tunnelName) == m_tunnelReplay.end())
{
m_appIpInIpTunnelTable.set(tunnelName, kfvFieldsValues(t));
/* Create the tunnel */
std::vector<FieldValueTuple> fvs;
std::copy_if(kfvFieldsValues(t).cbegin(), kfvFieldsValues(t).cend(),
std::back_inserter(fvs),
[](const FieldValueTuple & fv) {
return fvField(fv) != "dst_ip";
});
m_appIpInIpTunnelTable.set(tunnelName, fvs);

/* Create the decap term */
fvs.clear();
if (!src_ip.empty())
{
fvs.emplace_back("src_ip", src_ip);
fvs.emplace_back("term_type", "P2P");
}
else
{
fvs.emplace_back("term_type", "P2MP");
}
m_appIpInIpTunnelDecapTermTable.set(tunnelName + DEFAULT_KEY_SEPARATOR + tunInfo.dst_ip, fvs);
}
}
m_tunnelReplay.erase(tunnelName);
Expand All @@ -279,6 +305,7 @@ bool TunnelMgr::doTunnelTask(const KeyOpFieldsValuesTuple & t)
tunInfo = it->second;
if (tunInfo.type == IPINIP)
{
m_appIpInIpTunnelDecapTermTable.del(tunnelName + DEFAULT_KEY_SEPARATOR + tunInfo.dst_ip);
m_appIpInIpTunnelTable.del(tunnelName);
}
else
Expand Down
1 change: 1 addition & 0 deletions cfgmgr/tunnelmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TunnelMgr : public Orch
void finalizeWarmReboot();

ProducerStateTable m_appIpInIpTunnelTable;
ProducerStateTable m_appIpInIpTunnelDecapTermTable;
Table m_cfgPeerTable;
Table m_cfgTunnelTable;

Expand Down
13 changes: 10 additions & 3 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Srv6Orch *gSrv6Orch;
FlowCounterRouteOrch *gFlowCounterRouteOrch;
DebugCounterOrch *gDebugCounterOrch;
MonitorOrch *gMonitorOrch;
TunnelDecapOrch *gTunneldecapOrch;

bool gIsNatSupported = false;
event_handle_t g_events_handle;
Expand Down Expand Up @@ -224,7 +225,13 @@ bool OrchDaemon::init()
gCbfNhgOrch = new CbfNhgOrch(m_applDb, APP_CLASS_BASED_NEXT_HOP_GROUP_TABLE_NAME);

gCoppOrch = new CoppOrch(m_applDb, APP_COPP_TABLE_NAME);
TunnelDecapOrch *tunnel_decap_orch = new TunnelDecapOrch(m_applDb, APP_TUNNEL_DECAP_TABLE_NAME);

vector<string> tunnel_tables = {
APP_TUNNEL_DECAP_TABLE_NAME,
APP_TUNNEL_DECAP_TERM_TABLE_NAME
};
gTunneldecapOrch = new TunnelDecapOrch(m_applDb, m_stateDb, m_configDb, tunnel_tables);
gDirectory.set(gTunneldecapOrch);

VxlanTunnelOrch *vxlan_tunnel_orch = new VxlanTunnelOrch(m_stateDb, m_applDb, APP_VXLAN_TUNNEL_TABLE_NAME);
gDirectory.set(vxlan_tunnel_orch);
Expand Down Expand Up @@ -380,7 +387,7 @@ bool OrchDaemon::init()
CFG_MUX_CABLE_TABLE_NAME,
CFG_PEER_SWITCH_TABLE_NAME
};
MuxOrch *mux_orch = new MuxOrch(m_configDb, mux_tables, tunnel_decap_orch, gNeighOrch, gFdbOrch);
MuxOrch *mux_orch = new MuxOrch(m_configDb, mux_tables, gTunneldecapOrch, gNeighOrch, gFdbOrch);
gDirectory.set(mux_orch);

MuxCableOrch *mux_cb_orch = new MuxCableOrch(m_applDb, m_stateDb, APP_MUX_CABLE_TABLE_NAME);
Expand Down Expand Up @@ -409,7 +416,7 @@ bool OrchDaemon::init()
* when iterating ConsumerMap. This is ensured implicitly by the order of keys in ordered map.
* For cases when Orch has to process tables in specific order, like PortsOrch during warm start, it has to override Orch::doTask()
*/
m_orchList = { gSwitchOrch, gCrmOrch, gPortsOrch, gBufferOrch, gFlowCounterRouteOrch, gIntfsOrch, gNeighOrch, gNhgMapOrch, gNhgOrch, gCbfNhgOrch, gRouteOrch, gCoppOrch, gQosOrch, wm_orch, gPolicerOrch, tunnel_decap_orch, sflow_orch, gDebugCounterOrch, gMacsecOrch, bgp_global_state_orch, gBfdOrch, gSrv6Orch, mux_orch, mux_cb_orch, gMonitorOrch};
m_orchList = { gSwitchOrch, gCrmOrch, gPortsOrch, gBufferOrch, gFlowCounterRouteOrch, gIntfsOrch, gNeighOrch, gNhgMapOrch, gNhgOrch, gCbfNhgOrch, gRouteOrch, gCoppOrch, gQosOrch, wm_orch, gPolicerOrch, gTunneldecapOrch, sflow_orch, gDebugCounterOrch, gMacsecOrch, bgp_global_state_orch, gBfdOrch, gSrv6Orch, mux_orch, mux_cb_orch, gMonitorOrch};

bool initialize_dtel = false;
if (platform == BFN_PLATFORM_SUBSTRING || platform == VS_PLATFORM_SUBSTRING)
Expand Down
Loading

0 comments on commit 789eafb

Please sign in to comment.