Skip to content

Commit

Permalink
[portsorch]: Remove m_ifindex from Port class (sonic-net#624)
Browse files Browse the repository at this point in the history
ifindex is never used by orchagent and orchagent shall be
ignorant to this value.

Signed-off-by: Shu0T1an ChenG <[email protected]>
  • Loading branch information
Shuotian Cheng authored and lguohan committed Sep 19, 2018
1 parent e765c12 commit 54a7c9a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion orchagent/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class Port
std::string m_alias;
Type m_type;
int m_index = 0; // PHY_PORT: index
int m_ifindex = 0;
uint32_t m_mtu = DEFAULT_MTU;
uint32_t m_speed = 0; // Mbps
bool m_autoneg = 0;
Expand Down
10 changes: 0 additions & 10 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2235,16 +2235,6 @@ bool PortsOrch::initializePort(Port &p)
/* Create host interface */
addHostIntfs(p, p.m_alias, p.m_hif_id);

#if 0
// TODO: Assure if_nametoindex(p.m_alias.c_str()) != 0
p.m_ifindex = if_nametoindex(p.m_alias.c_str());
if (p.m_ifindex == 0)
{
SWSS_LOG_ERROR("Failed to get netdev index alias:%s", p.m_alias.c_str());
return false;
}
#endif

/* Check warm start states */
vector<FieldValueTuple> tuples;
bool exist = m_portTable->get(p.m_alias, tuples);
Expand Down

0 comments on commit 54a7c9a

Please sign in to comment.