Skip to content

Commit 7c7c451

Browse files
authored
Revert recirc port change (sonic-net#1813)
Recirc port support has been added to recent versions of DNX SAI. The earlier special handling for recirc port is not required anymore and thus reverted.
1 parent 5528ebf commit 7c7c451

File tree

2 files changed

+5
-90
lines changed

2 files changed

+5
-90
lines changed

orchagent/portsorch.cpp

+5-89
Original file line numberDiff line numberDiff line change
@@ -2235,11 +2235,6 @@ bool PortsOrch::initPort(const string &alias, const string &role, const int inde
22352235
{
22362236
SWSS_LOG_ENTER();
22372237

2238-
if (role == "Rec" || role == "Inb")
2239-
{
2240-
return doProcessRecircPort(alias, role, lane_set, SET_COMMAND);
2241-
}
2242-
22432238
/* Determine if the lane combination exists in switch */
22442239
if (m_portListLaneMap.find(lane_set) != m_portListLaneMap.end())
22452240
{
@@ -2294,6 +2289,11 @@ bool PortsOrch::initPort(const string &alias, const string &role, const int inde
22942289

22952290
m_portList[alias].m_init = true;
22962291

2292+
if (role == "Rec" || role == "Inb")
2293+
{
2294+
m_recircPortRole[alias] = role;
2295+
}
2296+
22972297
SWSS_LOG_NOTICE("Initialized port %s", alias.c_str());
22982298
}
22992299
else
@@ -2756,16 +2756,6 @@ void PortsOrch::doPortTask(Consumer &consumer)
27562756
}
27572757
else
27582758
{
2759-
/* Skip configuring recirc port for now because the current SAI implementation of some vendors
2760-
* have limiited support for recirc port. This check can be removed once SAI implementation
2761-
* is enhanced/changed in the future.
2762-
*/
2763-
if (m_recircPortRole.find(alias) != m_recircPortRole.end())
2764-
{
2765-
it = consumer.m_toSync.erase(it);
2766-
continue;
2767-
}
2768-
27692759
if (!an_str.empty())
27702760
{
27712761
if (autoneg_mode_map.find(an_str) == autoneg_mode_map.end())
@@ -5955,80 +5945,6 @@ bool PortsOrch::getRecircPort(Port &port, string role)
59555945
return false;
59565946
}
59575947

5958-
bool PortsOrch::doProcessRecircPort(string alias, string role, set<int> lane_set, string op)
5959-
{
5960-
SWSS_LOG_ENTER();
5961-
5962-
if (op == SET_COMMAND)
5963-
{
5964-
if (m_recircPortRole.find(alias) != m_recircPortRole.end())
5965-
{
5966-
SWSS_LOG_DEBUG("Recirc port %s already added", alias.c_str());
5967-
return true;
5968-
}
5969-
5970-
/* Find pid of recirc port */
5971-
sai_object_id_t port_id = SAI_NULL_OBJECT_ID;
5972-
if (m_portListLaneMap.find(lane_set) != m_portListLaneMap.end())
5973-
{
5974-
port_id = m_portListLaneMap[lane_set];
5975-
}
5976-
5977-
if (port_id == SAI_NULL_OBJECT_ID)
5978-
{
5979-
SWSS_LOG_ERROR("Failed to find port id for recirc port %s", alias.c_str());
5980-
return false;
5981-
}
5982-
5983-
Port p(alias, Port::PHY);
5984-
p.m_port_id = port_id;
5985-
p.m_init = true;
5986-
m_recircPortRole[alias] = role;
5987-
setPort(alias, p);
5988-
5989-
string lane_str = "";
5990-
for (auto lane : lane_set)
5991-
{
5992-
lane_str += to_string(lane) + " ";
5993-
}
5994-
SWSS_LOG_NOTICE("Added recirc port %s, pid:%" PRIx64 " lanes:%s",
5995-
alias.c_str(), port_id, lane_str.c_str());
5996-
5997-
/* Create host intf for recirc port */
5998-
if(addHostIntfs(p, p.m_alias, p.m_hif_id))
5999-
{
6000-
SWSS_LOG_NOTICE("Created host intf for recycle port %s", p.m_alias.c_str());
6001-
}
6002-
else
6003-
{
6004-
SWSS_LOG_ERROR("Failed to Create host intf for recirc port %s", p.m_alias.c_str());
6005-
}
6006-
6007-
if(setHostIntfsOperStatus(p, true))
6008-
{
6009-
SWSS_LOG_NOTICE("Set host intf oper status UP for recirc port %s", p.m_alias.c_str());
6010-
}
6011-
else
6012-
{
6013-
SWSS_LOG_ERROR("Failed to set host intf oper status for recirc port %s", p.m_alias.c_str());
6014-
}
6015-
6016-
PortUpdate update = { p, true };
6017-
notify(SUBJECT_TYPE_PORT_CHANGE, static_cast<void *>(&update));
6018-
return true;
6019-
}
6020-
else if (op == DEL_COMMAND)
6021-
{
6022-
SWSS_LOG_ERROR("Delete recirc port is not supported.");
6023-
return false;
6024-
}
6025-
else
6026-
{
6027-
SWSS_LOG_ERROR("Unknown operation type %s", op.c_str());
6028-
return false;
6029-
}
6030-
}
6031-
60325948
bool PortsOrch::addSystemPorts()
60335949
{
60345950
vector<string> keys;

orchagent/portsorch.h

-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ class PortsOrch : public Orch, public Subject
324324
bool initGearboxPort(Port &port);
325325

326326
map<string, string> m_recircPortRole;
327-
bool doProcessRecircPort(string alias, string role, set<int> laneSet, string op);
328327

329328
//map key is tuple of <attached_switch_id, core_index, core_port_index>
330329
map<tuple<int, int, int>, sai_object_id_t> m_systemPortOidMap;

0 commit comments

Comments
 (0)