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

[202412_RC][portsorch] Optimize port initialization #42

Open
wants to merge 3 commits into
base: 202412_RC_
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions orchagent/orch.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class Orch
virtual void doTask(swss::NotificationConsumer &consumer) { }
virtual void doTask(swss::SelectableTimer &timer) { }

virtual void onWarmBootEnd() { }

void dumpPendingTasks(std::vector<std::string> &ts);

/**
Expand Down
8 changes: 6 additions & 2 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,8 @@ void OrchDaemon::start()
*/
bool OrchDaemon::warmRestoreAndSyncUp()
{
SWSS_LOG_ENTER();

WarmStart::setWarmStartState("orchagent", WarmStart::INITIALIZED);

for (Orch *o : m_orchList)
Expand Down Expand Up @@ -990,8 +992,10 @@ bool OrchDaemon::warmRestoreAndSyncUp()

syncd_apply_view();

/* Start dynamic state sync up */
gPortsOrch->refreshPortStatus();
for (Orch *o : m_orchList)
{
o->onWarmBootEnd();
}

/*
* Note. Arp sync up is handled in neighsyncd.
Expand Down
21 changes: 6 additions & 15 deletions orchagent/p4orch/tests/fake_portorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,24 +425,11 @@ void PortsOrch::removeDefaultBridgePorts()
{
}

bool PortsOrch::initializePort(Port &port)
{
return true;
}

void PortsOrch::initializePriorityGroups(Port &port)
{
}

void PortsOrch::initializePortBufferMaximumParameters(Port &port)
{
}

void PortsOrch::initializeQueues(Port &port)
{
}

bool PortsOrch::addHostIntfs(Port &port, string alias, sai_object_id_t &host_intfs_id)
bool PortsOrch::addHostIntfs(Port &port, string alias, sai_object_id_t &host_intfs_id, bool up)
{
return true;
}
Expand Down Expand Up @@ -507,7 +494,7 @@ sai_status_t PortsOrch::removePort(sai_object_id_t port_id)
return SAI_STATUS_SUCCESS;
}

bool PortsOrch::initPort(const PortConfig &port)
bool PortsOrch::initExistingPort(const PortConfig &port)
{
return true;
}
Expand Down Expand Up @@ -707,3 +694,7 @@ std::unordered_set<std::string> PortsOrch::generateCounterStats(const vector<T>
void PortsOrch::doTask(swss::SelectableTimer &timer)
{
}

void PortsOrch::onWarmBootEnd()
{
}
7 changes: 6 additions & 1 deletion orchagent/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ extern "C" {
#include <sairedis.h>

#define DEFAULT_PORT_VLAN_ID 1

#define MAX_MACSEC_SECTAG_SIZE 32

/*
* Default MTU is derived from SAI_PORT_ATTR_MTU (1514)
* Orchagent adds extra 22 bytes for Ethernet header and FCS,
* hence setting to 1492 (1514 - 22)
*/
#define DEFAULT_MTU 1492
#define DEFAULT_MTU 1492 - MAX_MACSEC_SECTAG_SIZE

/*
* Default TPID is 8100
Expand Down Expand Up @@ -265,6 +268,8 @@ class Port
uint32_t m_suppress_threshold = 0;
uint32_t m_reuse_threshold = 0;
uint32_t m_flap_penalty = 0;

Role m_role;
};

}
Expand Down
Loading