@@ -27,7 +27,6 @@ using namespace swss;
27
27
#define VLAN_DRV_NAME " bridge"
28
28
#define TEAM_DRV_NAME " team"
29
29
30
- const string MGMT_PREFIX = " eth" ;
31
30
const string INTFS_PREFIX = " Ethernet" ;
32
31
const string LAG_PREFIX = " PortChannel" ;
33
32
@@ -38,57 +37,11 @@ extern string g_switchType;
38
37
LinkSync::LinkSync (DBConnector *appl_db, DBConnector *state_db) :
39
38
m_portTableProducer(appl_db, APP_PORT_TABLE_NAME),
40
39
m_portTable(appl_db, APP_PORT_TABLE_NAME),
41
- m_statePortTable(state_db, STATE_PORT_TABLE_NAME),
42
- m_stateMgmtPortTable(state_db, STATE_MGMT_PORT_TABLE_NAME)
40
+ m_statePortTable(state_db, STATE_PORT_TABLE_NAME)
43
41
{
44
42
std::shared_ptr<struct if_nameindex > if_ni (if_nameindex (), if_freenameindex);
45
43
struct if_nameindex *idx_p;
46
44
47
- for (idx_p = if_ni.get ();
48
- idx_p != NULL && idx_p->if_index != 0 && idx_p->if_name != NULL ;
49
- idx_p++)
50
- {
51
- string key = idx_p->if_name ;
52
-
53
- /* Explicitly store management ports oper status into the state database.
54
- * This piece of information is used by SNMP. */
55
- if (!key.compare (0 , MGMT_PREFIX.length (), MGMT_PREFIX))
56
- {
57
- ostringstream cmd;
58
- string res;
59
- cmd << " cat /sys/class/net/" << shellquote (key) << " /operstate" ;
60
- try
61
- {
62
- EXEC_WITH_ERROR_THROW (cmd.str (), res);
63
- }
64
- catch (...)
65
- {
66
- SWSS_LOG_WARN (" Failed to get %s oper status" , key.c_str ());
67
- continue ;
68
- }
69
-
70
- /* Remove the trailing newline */
71
- if (res.length () >= 1 && res.at (res.length () - 1 ) == ' \n ' )
72
- {
73
- res.erase (res.length () - 1 );
74
- /* The value of operstate will be either up or down */
75
- if (res != " up" && res != " down" )
76
- {
77
- SWSS_LOG_WARN (" Unknown %s oper status %s" ,
78
- key.c_str (), res.c_str ());
79
- }
80
- FieldValueTuple fv (" oper_status" , res);
81
- vector<FieldValueTuple> fvs;
82
- fvs.push_back (fv);
83
-
84
- m_stateMgmtPortTable.set (key, fvs);
85
- SWSS_LOG_INFO (" Store %s oper status %s to state DB" ,
86
- key.c_str (), res.c_str ());
87
- }
88
- continue ;
89
- }
90
- }
91
-
92
45
if (!WarmStart::isWarmStart ())
93
46
{
94
47
/* See the comments for g_portSet in portsyncd.cpp */
@@ -168,8 +121,7 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
168
121
string key = rtnl_link_get_name (link );
169
122
170
123
if (key.compare (0 , INTFS_PREFIX.length (), INTFS_PREFIX) &&
171
- key.compare (0 , LAG_PREFIX.length (), LAG_PREFIX) &&
172
- key.compare (0 , MGMT_PREFIX.length (), MGMT_PREFIX))
124
+ key.compare (0 , LAG_PREFIX.length (), LAG_PREFIX))
173
125
{
174
126
return ;
175
127
}
@@ -197,17 +149,6 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
197
149
nlmsg_type, key.c_str (), admin, oper, addrStr, ifindex, master);
198
150
}
199
151
200
- if (!key.compare (0 , MGMT_PREFIX.length (), MGMT_PREFIX))
201
- {
202
- FieldValueTuple fv (" oper_status" , oper ? " up" : " down" );
203
- vector<FieldValueTuple> fvs;
204
- fvs.push_back (fv);
205
- m_stateMgmtPortTable.set (key, fvs);
206
- SWSS_LOG_INFO (" Store %s oper status %s to state DB" ,
207
- key.c_str (), oper ? " up" : " down" );
208
- return ;
209
- }
210
-
211
152
/* teamd instances are dealt in teamsyncd */
212
153
if (type && !strcmp (type, TEAM_DRV_NAME))
213
154
{
0 commit comments