Skip to content

Commit

Permalink
change vlan_id to bv_id for fdb flush notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
lguohan committed Feb 9, 2018
1 parent dcf5adb commit ee06811
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions syncd/syncd_notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void redisPutFdbEntryToAsicView(

if (fdb->event_type == SAI_FDB_EVENT_FLUSHED)
{
sai_vlan_id_t vlan_id = fdb->fdb_entry.vlan_id;
sai_object_id_t bv_id = fdb->fdb_entry.bv_id;
sai_object_id_t port_oid = 0;
bool port_oid_found = false;

Expand All @@ -123,18 +123,16 @@ void redisPutFdbEntryToAsicView(
return;
}

if (!port_oid && !vlan_id)
if (!port_oid && !bv_id)
{
/* we got a flush all fdb event here */
/* example of a flush all fdb event */
/*
[{
"fdb_entry":"{
\"bridge_id\":\"oid:0x0\",
\"bridge_type\":\"SAI_FDB_ENTRY_BRIDGE_TYPE_1Q\",
\"bv_id\":\"oid:0x0\",
\"mac\":\"00:00:00:00:00:00\",
\"switch_id\":\"oid:0x21000000000000\",
\"vlan\":\"0\"}",
\"switch_id\":\"oid:0x21000000000000\"}",
"fdb_event":"SAI_FDB_EVENT_FLUSHED",
"list":[
{"id":"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID","value":"oid:0x0"},
Expand Down Expand Up @@ -164,19 +162,17 @@ void redisPutFdbEntryToAsicView(
}
}
}
else if( port_oid && !vlan_id )
else if (port_oid && !bv_id)
{
/* we got a flush port fdb event here */
/* not supported yet, this is a place holder */
/* example of a flush port fdb event */
/*
[{
"fdb_entry":"{
\"bridge_id\":\"oid:0x0\",
\"bridge_type\":\"SAI_FDB_ENTRY_BRIDGE_TYPE_1Q\",
\"bv_id\":\"oid:0x0\",
\"mac\":\"00:00:00:00:00:00\",
\"switch_id\":\"oid:0x21000000000000\",
\"vlan\":\"0\"}",
\"switch_id\":\"oid:0x21000000000000\"}",
"fdb_event":"SAI_FDB_EVENT_FLUSHED",
"list":[
{"id":"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID","value":"oid:0x3a0000000009cf"},
Expand All @@ -185,21 +181,19 @@ void redisPutFdbEntryToAsicView(
]
}]
*/
SWSS_LOG_ERROR("received a flush port fdb event, port_oid = %lu, vlan_id = %hd, unsupported", port_oid, vlan_id);
SWSS_LOG_ERROR("received a flush port fdb event, port_oid = 0x%lx, bv_id = 0x%lx, unsupported", port_oid, bv_id);
}
else if(!port_oid && vlan_id)
else if (!port_oid && bv_id)
{
/* we got a flush vlan fdb event here */
/* not supported yet, this is a place holder */
/* example of a flush vlan event */
/*
[{
"fdb_entry":"{
\"bridge_id\":\"oid:0x0\",
\"bridge_type\":\"SAI_FDB_ENTRY_BRIDGE_TYPE_1Q\",
\"bridge_id\":\"oid:0x23000000000000\",
\"mac\":\"00:00:00:00:00:00\",
\"switch_id\":\"oid:0x21000000000000\",
\"vlan\":\"1000\"}",
\"switch_id\":\"oid:0x21000000000000\"}",
"fdb_event":"SAI_FDB_EVENT_FLUSHED",
"list":[
{"id":"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID","value":"oid:0x0"},
Expand All @@ -208,12 +202,12 @@ void redisPutFdbEntryToAsicView(
]
}]
*/
SWSS_LOG_ERROR("received a flush vlan fdb event, port_oid = %lu, vlan_id = %hd, unsupported", port_oid, vlan_id);
SWSS_LOG_ERROR("received a flush vlan fdb event, port_oid = 0x%lx, bv_id = 0x%lx, unsupported", port_oid, bv_id);

}
else
{
SWSS_LOG_ERROR("received a flush fdb event, port_oid = %lu, vlan_id = %hd, unsupported", port_oid, vlan_id);
SWSS_LOG_ERROR("received a flush fdb event, port_oid = 0x%lx, bv_id = 0x%lx, unsupported", port_oid, bv_id);
}

return;
Expand Down

0 comments on commit ee06811

Please sign in to comment.