Skip to content

Commit

Permalink
Merge branch 'master' into readd-supported-fecs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenxs authored Jul 29, 2022
2 parents 122579f + 3161eaa commit 84a32e2
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 7 deletions.
18 changes: 17 additions & 1 deletion orchagent/intfsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ void IntfsOrch::doTask(Consumer &consumer)

if(table_name == CHASSIS_APP_SYSTEM_INTERFACE_TABLE_NAME)
{
if(!isRemoteSystemPortIntf(alias))
if(isLocalSystemPortIntf(alias))
{
//Synced local interface. Skip
it = consumer.m_toSync.erase(it);
Expand Down Expand Up @@ -1623,6 +1623,22 @@ bool IntfsOrch::isRemoteSystemPortIntf(string alias)
return false;
}

bool IntfsOrch::isLocalSystemPortIntf(string alias)
{
Port port;
if(gPortsOrch->getPort(alias, port))
{
if (port.m_type == Port::LAG)
{
return(port.m_system_lag_info.switch_id == gVoqMySwitchId);
}

return(port.m_system_port_info.type != SAI_SYSTEM_PORT_TYPE_REMOTE);
}
//Given alias is system port alias of the local port/LAG
return false;
}

void IntfsOrch::voqSyncAddIntf(string &alias)
{
//Sync only local interface. Confirm for the local interface and
Expand Down
1 change: 1 addition & 0 deletions orchagent/intfsorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class IntfsOrch : public Orch
bool updateSyncdIntfPfx(const string &alias, const IpPrefix &ip_prefix, bool add = true);

bool isRemoteSystemPortIntf(string alias);
bool isLocalSystemPortIntf(string alias);

private:

Expand Down
2 changes: 1 addition & 1 deletion orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ void NeighOrch::doVoqSystemNeighTask(Consumer &consumer)

string alias = key.substr(0, found);

if(!gIntfsOrch->isRemoteSystemPortIntf(alias))
if(gIntfsOrch->isLocalSystemPortIntf(alias))
{
//Synced local neighbor. Skip
it = consumer.m_toSync.erase(it);
Expand Down
4 changes: 4 additions & 0 deletions orchagent/p4orch/tests/fake_portorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,3 +690,7 @@ std::unordered_set<std::string> PortsOrch::generateCounterStats(const string &ty
{
return {};
}

void PortsOrch::doTask(swss::SelectableTimer &timer)
{
}
7 changes: 7 additions & 0 deletions orchagent/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Port
uint32_t m_speed = 0; // Mbps
std::string m_learn_mode = "hardware";
AutoNegMode m_autoneg = Port::AutoNegMode::AUTONEG_NOT_SET;
int m_link_training = -1; // -1 means not set, 0 = disabled, 1 = enabled
bool m_admin_state_up = false;
bool m_init = false;
bool m_l3_vni = false;
Expand Down Expand Up @@ -177,8 +178,14 @@ class Port
sai_object_id_t m_system_side_id = 0;
sai_object_id_t m_line_side_id = 0;

/* pre-emphasis */
std::map<sai_port_serdes_attr_t, std::vector<uint32_t>> m_preemphasis;

bool m_fec_cfg = false;
bool m_an_cfg = false;

int m_cap_an = -1; /* Capability - AutoNeg, -1 means not set */
int m_cap_lt = -1; /* Capability - LinkTraining, -1 means not set */
};

}
Expand Down
Loading

0 comments on commit 84a32e2

Please sign in to comment.