Skip to content

Commit 54a7c9a

Browse files
Shuotian Chenglguohan
Shuotian Cheng
authored andcommitted
[portsorch]: Remove m_ifindex from Port class (sonic-net#624)
ifindex is never used by orchagent and orchagent shall be ignorant to this value. Signed-off-by: Shu0T1an ChenG <[email protected]>
1 parent e765c12 commit 54a7c9a

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

orchagent/port.h

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class Port
6464
std::string m_alias;
6565
Type m_type;
6666
int m_index = 0; // PHY_PORT: index
67-
int m_ifindex = 0;
6867
uint32_t m_mtu = DEFAULT_MTU;
6968
uint32_t m_speed = 0; // Mbps
7069
bool m_autoneg = 0;

orchagent/portsorch.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -2235,16 +2235,6 @@ bool PortsOrch::initializePort(Port &p)
22352235
/* Create host interface */
22362236
addHostIntfs(p, p.m_alias, p.m_hif_id);
22372237

2238-
#if 0
2239-
// TODO: Assure if_nametoindex(p.m_alias.c_str()) != 0
2240-
p.m_ifindex = if_nametoindex(p.m_alias.c_str());
2241-
if (p.m_ifindex == 0)
2242-
{
2243-
SWSS_LOG_ERROR("Failed to get netdev index alias:%s", p.m_alias.c_str());
2244-
return false;
2245-
}
2246-
#endif
2247-
22482238
/* Check warm start states */
22492239
vector<FieldValueTuple> tuples;
22502240
bool exist = m_portTable->get(p.m_alias, tuples);

0 commit comments

Comments
 (0)