Skip to content

Commit f7f5786

Browse files
author
vedganes
committed
[inbandif]VOQ Inband intf support - code review comments fix - 1
Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com> Fixed code review comments: - Added comment to delInbandNeighbor() to indicate this is for local inband interface - Used hardcoded "Inband" prefix - Reverted to net dev link up event detection using IFF_LOWER_UP flag - Renamed "oper_status" of net dev to "netdev_oper_status" in the state db PORT_TABLE.
1 parent af971bc commit f7f5786

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

cfgmgr/nbrmgr.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ bool NbrMgr::isIntfOperUp(const string &alias)
422422
{
423423
string oper;
424424

425-
if (m_statePortTable.hget(alias, "oper_status", oper))
425+
if (m_statePortTable.hget(alias, "netdev_oper_status", oper))
426426
{
427427
if (oper == "up")
428428
{
429-
SWSS_LOG_DEBUG("Intf %s is oper up", alias.c_str());
429+
SWSS_LOG_DEBUG("NetDev %s is oper up", alias.c_str());
430430
return true;
431431
}
432432
}

orchagent/neighorch.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,8 @@ bool NeighOrch::addInbandNeighbor(string alias, IpAddress ip_address)
12231223

12241224
bool NeighOrch::delInbandNeighbor(string alias, IpAddress ip_address)
12251225
{
1226-
//Remove neighbor from SAI
1226+
// Remove local inband neighbor from SAI
1227+
12271228
if(gIntfsOrch->isRemoteSystemPortIntf(alias))
12281229
{
12291230
//Remote Inband interface. Skip

portsyncd/linksync.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ using namespace swss;
3030
const string MGMT_PREFIX = "eth";
3131
const string INTFS_PREFIX = "Ethernet";
3232
const string LAG_PREFIX = "PortChannel";
33+
const string INBAND_PREFIX = "Inband";
3334

3435
extern set<string> g_portSet;
3536
extern bool g_init;
@@ -165,18 +166,17 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
165166
struct rtnl_link *link = (struct rtnl_link *)obj;
166167
string key = rtnl_link_get_name(link);
167168

168-
vector<FieldValueTuple> temp;
169169
if (key.compare(0, INTFS_PREFIX.length(), INTFS_PREFIX) &&
170170
key.compare(0, LAG_PREFIX.length(), LAG_PREFIX) &&
171171
key.compare(0, MGMT_PREFIX.length(), MGMT_PREFIX) &&
172-
!m_portTable.get(key, temp))
172+
key.compare(0, INBAND_PREFIX.length(), INBAND_PREFIX))
173173
{
174174
return;
175175
}
176176

177177
unsigned int flags = rtnl_link_get_flags(link);
178178
bool admin = flags & IFF_UP;
179-
bool oper = flags & IFF_RUNNING;
179+
bool oper = flags & IFF_LOWER_UP;
180180

181181
char addrStr[MAX_ADDR_SIZE+1] = {0};
182182
nl_addr2str(rtnl_link_get_addr(link), addrStr, MAX_ADDR_SIZE);
@@ -248,13 +248,14 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
248248
/* front panel interfaces: Check if the port is in the PORT_TABLE
249249
* non-front panel interfaces such as eth0, lo which are not in the
250250
* PORT_TABLE are ignored. */
251+
vector<FieldValueTuple> temp;
251252
if (m_portTable.get(key, temp))
252253
{
253254
g_portSet.erase(key);
254255
FieldValueTuple tuple("state", "ok");
255256
vector<FieldValueTuple> vector;
256257
vector.push_back(tuple);
257-
FieldValueTuple op("oper_status", oper ? "up" : "down");
258+
FieldValueTuple op("netdev_oper_status", oper ? "up" : "down");
258259
vector.push_back(op);
259260
m_statePortTable.set(key, vector);
260261
SWSS_LOG_NOTICE("Publish %s(ok:%s) to state db", key.c_str(), oper ? "up" : "down");

0 commit comments

Comments
 (0)