Skip to content

Commit

Permalink
Merge branch 'master' into fix_mtu_macsec
Browse files Browse the repository at this point in the history
  • Loading branch information
Pterosaur authored Jul 30, 2022
2 parents e55a065 + 3161eaa commit e3ce7ca
Show file tree
Hide file tree
Showing 11 changed files with 589 additions and 10 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
3 changes: 1 addition & 2 deletions orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,6 @@ bool MuxOrch::handlePeerSwitch(const Request& request)

if (op == SET_COMMAND)
{
mux_peer_switch_ = peer_ip;

// Create P2P tunnel when peer_ip is available.
IpAddresses dst_ips = decap_orch_->getDstIpAddresses(MUX_TUNNEL);
if (!dst_ips.getSize())
Expand Down Expand Up @@ -1316,6 +1314,7 @@ bool MuxOrch::handlePeerSwitch(const Request& request)
}

mux_tunnel_id_ = create_tunnel(&peer_ip, &dst_ip, tc_to_dscp_map_id, tc_to_queue_map_id, dscp_mode_name);
mux_peer_switch_ = peer_ip;
SWSS_LOG_NOTICE("Mux peer ip '%s' was added, peer name '%s'",
peer_ip.to_string().c_str(), peer_name.c_str());
}
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
2 changes: 1 addition & 1 deletion orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ bool OrchDaemon::init()
* when iterating ConsumerMap. This is ensured implicitly by the order of keys in ordered map.
* For cases when Orch has to process tables in specific order, like PortsOrch during warm start, it has to override Orch::doTask()
*/
m_orchList = { gSwitchOrch, gCrmOrch, gPortsOrch, gBufferOrch, gFlowCounterRouteOrch, mux_orch, mux_cb_orch, gIntfsOrch, gNeighOrch, gNhgMapOrch, gNhgOrch, gCbfNhgOrch, gRouteOrch, gCoppOrch, gQosOrch, wm_orch, gPolicerOrch, tunnel_decap_orch, sflow_orch, gDebugCounterOrch, gMacsecOrch, gBfdOrch, gSrv6Orch};
m_orchList = { gSwitchOrch, gCrmOrch, gPortsOrch, gBufferOrch, gFlowCounterRouteOrch, gIntfsOrch, gNeighOrch, gNhgMapOrch, gNhgOrch, gCbfNhgOrch, gRouteOrch, gCoppOrch, gQosOrch, wm_orch, gPolicerOrch, tunnel_decap_orch, sflow_orch, gDebugCounterOrch, gMacsecOrch, gBfdOrch, gSrv6Orch, mux_orch, mux_cb_orch};

bool initialize_dtel = false;
if (platform == BFN_PLATFORM_SUBSTRING || platform == VS_PLATFORM_SUBSTRING)
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 e3ce7ca

Please sign in to comment.