Skip to content

Commit

Permalink
Merge branch 'master' into arlakshm/master/remote_ecmp
Browse files Browse the repository at this point in the history
  • Loading branch information
arlakshm authored May 22, 2024
2 parents ce244a4 + a280e36 commit c0b4c99
Show file tree
Hide file tree
Showing 148 changed files with 6,887 additions and 1,842 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 @@ -107,7 +107,7 @@ jobs:
# install packages for vs test
sudo apt-get install -y net-tools bridge-utils vlan
sudo apt-get install -y python3-pip
sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker>=4.4.1 redis==3.3.4 flaky==3.7.0
sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker>=4.4.1 redis==3.3.4 flaky==3.7.0 requests==2.31.0
sudo pip3 install lcov_cobertura
displayName: "Install dependencies"
Expand Down
39 changes: 39 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,45 @@ stages:
artifact_name: sonic-swss.arm64
archive_gcov: false

- stage: BuildBookworm
dependsOn: BuildArm
condition: succeeded('BuildArm')
jobs:
- template: .azure-pipelines/build-template.yml
parameters:
arch: amd64
pool: sonicbld
sonic_slave: sonic-slave-bookworm
common_lib_artifact_name: common-lib
swss_common_artifact_name: sonic-swss-common-bookworm
sairedis_artifact_name: sonic-sairedis-bookworm
artifact_name: sonic-swss-bookworm
archive_gcov: false

- template: .azure-pipelines/build-template.yml
parameters:
arch: armhf
timeout: 240
pool: sonicbld-armhf
sonic_slave: sonic-slave-bookworm-armhf
common_lib_artifact_name: common-lib.armhf
swss_common_artifact_name: sonic-swss-common-bookworm.armhf
sairedis_artifact_name: sonic-sairedis-bookworm.armhf
artifact_name: sonic-swss-bookworm.armhf
archive_gcov: false

- template: .azure-pipelines/build-template.yml
parameters:
arch: arm64
timeout: 240
pool: sonicbld-arm64
sonic_slave: sonic-slave-bookworm-arm64
common_lib_artifact_name: common-lib.arm64
swss_common_artifact_name: sonic-swss-common-bookworm.arm64
sairedis_artifact_name: sonic-sairedis-bookworm.arm64
artifact_name: sonic-swss-bookworm.arm64
archive_gcov: false

- stage: BuildDocker
dependsOn: Build
condition: succeeded('Build')
Expand Down
2 changes: 1 addition & 1 deletion cfgmgr/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CFLAGS_SAI = -I /usr/include/sai
LIBNL_CFLAGS = -I/usr/include/libnl3
LIBNL_LIBS = -lnl-genl-3 -lnl-route-3 -lnl-3
SAIMETA_LIBS = -lsaimeta -lsaimetadata -lzmq
COMMON_LIBS = -lswsscommon
COMMON_LIBS = -lswsscommon -lpthread

bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd tunnelmgrd macsecmgrd fabricmgrd

Expand Down
18 changes: 9 additions & 9 deletions cfgmgr/buffermgrdyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,15 +934,6 @@ void BufferMgrDynamic::updateBufferObjectToDb(const string &key, const string &p
void BufferMgrDynamic::updateBufferObjectListToDb(const string &key, const string &profileList, buffer_direction_t dir)
{
auto &table = m_applBufferProfileListTables[dir];
const auto &direction = m_bufferDirectionNames[dir];

if (!m_bufferPoolReady)
{
SWSS_LOG_NOTICE("Buffer pools are not ready when configuring buffer %s profile list %s, pending", direction.c_str(), key.c_str());
m_bufferObjectsPending = true;
return;
}

vector<FieldValueTuple> fvVector;

fvVector.emplace_back(buffer_profile_list_field_name, profileList);
Expand Down Expand Up @@ -3245,6 +3236,15 @@ task_process_status BufferMgrDynamic::handleSingleBufferPortProfileListEntry(con
}
}

if (!m_bufferPoolReady)
{
const auto &direction = m_bufferDirectionNames[dir];

SWSS_LOG_NOTICE("Buffer pools are not ready when configuring buffer %s profile list %s, pending", direction.c_str(), key.c_str());
m_bufferObjectsPending = true;
return task_process_status::task_success;
}

auto &portInfo = m_portInfoLookup[port];
if (PORT_ADMIN_DOWN != portInfo.state)
{
Expand Down
23 changes: 13 additions & 10 deletions cfgmgr/coppmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ static set<string> g_copp_init_set;

void CoppMgr::parseInitFile(void)
{
std::ifstream ifs(COPP_INIT_FILE);
std::ifstream ifs(m_coppCfgfile);

if (ifs.fail())
{
SWSS_LOG_ERROR("COPP init file %s not found", COPP_INIT_FILE);
SWSS_LOG_ERROR("COPP init file %s not found", m_coppCfgfile.c_str());
return;
}
json j = json::parse(ifs);
Expand Down Expand Up @@ -182,14 +183,13 @@ bool CoppMgr::isTrapIdDisabled(string trap_id)
{
return false;
}
break;
if (isFeatureEnabled(trap_name))
{
return false;
}
}
}

if (isFeatureEnabled(trap_name))
{
return false;
}
return true;
}

