Skip to content

Commit

Permalink
Fixes sag merge conflicts (#3)
Browse files Browse the repository at this point in the history
* Fixes mock test failure

* Fixes mock test run failure

fixes pipeline run failure

FAIL: p4orch_tests_usan
=======================

../../../orchagent/vrforch.cpp:113:41: runtime error: member call on
null pointer of type 'struct RouteOrch'
../../../orchagent/vrforch.cpp:113:41: runtime error: member access
within null pointer of type 'struct RouteOrch'
FAIL p4orch_tests_usan (exit status: 139)

* Fixed orchagent crash in VM with the Qos BUFFER_QUEUE|system-port|Queue-id-range config (sonic-net#3050)

* Fixed orchagent crash in VM with the Qos BUFFER_QUEUE|system-port|Queue-id-range config

* [intfsorch] Enable ipv6 proxy ndp along with proxy arp (sonic-net#3045)

* [intfsorch] Enable ipv6 proxy ndp along with proxy arp

setting SAI_VLAN_ATTR_UNKNOWN_MULTICAST_FLOOD_CONTROL_TYPE to
SAI_VLAN_FLOOD_CONTROL_TYPE_NONE when proxy arp is enabled. This fixes a
bug where ipv6 NS packets were flooding ports with duplicate packets. We
now set multicast flood type to none.

* Fix multi VLAN neighbor learning (sonic-net#3049)

What I did

When adding a new neighbor, check if the neighbor IP has already been learned on a different VLAN. If it has, remove the old neighbor entry before adding the new one.

Why I did it
On Gemini devices, if a neighbor IP moves from an active port in one VLAN to a second VLAN, then back to the first VLAN (with 3 different MAC addresses), orchagent will crash. Even though the MAC address of the last move is different from the first MAC address, orchagent believes the last MAC address to already be programmed in the hardware and tries to set an attribute of the entry which doesn't exist.

* [asan] Disable the "maybe-uninitialized" warning when compiled with ASAN enabled.

* Set HOST_TX_READY_NOTIFY attribute only after query capabilities(sonic-net#3070)

*Set HOST_TX_READY_NOTIFY attribute only after query capabilities

* [EVPN] Skip EVPN routes with invalid VNI or router mac field (sonic-net#3073)

* Skip EVPN routes with invalid VNI or router mac field

* Add port flap count and last flap timestamp to APPL_DB (sonic-net#3052)

* Add port flap count and last flap timestamp

* Add basic fabric link monitoring counters and states handling. (sonic-net#2988)

* Add basic fabric link monitoring counters and states handling.

* [Mellanox] Fix inconsistence in the shared headroom pool initialization (sonic-net#3057)

* Fix inconsistence in the shared headroom pool initialization

* Why I did it

During initialization, if SHP is enabled

the buffer pool sizes, xoff have initialized to 0, which means SHP is disabled
but the buffer profiles already indicate SHP
later on the buffer pool sizes are updated with off being non-zero
In case the orchagent starts handling buffer configuration between 2 and 3, it is inconsistent between buffer pools and profiles, which fails Mellanox SAI sanity check.
To avoid it, it indicates SHP enabled by setting a very small buffer pool and SHP sizes

* [acl] Add IN_PORTS qualifier for L3 table (sonic-net#3078)

* Apply IN_PORTS qualifiier for L3 table

Why I did it
IN_PORTS qualifier was allowed for L3 table in 202012 release and below. Changes in sonic-net#1982 removed that support leading to regression in some of our testcases. The following error was observed
ERR swss#orchagent: :- validateAclRuleMatch: Match SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS in rule RULE_1 is not supported by table DATAACL

* [bulker] add support for neighbor bulking (sonic-net#2768)

Adding support for sai_neighbor_api_t bulking in bulker.h

* [buffermgrd] Move switch-statement outside of if-statement in BufferMgr::doTask (sonic-net#3055)

* [buffermgr] Moved switch statement outside of if-statmement in Buffermgr::doTask

The switch statement which would normally erase buffer events was moved
to be inside the if-statement which would only enter if the event is a
SET event. This was introduced in commit e5329c39.

This would cause an infinite loop, since non-set events would never be
erased.

The switch statement has now been moved to occur outside the if,
allowing for non-set commands to be processed.

* [portsorch] process only updated APP_DB fields when port is already   created (sonic-net#3025)

* [portsorch] process only updated APP_DB fields when port is already created

What I did

Fixing an issue when setting some port attribute in APPL_DB triggers serdes parameters to be re-programmed with port toggling. Made portsorch to handle only those attributes that were pushed to APPL_DB, so that serdes programming happens only by xcvrd's request to do so.

* [Copp]Refactor coppmgr tests (sonic-net#3093)

What I did
Refactoring coppmgr mock tests

Why I did it
After migration to bookworm, coppmgr tests started failing due to the use of sudo commands.

* Revert "[acl] Add IN_PORTS qualifier for L3 table (sonic-net#3078)" (sonic-net#3092)

This reverts commit 9d4a3ad.
*Revert "[acl] Add IN_PORTS qualifier for L3 table"

* [orchagent] TWAMP Light orchagent implementation (sonic-net#2927)

* [orchagent] TWAMP Light orchagent implementation. (sonic-net#2927)
* What I did
Implemented the TWAMP Light feature according to the SONiC TWAMP Light HLD(sonic-net/SONiC#1320).

* Clang format change. (sonic-net#3080)

What I did
This PR has no real code change. It is purely clang formatting. It only applies to the P4Orch codes.
Commands that I run:
find orchagent/p4orch -name *.h -o -name .cpp | xargs clang-format -i -style="{BasedOnStyle: Microsoft, DerivePointerAlignment: false}"

find orchagent -name response_publisher -o -name return_code.h | xargs clang-format -i -style="{BasedOnStyle: Microsoft, DerivePointerAlignment: false}"

* T2-VOQ-VS: Fix iBGP bringup issue  (sonic-net#3053)

* Fix iBGP bringup issue T2-vswitch
* On T2-VOQ chassis Emulation with multi-asic linecards, iBGP sessions dont come up. Related Issue: sonic-net/sonic-buildimage#18129

* [Fdbsyncd] Adding extern_learn flag with fdb entry so Kernel doesn't age out (sonic-net#2985)

* Adding extern_learn flag with fdb entry so that Kernel doesn't age out the MAC

* [Fdbsyncd] Adding extern_learn flag with fdb entry so Kernel doesn't age out

What I did
extern_learn flag is added while programming the fdb entry into the Kernel. This will make sure that kernel doesn't age out the fdb entry. (#15004)

How I did it
A flag extern_learn will be passed while programing the fdb entry. (#15004)

How to verify it
Tested MAC add/del to the Kernel from the local FDB entry. (#15004)

Signed-off-by: kishore.kunal@broadcom.com

---------

Signed-off-by: kishore.kunal@broadcom.com
Co-authored-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>

* Fix oper FEC retrieval after warmboot (sonic-net#3100)

Updating oper FEC status in state_db after warm-reboot as part of refresh port status call

* [EVPN]Fix fpmsyncd crash when EVPN type5 is received with bgp fib suppression enabled (sonic-net#3101)

* [EVPN]Fix fpmsyncd crash when EVPN type5 is received with bgp fib suppression enabled

* [portsorch] Handle TRANSCEIVER_INFO table on warm boot (sonic-net#3087)

* Add existing data from TRANSCEIVER_INFO table

* Introduce a new role for DPU-NPU Interconnect

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Co-authored-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>

* [p4orch] Clang format change. (sonic-net#3096)

What I did
[p4orch]  This PR has no real code change. It is purely clang formatting. 
It does the same as sonic-net#3080.

* [dash] fix ENI admin state update (sonic-net#3081)

* [dash] fix ENI admin state update

* Add force option for fabric port unisolate command (sonic-net#3089)

What I did
Add force option to the unisolate link command, so users can make the links not isolate if they want.
depends on sonic-net/sonic-buildimage#18447

* [twamporch] Explicitly initialize local variable (sonic-net#3115)

What I did
Explicitly initialized local variable.

Why I did it
We met below error message in sonic-buildimage armhf build (sonic-net/sonic-buildimage#18334)

* Add bookworm build to the PR checkers (sonic-net#3114)

What I did
Add a Bookworm build to the PR checkers. Also fix some Bookworm build errors that crept in.

Why I did it
Buildimage now builds swss for Bookworm, so the build needs to succeed.

* [ACL] Remove flex counter when updating ACL rule (sonic-net#3118)

What I did
This PR is to fix sonic-net/sonic-buildimage#18719

When ACL rule is created for the first time, a flex counter is created and registered. When the same ACL rule is being updated, the FlexCounter created before is not removed, and another FlexCounter is created and registered.

Why I did it
Fix the issue that FlexCounter is duplicated when updating existing ACL rule.

---------

Signed-off-by: kishore.kunal@broadcom.com
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Co-authored-by: saksarav-nokia <sakthivadivu.saravanaraj@nokia.com>
Co-authored-by: Nikola Dancejic <26731235+Ndancejic@users.noreply.github.com>
Co-authored-by: Lawrence Lee <lawlee@microsoft.com>
Co-authored-by: Oleksandr Ivantsiv <oivantsiv@nvidia.com>
Co-authored-by: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com>
Co-authored-by: Lior Avramov <73036155+liorghub@users.noreply.github.com>
Co-authored-by: Prince George <45705344+prgeor@users.noreply.github.com>
Co-authored-by: jfeng-arista <98421150+jfeng-arista@users.noreply.github.com>
Co-authored-by: Stephen Sun <5379172+stephenxs@users.noreply.github.com>
Co-authored-by: Neetha John <nejo@microsoft.com>
Co-authored-by: Amir <mazora@marvell.com>
Co-authored-by: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com>
Co-authored-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
Co-authored-by: xiaodong hu <32903206+huseratgithub@users.noreply.github.com>
Co-authored-by: mint570 <70396898+mint570@users.noreply.github.com>
Co-authored-by: Deepak Singhal <115033986+deepak-singhal0408@users.noreply.github.com>
Co-authored-by: KISHORE KUNAL <64033340+kishorekunal01@users.noreply.github.com>
Co-authored-by: Vivek <vivekreddykarri98@gmail.com>
Co-authored-by: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com>
Co-authored-by: Saikrishna Arcot <sarcot@microsoft.com>
Co-authored-by: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com>
  • Loading branch information
1 parent 2139a2e commit 97b3432
Show file tree
Hide file tree
Showing 112 changed files with 5,291 additions and 927 deletions.
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
19 changes: 15 additions & 4 deletions cfgmgr/buffer_pool_mellanox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ local function iterate_profile_list(all_items)
return 0
end

local function fetch_buffer_pool_size_from_appldb()
local function fetch_buffer_pool_size_from_appldb(shp_enabled)
local buffer_pools = {}
redis.call('SELECT', config_db)
local buffer_pool_keys = redis.call('KEYS', 'BUFFER_POOL|*')
Expand All @@ -158,7 +158,18 @@ local function fetch_buffer_pool_size_from_appldb()
end
xoff = redis.call('HGET', 'BUFFER_POOL_TABLE:' .. buffer_pools[i], 'xoff')
if not xoff then
table.insert(result, buffer_pools[i] .. ':' .. size)
if shp_enabled and size == "0" and buffer_pools[i] == "ingress_lossless_pool" then
-- During initialization, if SHP is enabled
-- 1. the buffer pool sizes, xoff have initialized to 0, which means the shared headroom pool is disabled
-- 2. but the buffer profiles already indicate the shared headroom pool is enabled
-- 3. later on the buffer pool sizes are updated with xoff being non-zero
-- In case the orchagent starts handling buffer configuration between 2 and 3,
-- It is inconsistent between buffer pools and profiles, which fails Mellanox SAI sanity check
-- To avoid it, it indicates the shared headroom pool is enabled by setting a very small buffer pool and shared headroom pool sizes
table.insert(result, buffer_pools[i] .. ':2048:1024')
else
table.insert(result, buffer_pools[i] .. ':' .. size)
end
else
table.insert(result, buffer_pools[i] .. ':' .. size .. ':' .. xoff)
end
Expand Down Expand Up @@ -295,7 +306,7 @@ local fail_count = 0
fail_count = fail_count + iterate_all_items(all_pgs, true)
fail_count = fail_count + iterate_all_items(all_tcs, false)
if fail_count > 0 then
fetch_buffer_pool_size_from_appldb()
fetch_buffer_pool_size_from_appldb(shp_enabled)
return result
end

Expand All @@ -305,7 +316,7 @@ local all_egress_profile_lists = redis.call('KEYS', 'BUFFER_PORT_EGRESS_PROFILE_
fail_count = fail_count + iterate_profile_list(all_ingress_profile_lists)
fail_count = fail_count + iterate_profile_list(all_egress_profile_lists)
if fail_count > 0 then
fetch_buffer_pool_size_from_appldb()
fetch_buffer_pool_size_from_appldb(shp_enabled)
return result
end

Expand Down
35 changes: 17 additions & 18 deletions cfgmgr/buffermgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,24 +549,23 @@ void BufferMgr::doTask(Consumer &consumer)
task_status = doSpeedUpdateTask(port);
}
}

switch (task_status)
{
case task_process_status::task_failed:
SWSS_LOG_ERROR("Failed to process table update");
return;
case task_process_status::task_need_retry:
SWSS_LOG_INFO("Unable to process table update. Will retry...");
++it;
break;
case task_process_status::task_invalid_entry:
SWSS_LOG_ERROR("Failed to process invalid entry, drop it");
it = consumer.m_toSync.erase(it);
break;
default:
it = consumer.m_toSync.erase(it);
break;
}
}
switch (task_status)
{
case task_process_status::task_failed:
SWSS_LOG_ERROR("Failed to process table update");
return;
case task_process_status::task_need_retry:
SWSS_LOG_INFO("Unable to process table update. Will retry...");
++it;
break;
case task_process_status::task_invalid_entry:
SWSS_LOG_ERROR("Failed to process invalid entry, drop it");
it = consumer.m_toSync.erase(it);
break;
default:
it = consumer.m_toSync.erase(it);
break;
}
}
}
10 changes: 6 additions & 4 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 @@ -293,15 +294,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
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
4 changes: 2 additions & 2 deletions cfgmgr/fabricmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ bool FabricMgr::writeConfigToAppDb(const std::string &key, const std::string &fi
if (key == "FABRIC_MONITOR_DATA")
{
m_appFabricMonitorTable.set(key, fvs);
SWSS_LOG_NOTICE("Write FABRIC_MONITOR:%s %s to %s", key.c_str(), field.c_str(), value.c_str());
SWSS_LOG_INFO("Write FABRIC_MONITOR:%s %s to %s", key.c_str(), field.c_str(), value.c_str());
}
else
{
m_appFabricPortTable.set(key, fvs);
SWSS_LOG_NOTICE("Write FABRIC_PORT:%s %s to %s", key.c_str(), field.c_str(), value.c_str());
SWSS_LOG_INFO("Write FABRIC_PORT:%s %s to %s", key.c_str(), field.c_str(), value.c_str());
}

return true;
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
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ if test "x$asan_enabled" = "xtrue"; then
CFLAGS_ASAN+=" -fsanitize=address"
CFLAGS_ASAN+=" -DASAN_ENABLED"
CFLAGS_ASAN+=" -ggdb -fno-omit-frame-pointer -U_FORTIFY_SOURCE"
CFLAGS_ASAN+=" -Wno-maybe-uninitialized"
AC_SUBST(CFLAGS_ASAN)

LDFLAGS_ASAN+=" -lasan"
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 orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,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
6 changes: 6 additions & 0 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
6 changes: 4 additions & 2 deletions orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,10 @@ task_process_status BufferOrch::processQueue(KeyOpFieldsValuesTuple &tuple)
return handle_status;
}
}
// create/remove a port queue counter for the queue buffer
else
// create/remove a port queue counter for the queue buffer.
// For VOQ chassis, flexcounterorch adds the Queue Counters for all egress and VOQ queues of all front panel and system ports
// to the FLEX_COUNTER_DB irrespective of BUFFER_QUEUE configuration. So Port Queue counter needs to be updated only for non VOQ switch.
else if (gMySwitchType != "voq")
{
auto flexCounterOrch = gDirectory.get<FlexCounterOrch*>();
auto queues = tokens[1];
Expand Down
43 changes: 43 additions & 0 deletions orchagent/bulker.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ static inline bool operator==(const sai_inseg_entry_t& a, const sai_inseg_entry_
;
}

static inline bool operator==(const sai_neighbor_entry_t& a, const sai_neighbor_entry_t& b)
{
return a.switch_id == b.switch_id
&& a.rif_id == b.rif_id
&& a.ip_address == b.ip_address
;
}

static inline bool operator==(const sai_inbound_routing_entry_t& a, const sai_inbound_routing_entry_t& b)
{
return a.switch_id == b.switch_id
Expand Down Expand Up @@ -203,6 +211,19 @@ namespace std
}
};

template <>
struct hash<sai_neighbor_entry_t>
{
size_t operator()(const sai_neighbor_entry_t& a) const noexcept
{
size_t seed = 0;
boost::hash_combine(seed, a.switch_id);
boost::hash_combine(seed, a.rif_id);
boost::hash_combine(seed, a.ip_address);
return seed;
}
};

template <>
struct hash<sai_outbound_ca_to_pa_entry_t>
{
Expand Down Expand Up @@ -334,6 +355,19 @@ struct SaiBulkerTraits<sai_mpls_api_t>
using bulk_set_entry_attribute_fn = sai_bulk_set_inseg_entry_attribute_fn;
};

template<>
struct SaiBulkerTraits<sai_neighbor_api_t>
{
using entry_t = sai_neighbor_entry_t;
using api_t = sai_neighbor_api_t;
using create_entry_fn = sai_create_neighbor_entry_fn;
using remove_entry_fn = sai_remove_neighbor_entry_fn;
using set_entry_attribute_fn = sai_set_neighbor_entry_attribute_fn;
using bulk_create_entry_fn = sai_bulk_create_neighbor_entry_fn;
using bulk_remove_entry_fn = sai_bulk_remove_neighbor_entry_fn;
using bulk_set_entry_attribute_fn = sai_bulk_set_neighbor_entry_attribute_fn;
};

template<>
struct SaiBulkerTraits<sai_dash_vnet_api_t>
{
Expand Down Expand Up @@ -811,6 +845,15 @@ inline EntityBulker<sai_mpls_api_t>::EntityBulker(sai_mpls_api_t *api, size_t ma
set_entries_attribute = api->set_inseg_entries_attribute;
}

template <>
inline EntityBulker<sai_neighbor_api_t>::EntityBulker(sai_neighbor_api_t *api, size_t max_bulk_size) :
max_bulk_size(max_bulk_size)
{
create_entries = api->create_neighbor_entries;
remove_entries = api->remove_neighbor_entries;
set_entries_attribute = api->set_neighbor_entries_attribute;
}

template <>
inline EntityBulker<sai_dash_inbound_routing_api_t>::EntityBulker(sai_dash_inbound_routing_api_t *api, size_t max_bulk_size) : max_bulk_size(max_bulk_size)
{
Expand Down
Loading

0 comments on commit 97b3432

Please sign in to comment.