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

Add host_tx_ready enhancements #11

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
966c5bb
[Dash] Fix wrong table name for acl_out_table (#2911)
Pterosaur Oct 11, 2023
cb98893
Add support for SEND_TO_INGRESS port table. (#2816)
baxia-lan Oct 12, 2023
b9313df
Reducing the severity of oper fec attribute get failure (#2924)
dgsudharsan Oct 13, 2023
755b260
Fix data race in on_switch_shutdown_request() (#2931)
Yakiv-Huryk Oct 13, 2023
f31ccd0
Add refillToSync() into ConsumerBase to support warmboot. (#2866)
mint570 Oct 15, 2023
4f86f13
[FlexCounters] Fixed orchagent crash issue#2395 (#2936)
rajkumar38 Oct 23, 2023
dc8fd20
[DASH] ACL tags implementation (#2915)
oleksandrivantsiv Oct 24, 2023
a9867e6
Fix acl match ip_type_non_ipv4 and ip_type_non_ipv6. (#2842)
LGH-12 Oct 24, 2023
917c21e
Add more debug information when PFC WD is triggered (#2858)
stephenxs Oct 30, 2023
2b02c24
Send hearbeat during warm reboot freese (#2923)
liuh-80 Nov 8, 2023
51bfb4c
[muxorch] Fixing updateRoute logic (#2952)
Ndancejic Nov 9, 2023
644b227
[portsorch]: Implement port PFC asym capability check (#2942)
nazariig Nov 10, 2023
4a0bb1c
Fix maximum headroom check failure (#2948)
stephenxs Nov 16, 2023
194566a
Fix the Orchagent Qos error messages reported in Issue #16787 (#2947)
saksarav-nokia Nov 21, 2023
b8841ec
[orchagent]: Extend the SRv6Orch to support the programming of the L3…
cscarpitta Nov 22, 2023
2ca3deb
[dash] fix DASH ACL Rule protocol use-after-free (#2958)
Yakiv-Huryk Nov 22, 2023
14408ca
[Chassis][master][orchagent] : Added test case to verify WRED profile…
vmittal-msft Nov 28, 2023
f6a35e9
[gcov]: Fix directory prefix issue for (#2969)
theasianpianist Nov 29, 2023
dac3972
[coppmgrd] Fix Copp processing logic by using Producer del instead of…
vivekrnv Nov 30, 2023
9458b85
[hash]: Add ECMP/LAG hash algorithm to OA (#2953)
nazariig Nov 30, 2023
8dc0a85
Add support for new Port SI parameters in PortsOA (#2929)
tshalvi Dec 1, 2023
d839eec
Add support for fabric monitor daemon (swss part). (#2920)
jfeng-arista Dec 2, 2023
3904960
Add host_tx_ready enhancements
noaOrMlnx Aug 20, 2023
ed652f4
Fix internal CR comments
noaOrMlnx Oct 17, 2023
45242f5
Adjust warm-boot test to new flow
noaOrMlnx Nov 12, 2023
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
9 changes: 8 additions & 1 deletion cfgmgr/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LIBNL_LIBS = -lnl-genl-3 -lnl-route-3 -lnl-3
SAIMETA_LIBS = -lsaimeta -lsaimetadata -lzmq
COMMON_LIBS = -lswsscommon

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

cfgmgrdir = $(datadir)/swss

Expand Down Expand Up @@ -46,6 +46,11 @@ portmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLA
portmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
portmgrd_LDADD = $(LDFLAGS_ASAN) $(COMMON_LIBS) $(SAIMETA_LIBS)

fabricmgrd_SOURCES = fabricmgrd.cpp fabricmgr.cpp $(COMMON_ORCH_SOURCE) shellcmd.h
fabricmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
fabricmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
fabricmgrd_LDADD = $(LDFLAGS_ASAN) $(COMMON_LIBS) $(SAIMETA_LIBS)

intfmgrd_SOURCES = intfmgrd.cpp intfmgr.cpp $(top_srcdir)/lib/subintf.cpp $(COMMON_ORCH_SOURCE) shellcmd.h
intfmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
intfmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
Expand Down Expand Up @@ -110,6 +115,7 @@ natmgrd_LDADD += -lgcovpreload
coppmgrd_LDADD += -lgcovpreload
tunnelmgrd_LDADD += -lgcovpreload
macsecmgrd_LDADD += -lgcovpreload
fabricmgrd_LDADD += -lgcovpreload
endif

if ASAN_ENABLED
Expand All @@ -126,5 +132,6 @@ natmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
coppmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
tunnelmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
macsecmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
fabricmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
endif

4 changes: 2 additions & 2 deletions cfgmgr/coppmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ bool CoppMgr::isDupEntry(const std::string &key, std::vector<FieldValueTuple> &f
if ((!field_found) || (field_found && preserved_copp_it->second.compare(value)))
{
// overwrite -> delete preserved entry from copp table and set a new entry instead
m_coppTable.del(key);
m_appCoppTable.del(key);
return false;
}
}
Expand Down Expand Up @@ -415,7 +415,7 @@ CoppMgr::CoppMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, c
auto copp_it = supported_copp_keys.find(it);
if (copp_it == supported_copp_keys.end())
{
m_coppTable.del(it);
m_appCoppTable.del(it);
}
}
}
Expand Down
119 changes: 119 additions & 0 deletions cfgmgr/fabricmgr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#include "logger.h"
#include "dbconnector.h"
#include "producerstatetable.h"
#include "tokenize.h"
#include "ipprefix.h"
#include "fabricmgr.h"
#include "exec.h"
#include "shellcmd.h"
#include <swss/redisutility.h>

using namespace std;
using namespace swss;

FabricMgr::FabricMgr(DBConnector *cfgDb, DBConnector *appDb, const vector<string> &tableNames) :
Orch(cfgDb, tableNames),
m_cfgFabricMonitorTable(cfgDb, CFG_FABRIC_MONITOR_DATA_TABLE_NAME),
m_cfgFabricPortTable(cfgDb, CFG_FABRIC_MONITOR_PORT_TABLE_NAME),
m_appFabricMonitorTable(appDb, APP_FABRIC_MONITOR_DATA_TABLE_NAME),
m_appFabricPortTable(appDb, APP_FABRIC_MONITOR_PORT_TABLE_NAME)
{
}

void FabricMgr::doTask(Consumer &consumer)
{
SWSS_LOG_ENTER();

auto table = consumer.getTableName();

auto it = consumer.m_toSync.begin();
while (it != consumer.m_toSync.end())
{
KeyOpFieldsValuesTuple t = it->second;

string key = kfvKey(t);
string op = kfvOp(t);

if (op == SET_COMMAND)
{

string monErrThreshCrcCells, monErrThreshRxCells;
string monPollThreshRecovery, monPollThreshIsolation;
string isolateStatus;
string alias, lanes;
std::vector<FieldValueTuple> field_values;
string value;

for (auto i : kfvFieldsValues(t))
{
if (fvField(i) == "monErrThreshCrcCells")
{
monErrThreshCrcCells = fvValue(i);
writeConfigToAppDb(key, "monErrThreshCrcCells", monErrThreshCrcCells);
}
else if (fvField(i) == "monErrThreshRxCells")
{
monErrThreshRxCells = fvValue(i);
writeConfigToAppDb(key, "monErrThreshRxCells", monErrThreshRxCells);
}
else if (fvField(i) == "monPollThreshRecovery")
{
monPollThreshRecovery = fvValue(i);
writeConfigToAppDb(key, "monPollThreshRecovery", monPollThreshRecovery);
}
else if (fvField(i) == "monPollThreshIsolation")
{
monPollThreshIsolation = fvValue(i);
writeConfigToAppDb(key, "monPollThreshIsolation", monPollThreshIsolation);
}
else if (fvField(i) == "alias")
{
alias = fvValue(i);
writeConfigToAppDb(key, "alias", alias);
}
else if (fvField(i) == "lanes")
{
lanes = fvValue(i);
writeConfigToAppDb(key, "lanes", lanes);
}
else if (fvField(i) == "isolateStatus")
{
isolateStatus = fvValue(i);
writeConfigToAppDb(key, "isolateStatus", isolateStatus);
}
else
{
field_values.emplace_back(i);
}
}

for (auto &entry : field_values)
{
writeConfigToAppDb(key, fvField(entry), fvValue(entry));
}

}
it = consumer.m_toSync.erase(it);
}
}

bool FabricMgr::writeConfigToAppDb(const std::string &key, const std::string &field, const std::string &value)
{
vector<FieldValueTuple> fvs;
FieldValueTuple fv(field, value);
fvs.push_back(fv);
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());
}
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());
}

return true;
}


30 changes: 30 additions & 0 deletions cfgmgr/fabricmgr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

#include "dbconnector.h"
#include "orch.h"
#include "producerstatetable.h"

#include <map>
#include <set>
#include <string>

namespace swss {


class FabricMgr : public Orch
{
public:
FabricMgr(DBConnector *cfgDb, DBConnector *appDb, const std::vector<std::string> &tableNames);

using Orch::doTask;
private:
Table m_cfgFabricMonitorTable;
Table m_cfgFabricPortTable;
Table m_appFabricMonitorTable;
Table m_appFabricPortTable;

void doTask(Consumer &consumer);
bool writeConfigToAppDb(const std::string &alias, const std::string &field, const std::string &value);
};

}
73 changes: 73 additions & 0 deletions cfgmgr/fabricmgrd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#include <fstream>
#include <iostream>
#include <mutex>
#include <unistd.h>
#include <vector>

#include "exec.h"
#include "fabricmgr.h"
#include "schema.h"
#include "select.h"

using namespace std;
using namespace swss;

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

int main(int argc, char **argv)
{
Logger::linkToDbNative("fabricmgrd");
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE("--- Starting fabricmgrd ---");

try
{
vector<string> cfg_fabric_tables = {
CFG_FABRIC_MONITOR_DATA_TABLE_NAME,
CFG_FABRIC_MONITOR_PORT_TABLE_NAME,
};

DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);

FabricMgr fabricmgr(&cfgDb, &appDb, cfg_fabric_tables);

// TODO: add tables in stateDB which interface depends on to monitor list
vector<Orch *> cfgOrchList = {&fabricmgr};

swss::Select s;
for (Orch *o : cfgOrchList)
{
s.addSelectables(o->getSelectables());
}

while (true)
{
Selectable *sel;
int ret;

ret = s.select(&sel, SELECT_TIMEOUT);
if (ret == Select::ERROR)
{
SWSS_LOG_NOTICE("Error: %s!", strerror(errno));
continue;
}
if (ret == Select::TIMEOUT)
{
fabricmgr.doTask();
continue;
}

auto *c = (Executor *)sel;
c->execute();
}
}
catch (const exception &e)
{
SWSS_LOG_ERROR("Runtime error: %s", e.what());
}
return -1;
}

42 changes: 41 additions & 1 deletion cfgmgr/portmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ using namespace swss;
PortMgr::PortMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames) :
Orch(cfgDb, tableNames),
m_cfgPortTable(cfgDb, CFG_PORT_TABLE_NAME),
m_cfgSendToIngressPortTable(cfgDb, CFG_SEND_TO_INGRESS_PORT_TABLE_NAME),
m_cfgLagMemberTable(cfgDb, CFG_LAG_MEMBER_TABLE_NAME),
m_statePortTable(stateDb, STATE_PORT_TABLE_NAME),
m_appSendToIngressPortTable(appDb, APP_SEND_TO_INGRESS_PORT_TABLE_NAME),
m_appPortTable(appDb, APP_PORT_TABLE_NAME)
{
}
Expand Down Expand Up @@ -93,11 +95,49 @@ bool PortMgr::isPortStateOk(const string &alias)
return false;
}

void PortMgr::doSendToIngressPortTask(Consumer &consumer)
{
SWSS_LOG_ENTER();
auto it = consumer.m_toSync.begin();
while (it != consumer.m_toSync.end())
{
KeyOpFieldsValuesTuple t = it->second;

string alias = kfvKey(t);
string op = kfvOp(t);
auto fvs = kfvFieldsValues(t);

if (op == SET_COMMAND)
{
SWSS_LOG_NOTICE("Add SendToIngress Port: %s",
alias.c_str());
m_appSendToIngressPortTable.set(alias, fvs);
}
else if (op == DEL_COMMAND)
{
SWSS_LOG_NOTICE("Removing SendToIngress Port: %s",
alias.c_str());
m_appSendToIngressPortTable.del(alias);
}
else
{
SWSS_LOG_ERROR("Unknown operation type %s", op.c_str());
}
it = consumer.m_toSync.erase(it);
}

}

void PortMgr::doTask(Consumer &consumer)
{
SWSS_LOG_ENTER();

auto table = consumer.getTableName();
if (table == CFG_SEND_TO_INGRESS_PORT_TABLE_NAME)
{
doSendToIngressPortTask(consumer);
return;
}

auto it = consumer.m_toSync.begin();
while (it != consumer.m_toSync.end())
Expand Down Expand Up @@ -146,7 +186,7 @@ void PortMgr::doTask(Consumer &consumer)
{
admin_status = fvValue(i);
}
else
else
{
field_values.emplace_back(i);
}
Expand Down
3 changes: 3 additions & 0 deletions cfgmgr/portmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ class PortMgr : public Orch
using Orch::doTask;
private:
Table m_cfgPortTable;
Table m_cfgSendToIngressPortTable;
Table m_cfgLagMemberTable;
Table m_statePortTable;
ProducerStateTable m_appPortTable;
ProducerStateTable m_appSendToIngressPortTable;

std::set<std::string> m_portList;

void doTask(Consumer &consumer);
void doSendToIngressPortTask(Consumer &consumer);
bool writeConfigToAppDb(const std::string &alias, const std::string &field, const std::string &value);
bool writeConfigToAppDb(const std::string &alias, std::vector<FieldValueTuple> &field_values);
bool setPortMtu(const std::string &alias, const std::string &mtu);
Expand Down
1 change: 1 addition & 0 deletions cfgmgr/portmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ int main(int argc, char **argv)
{
vector<string> cfg_port_tables = {
CFG_PORT_TABLE_NAME,
CFG_SEND_TO_INGRESS_PORT_TABLE_NAME,
};

DBConnector cfgDb("CONFIG_DB", 0);
Expand Down
3 changes: 3 additions & 0 deletions orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ orchagent_SOURCES = \
mplsrouteorch.cpp \
neighorch.cpp \
intfsorch.cpp \
port/port_capabilities.cpp \
port/porthlpr.cpp \
portsorch.cpp \
fabricportsorch.cpp \
Expand Down Expand Up @@ -110,6 +111,8 @@ orchagent_SOURCES = \
dash/dashrouteorch.cpp \
dash/dashvnetorch.cpp \
dash/dashaclorch.cpp \
dash/dashaclgroupmgr.cpp \
dash/dashtagmgr.cpp \
dash/pbutils.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
Expand Down
Loading