Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge azure/sonic-swss to aclorch branch #3

Merged
merged 50 commits into from
Oct 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5d04f05
[portsorch]: Rename function isPortReady() to allPortsReady() (#990)
wendani Jul 24, 2019
dde876d
ARM32 bit fixes, for 64bit printf format specifier (#989)
antony-rheneus Jul 25, 2019
e1f4403
Add synchronous switch to orch agent (#987)
kcudnik Jul 25, 2019
b7fa616
[test]: Update test_vlan to use dvs functions (#986)
stcheng Jul 25, 2019
ab8fead
Support per buffer pool watermark polling mode (#973)
wendani Jul 25, 2019
6236b8f
[vstest]: report error when team kernel module is not available (#994)
lguohan Jul 25, 2019
cadc5bd
[qosorch]: Add cir and pir parameters for scheduler (#991)
tengfei-astfs Jul 25, 2019
5c54393
[vstest]: add --imgname option to specify vs image to test (#996)
lguohan Jul 27, 2019
7368527
[test]: Add Class object in each test script file (#992)
stcheng Jul 28, 2019
5be3963
Remove the platform check for remove/add port action at init phase. (…
zhenggen-xu Jul 31, 2019
8e50633
Trap DHCPv6 packets for supporting ZTP over in-band interfaces using …
rajendra-dendukuri Jul 31, 2019
00d8d41
Config DB manual is being moved from Wiki to SWSS repo (#1002)
kannankvs Jul 31, 2019
5166212
Fix VLAN error introduced with new 4.9 kernel behavior (#1001)
jipanyang Jul 31, 2019
a5e6bea
[vxlanorch] Fix Logic of Vxlan tunnel removal (#995)
sdddean Jul 31, 2019
9143018
[fdborch] support mac update (#877)
shine4chen Aug 1, 2019
ee2b1e5
[warm-reboot]: add bgp eoiu support to speed up route reconcile (#856)
jipanyang Aug 1, 2019
4580fa7
[vstest]: Add the CRM tests (#1013)
lguohan Aug 1, 2019
0da2f4c
[vlan] Add pytest cases to verify data in app db and state db. (#895)
linemma Aug 1, 2019
596aac6
[vstests]: change 'test_acl_egress_table.py' to UNIX format (#1010)
wangshengjun Aug 1, 2019
6301abe
[vstest]: Add test_port_config.py which include breakout port test. (…
chiourung Aug 2, 2019
51393a2
[VLAN] Add pytest cases to validate different use-case of tagging_mod…
linemma Aug 2, 2019
8fcf43d
Provide broadcast IP while configuring interface ip address (#1007)
vasant17 Aug 3, 2019
34b582c
[orchagent] Add support for Innovium platform (#1005)
tonytitus Aug 3, 2019
264e548
[orchagent]: Avoid crash by setting g_syncMode flag before create_swi…
dzhangalibaba Aug 5, 2019
273608c
[aclorch]: Add MIRRORv6 support for NPS platform (#1018)
JaredLius Aug 7, 2019
a882f75
[policerorch]: Add the capability to update policer rate/size (#1017)
stcheng Aug 7, 2019
bb0bcf8
[vlan] Add pytest cases to validate the behavior about add LAG member…
linemma Aug 8, 2019
fcddc0f
[vnet]: Enable "vnet_orch_1" VS test case (#1020)
Aug 8, 2019
2902ba0
[portsyncd]: Fix portsyncd restart case (#1019)
stepanblyschak Aug 8, 2019
252e12c
Add scope attribute to VNET table. (#954)
prsunny Aug 9, 2019
b611808
[Orchagent]: Fixbug segmentfault at routeorch (#1025)
Pterosaur Aug 16, 2019
65cbd55
[build]: Fix compiling warnings using ARM 32 bit compiler (#1015)
antony-rheneus Aug 16, 2019
5ae4226
[test]: Adjust stale timer for warm-reboot neighborsync test cases (#…
zhenggen-xu Aug 19, 2019
dc81a21
[vnet]: Fix FDB related failure in "vnet_bitmap" virtual switch test …
Aug 20, 2019
34915de
[portsyncd]: Add default catch block in portsyncd (#1033)
SuvarnaMeenakshi Aug 22, 2019
c461911
[copporch]: Fix the typo - mld_v1_done (#1037)
wangshengjun Aug 26, 2019
39fe568
[aclorch]: Revise ACL rule creation/removal logs (#1042)
stcheng Aug 30, 2019
5841e06
Add dot1p to tc mapping support (#871)
wendani Sep 6, 2019
313ef5c
Warmboot Vlan neigh restore fix (#1040)
prsunny Sep 9, 2019
d98d1e9
[aclorch]: Egress mirror action support and action ASIC support check…
stepanblyschak Sep 16, 2019
3fb22e1
Check warmboot flag during initialization (#1057)
prsunny Sep 16, 2019
da514f5
Do not update lag mtu from teamsyncd (netlink) (#1053)
prsunny Sep 18, 2019
4d8e08d
change in fpmsyncd to skip the lookup for the Master device name if t…
Arvind-Brcm Sep 19, 2019
12c29b4
Cannot ping to link-local ipv6 interface address of the switch. (#774)
kirankella Sep 19, 2019
543bd98
[aclorch]: Fix table name in counter table for mirror rules (#1060)
stcheng Sep 19, 2019
0ddaba3
Adopt to signature change of Selectable::readData, which switched (#1…
renukamanavalan Sep 19, 2019
a5b6e7c
Ignore link local neighbors (#1065)
prsunny Sep 20, 2019
d823dd1
[MirrorOrch]: Mirror Session Retention across Warm Reboot (#1054)
stcheng Sep 20, 2019
182940d
[mirrororch]: Remove mirror session state after it is remvoed (#1066)
stcheng Sep 26, 2019
175f3de
Update ECMP NHopGroup for Port Channel oper down (#1030)
sumukhatv Sep 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions cfgmgr/intfmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,27 @@ IntfMgr::IntfMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, c
}

void IntfMgr::setIntfIp(const string &alias, const string &opCmd,
const string &ipPrefixStr, const bool ipv4)
const IpPrefix &ipPrefix)
{
stringstream cmd;
string res;
stringstream cmd;
string res;
string ipPrefixStr = ipPrefix.to_string();
string broadcastIpStr = ipPrefix.getBroadcastIp().to_string();
int prefixLen = ipPrefix.getMaskLength();

if (ipv4)
if (ipPrefix.isV4())
{
cmd << IP_CMD << " address " << opCmd << " " << ipPrefixStr << " dev " << alias;
(prefixLen < 31) ?
(cmd << IP_CMD << " address " << opCmd << " " << ipPrefixStr << " broadcast " << broadcastIpStr <<" dev " << alias) :
(cmd << IP_CMD << " address " << opCmd << " " << ipPrefixStr << " dev " << alias);
}
else
{
cmd << IP_CMD << " -6 address " << opCmd << " " << ipPrefixStr << " dev " << alias;
(prefixLen < 127) ?
(cmd << IP_CMD << " -6 address " << opCmd << " " << ipPrefixStr << " broadcast " << broadcastIpStr << " dev " << alias) :
(cmd << IP_CMD << " -6 address " << opCmd << " " << ipPrefixStr << " dev " << alias);
}

int ret = swss::exec(cmd.str(), res);
if (ret)
{
Expand Down Expand Up @@ -202,7 +210,7 @@ bool IntfMgr::doIntfAddrTask(const vector<string>& keys,
// Set Interface IP except for lo
if (!is_lo)
{
setIntfIp(alias, "add", ip_prefix.to_string(), ip_prefix.isV4());
setIntfIp(alias, "add", ip_prefix);
}

std::vector<FieldValueTuple> fvVector;
Expand All @@ -219,7 +227,7 @@ bool IntfMgr::doIntfAddrTask(const vector<string>& keys,
// Set Interface IP except for lo
if (!is_lo)
{
setIntfIp(alias, "del", ip_prefix.to_string(), ip_prefix.isV4());
setIntfIp(alias, "del", ip_prefix);
}
m_appIntfTableProducer.del(appKey);
m_stateIntfTable.del(keys[0] + state_db_key_delimiter + keys[1]);
Expand Down
2 changes: 1 addition & 1 deletion cfgmgr/intfmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IntfMgr : public Orch
Table m_cfgIntfTable, m_cfgVlanIntfTable;
Table m_statePortTable, m_stateLagTable, m_stateVlanTable, m_stateVrfTable, m_stateIntfTable;

void setIntfIp(const string &alias, const string &opCmd, const string &ipPrefixStr, const bool ipv4 = true);
void setIntfIp(const string &alias, const string &opCmd, const IpPrefix &ipPrefix);
void setIntfVrf(const string &alias, const string vrfName);
bool doIntfGeneralTask(const vector<string>& keys, const vector<FieldValueTuple>& data, const string& op);
bool doIntfAddrTask(const vector<string>& keys, const vector<FieldValueTuple>& data, const string& op);
Expand Down
16 changes: 15 additions & 1 deletion cfgmgr/nbrmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ NbrMgr::NbrMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, con
m_statePortTable(stateDb, STATE_PORT_TABLE_NAME),
m_stateLagTable(stateDb, STATE_LAG_TABLE_NAME),
m_stateVlanTable(stateDb, STATE_VLAN_TABLE_NAME),
m_stateIntfTable(stateDb, STATE_INTERFACE_TABLE_NAME)
m_stateIntfTable(stateDb, STATE_INTERFACE_TABLE_NAME),
m_stateNeighRestoreTable(stateDb, STATE_NEIGH_RESTORE_TABLE_NAME)
{
int err = 0;

Expand Down Expand Up @@ -91,6 +92,19 @@ bool NbrMgr::isIntfStateOk(const string &alias)
return false;
}

bool NbrMgr::isNeighRestoreDone()
{
string value;

m_stateNeighRestoreTable.hget("Flags", "restored", value);
if (value == "true")
{
SWSS_LOG_INFO("Kernel neighbor table restore is done");
return true;
}
return false;
}

bool NbrMgr::setNeighbor(const string& alias, const IpAddress& ip, const MacAddress& mac)
{
SWSS_LOG_ENTER();
Expand Down
4 changes: 3 additions & 1 deletion cfgmgr/nbrmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ class NbrMgr : public Orch
NbrMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames);
using Orch::doTask;

bool isNeighRestoreDone();

private:
bool isIntfStateOk(const string &alias);
bool setNeighbor(const string& alias, const IpAddress& ip, const MacAddress& mac);

void doTask(Consumer &consumer);

Table m_statePortTable, m_stateLagTable, m_stateVlanTable, m_stateIntfTable;
Table m_statePortTable, m_stateLagTable, m_stateVlanTable, m_stateIntfTable, m_stateNeighRestoreTable;
struct nl_sock *m_nl_sock;
};

Expand Down
26 changes: 26 additions & 0 deletions cfgmgr/nbrmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
#include <mutex>
#include <fstream>
#include <iostream>
#include <chrono>

#include "select.h"
#include "exec.h"
#include "schema.h"
#include "nbrmgr.h"
#include "warm_restart.h"

using namespace std;
using namespace swss;

#define RESTORE_NEIGH_WAIT_TIME_OUT 120
#define RESTORE_NEIGH_WAIT_TIME_INT 10

/* select() function timeout retry time, in millisecond */
#define SELECT_TIMEOUT 1000

Expand Down Expand Up @@ -50,6 +55,27 @@ int main(int argc, char **argv)

NbrMgr nbrmgr(&cfgDb, &appDb, &stateDb, cfg_nbr_tables);

WarmStart::initialize("nbrmgrd", "swss");
WarmStart::checkWarmStart("nbrmgrd", "swss");

if (WarmStart::isWarmStart())
{
chrono::steady_clock::time_point starttime = chrono::steady_clock::now();
while (!nbrmgr.isNeighRestoreDone())
{
chrono::duration<double> time_span = chrono::duration_cast<chrono::duration<double>>
(chrono::steady_clock::now() - starttime);
int pasttime = int(time_span.count());
SWSS_LOG_INFO("Kernel neighbor table restoration waited for %d seconds", pasttime);
if (pasttime > RESTORE_NEIGH_WAIT_TIME_OUT)
{
SWSS_LOG_WARN("Kernel neighbor table restore is not finished!");
break;
}
sleep(RESTORE_NEIGH_WAIT_TIME_INT);
}
}

std::vector<Orch *> cfgOrchList = {&nbrmgr};

swss::Select s;
Expand Down
12 changes: 10 additions & 2 deletions cfgmgr/vlanmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,19 @@ VlanMgr::VlanMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, c
// The command should be generated as:
// /bin/bash -c "/sbin/ip link del Bridge 2>/dev/null ;
// /sbin/ip link add Bridge up type bridge &&
// /sbin/bridge vlan del vid 1 dev Bridge self"
// /sbin/bridge vlan del vid 1 dev Bridge self;
// /sbin/ip link del dummy 2>/dev/null;
// /sbin/ip link add dummy type dummy &&
// sbin/ip link set dummy master Bridge"

const std::string cmds = std::string("")
+ BASH_CMD + " -c \""
+ IP_CMD + " link del " + DOT1Q_BRIDGE_NAME + " 2>/dev/null; "
+ IP_CMD + " link add " + DOT1Q_BRIDGE_NAME + " up type bridge && "
+ BRIDGE_CMD + " vlan del vid " + DEFAULT_VLAN_ID + " dev " + DOT1Q_BRIDGE_NAME + " self\"";
+ BRIDGE_CMD + " vlan del vid " + DEFAULT_VLAN_ID + " dev " + DOT1Q_BRIDGE_NAME + " self; "
+ IP_CMD + " link del dev dummy 2>/dev/null; "
+ IP_CMD + " link add dummy type dummy && "
+ IP_CMD + " link set dummy master " + DOT1Q_BRIDGE_NAME + "\"";

std::string res;
EXEC_WITH_ERROR_THROW(cmds, res);
Expand Down Expand Up @@ -169,10 +175,12 @@ bool VlanMgr::addHostVlanMember(int vlan_id, const string &port_alias, const str

// The command should be generated as:
// /bin/bash -c "/sbin/ip link set {{port_alias}} master Bridge &&
// /sbin/bridge vlan del vid 1 dev {{ port_alias }} &&
// /sbin/bridge vlan add vid {{vlan_id}} dev {{port_alias}} {{tagging_mode}}"
const std::string cmds = std::string("")
+ BASH_CMD + " -c \""
+ IP_CMD + " link set " + port_alias + " master " + DOT1Q_BRIDGE_NAME + " && "
+ BRIDGE_CMD + " vlan del vid " + DEFAULT_VLAN_ID + " dev " + port_alias + " && "
+ BRIDGE_CMD + " vlan add vid " + std::to_string(vlan_id) + " dev " + port_alias + " " + tagging_cmd + "\"";

std::string res;
Expand Down
1 change: 1 addition & 0 deletions debian/swss.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
swssconfig/sample/netbouncer.json etc/swss/config.d
swssconfig/sample/00-copp.config.json etc/swss/config.d
neighsyncd/restore_neighbors.py usr/bin
fpmsyncd/bgp_eoiu_marker.py usr/bin
Loading