Skip to content

Commit

Permalink
[vs] Support flush entry type all on virtual switch (sonic-net#735)
Browse files Browse the repository at this point in the history
Signed-off-by: kcudnik <kcudnik@gmail.com>
  • Loading branch information
kcudnik authored Dec 13, 2020
1 parent adb0e98 commit a1c9b7a
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions vslib/src/VirtualSwitchSaiInterfaceFdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,29 @@ bool VirtualSwitchSaiInterface::doesFdbEntryNotMatchFlushAttr(

case SAI_FDB_FLUSH_ATTR_ENTRY_TYPE:

// TODO static/dynamic/all

// remove from list all entries not matching type
if (fdb_attrs.at("SAI_FDB_ENTRY_ATTR_TYPE")->getAttr()->value.s32 != attr.value.s32)
switch (attr.value.s32)
{
return true;
case SAI_FDB_FLUSH_ENTRY_TYPE_ALL:
// if flush type is all, we accept both dynamic and static entries
break;

case SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC:

if (fdb_attrs.at("SAI_FDB_ENTRY_ATTR_TYPE")->getAttr()->value.s32 != SAI_FDB_ENTRY_TYPE_DYNAMIC)
return true;

break;

case SAI_FDB_FLUSH_ENTRY_TYPE_STATIC:

if (fdb_attrs.at("SAI_FDB_ENTRY_ATTR_TYPE")->getAttr()->value.s32 != SAI_FDB_ENTRY_TYPE_STATIC)
return true;

break;

default:

SWSS_LOG_THROW("unknown SAI_FDB_FLUSH_ATTR_ENTRY_TYPE: %d", attr.value.s32);
}

break;
Expand Down

0 comments on commit a1c9b7a

Please sign in to comment.