Expand Down Expand Up @@ -293,15 +293,16 @@ bool CoppMgr::isDupEntry(const std::string &key, std::vector<FieldValueTuple> &f
return true;
}

CoppMgr::CoppMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames) :
CoppMgr::CoppMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames, const string copp_init_file) :
Orch(cfgDb, tableNames),
m_cfgCoppTrapTable(cfgDb, CFG_COPP_TRAP_TABLE_NAME),
m_cfgCoppGroupTable(cfgDb, CFG_COPP_GROUP_TABLE_NAME),
m_cfgFeatureTable(cfgDb, CFG_FEATURE_TABLE_NAME),
m_appCoppTable(appDb, APP_COPP_TABLE_NAME),
m_stateCoppTrapTable(stateDb, STATE_COPP_TRAP_TABLE_NAME),
m_stateCoppGroupTable(stateDb, STATE_COPP_GROUP_TABLE_NAME),
m_coppTable(appDb, APP_COPP_TABLE_NAME)
m_coppTable(appDb, APP_COPP_TABLE_NAME),
m_coppCfgfile(copp_init_file)
{
SWSS_LOG_ENTER();
parseInitFile();
Expand Down Expand Up @@ -939,7 +940,9 @@ void CoppMgr::doFeatureTask(Consumer &consumer)
{
if (m_featuresCfgTable.find(key) == m_featuresCfgTable.end())
{
m_featuresCfgTable.emplace(key, kfvFieldsValues(t));
// Init with empty feature state which will be updated in setFeatureTrapIdsStatus
FieldValueTuple fv("state", "");
m_featuresCfgTable[key].push_back(fv);
}
for (auto i : kfvFieldsValues(t))
{
Expand Down
3 changes: 2 additions & 1 deletion cfgmgr/coppmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CoppMgr : public Orch
{
public:
CoppMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb,
const std::vector<std::string> &tableNames);
const std::vector<std::string> &tableNames, const std::string copp_init_file = COPP_INIT_FILE);

using Orch::doTask;
private:
Expand All @@ -75,6 +75,7 @@ class CoppMgr : public Orch
CoppCfg m_coppGroupInitCfg;
CoppCfg m_coppTrapInitCfg;
CoppCfg m_featuresCfgTable;
std::string m_coppCfgfile;


void doTask(Consumer &consumer);
Expand Down
2 changes: 1 addition & 1 deletion cfgmgr/fabricmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FabricMgr : public Orch
Table m_cfgFabricMonitorTable;
Table m_cfgFabricPortTable;
Table m_appFabricMonitorTable;
Table m_appFabricPortTable;
ProducerStateTable m_appFabricPortTable;

void doTask(Consumer &consumer);
bool writeConfigToAppDb(const std::string &alias, const std::string &field, const std::string &value);
Expand Down
8 changes: 4 additions & 4 deletions fdbsyncd/fdbsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info)

if (fdb_type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand Down Expand Up @@ -384,7 +384,7 @@ void FdbSync::addLocalMac(string key, string op)

if (m_fdb_mac[key].type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand Down Expand Up @@ -432,7 +432,7 @@ void FdbSync::updateMclagRemoteMac (struct m_fdb_info *info)

if (fdb_type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand Down Expand Up @@ -511,7 +511,7 @@ void FdbSync::macRefreshStateDB(int vlan, string kmac)

if (m_fdb_mac[key].type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand Down
8 changes: 6 additions & 2 deletions fpmsyncd/routesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ void RouteSync::onEvpnRouteMsg(struct nlmsghdr *h, int len)
inet_ntop(rtm->rtm_family, dstaddr, buf, MAX_ADDR_SIZE), dst_len);
}

auto proto_str = getProtocolString(rtm->rtm_protocol);
SWSS_LOG_INFO("Receive route message dest ip prefix: %s Op:%s",
destipprefix,
nlmsg_type == RTM_NEWROUTE ? "add":"del");
Expand Down Expand Up @@ -550,17 +551,20 @@ void RouteSync::onEvpnRouteMsg(struct nlmsghdr *h, int len)
FieldValueTuple intf("ifname", intf_list);
FieldValueTuple vni("vni_label", vni_list);
FieldValueTuple mac("router_mac", mac_list);
FieldValueTuple proto("protocol", proto_str);

fvVector.push_back(nh);
fvVector.push_back(intf);
fvVector.push_back(vni);
fvVector.push_back(mac);
fvVector.push_back(proto);

if (!warmRestartInProgress)
{
m_routeTable.set(destipprefix, fvVector);
SWSS_LOG_DEBUG("RouteTable set msg: %s vtep:%s vni:%s mac:%s intf:%s",
destipprefix, nexthops.c_str(), vni_list.c_str(), mac_list.c_str(), intf_list.c_str());
SWSS_LOG_DEBUG("RouteTable set msg: %s vtep:%s vni:%s mac:%s intf:%s protocol:%s",
destipprefix, nexthops.c_str(), vni_list.c_str(), mac_list.c_str(), intf_list.c_str(),
proto_str.c_str());
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fpmsyncd/routesync.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class RouteSync : public NetMsg
string& mac_list, string& intf_list,
string rmac, string vlan_id);

bool getEvpnNextHop(struct nlmsghdr *h, int received_bytes, struct rtattr *tb[],
virtual bool getEvpnNextHop(struct nlmsghdr *h, int received_bytes, struct rtattr *tb[],
string& nexthops, string& vni_list, string& mac_list,
string& intf_list);

Expand Down
3 changes: 2 additions & 1 deletion mclagsyncd/mclaglink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ void MclagLink::setPortIsolate(char *msg)
static const unordered_set<string> supported {
BRCM_PLATFORM_SUBSTRING,
BFN_PLATFORM_SUBSTRING,
CTC_PLATFORM_SUBSTRING
CTC_PLATFORM_SUBSTRING,
MRVL_PLATFORM_SUBSTRING
};

const char *platform = getenv("platform");
Expand Down
1 change: 1 addition & 0 deletions mclagsyncd/mclaglink.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define BRCM_PLATFORM_SUBSTRING "broadcom"
#define BFN_PLATFORM_SUBSTRING "barefoot"
#define CTC_PLATFORM_SUBSTRING "centec"
#define MRVL_PLATFORM_SUBSTRING "marvell"

using namespace std;

Expand Down
4 changes: 3 additions & 1 deletion orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CFLAGS_SAI = -I /usr/include/sai
swssdir = $(datadir)/swss

dist_swss_DATA = \
eliminate_events.lua \
rif_rates.lua \
pfc_detect_innovium.lua \
pfc_detect_mellanox.lua \
Expand Down Expand Up @@ -113,7 +114,8 @@ orchagent_SOURCES = \
dash/dashaclorch.cpp \
dash/dashaclgroupmgr.cpp \
dash/dashtagmgr.cpp \
dash/pbutils.cpp
dash/pbutils.cpp \
twamporch.cpp

orchagent_SOURCES += flex_counter/flex_counter_manager.cpp flex_counter/flex_counter_stat_manager.cpp flex_counter/flow_counter_handler.cpp flex_counter/flowcounterrouteorch.cpp
orchagent_SOURCES += debug_counter/debug_counter.cpp debug_counter/drop_counter.cpp
Expand Down
8 changes: 6 additions & 2 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2586,6 +2586,12 @@ bool AclTable::add(shared_ptr<AclRule> newRule)
if (ruleIter != rules.end())
{
// If ACL rule already exists, delete it first
if (ruleIter->second->hasCounter())
{
// Deregister the flex counter before deleting the rule
// A new flex counter will be created when the new rule is added
m_pAclOrch->deregisterFlexCounter(*(ruleIter->second));
}
if (ruleIter->second->remove())
{
rules.erase(ruleIter);
Expand Down Expand Up @@ -3223,7 +3229,6 @@ void AclOrch::initDefaultTableTypes()
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT))
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT))
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS))
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS))
.build()
);

Expand All @@ -3241,7 +3246,6 @@ void AclOrch::initDefaultTableTypes()
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT))
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT))
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS))
.withMatch(make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS))
.build()
);

Expand Down
Loading

0 comments on commit c0b4c99

Please sign in to comment.