Skip to content

Commit

Permalink
[Fdbsyncd] Adding extern_learn flag with fdb entry so Kernel doesn't …
Browse files Browse the repository at this point in the history
…age out

What I did
extern_learn flag is added while programming the fdb entry into the Kernel. This will make sure that kernel doesn't age out the fdb entry. (#15004)

How I did it
A flag extern_learn will be passed while programing the fdb entry. (#15004)

How to verify it
Tested MAC add/del to the Kernel from the local FDB entry. (#15004)

Signed-off-by: [email protected]
  • Loading branch information
kishorekunal01 authored Dec 8, 2023
1 parent 981863e commit aa094a0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions fdbsyncd/fdbsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info)

if (fdb_type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand All @@ -333,7 +333,7 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info)

const std::string cmds = std::string("")
+ " bridge fdb " + op + " " + info->mac + " dev "
+ port_name + " master " + type + " vlan " + info->vid.substr(4) + " extern_learn ";
+ port_name + " master " + type + " vlan " + info->vid.substr(4);

std::string res;
int ret = swss::exec(cmds, res);
Expand Down Expand Up @@ -384,7 +384,7 @@ void FdbSync::addLocalMac(string key, string op)

if (m_fdb_mac[key].type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand All @@ -393,7 +393,7 @@ void FdbSync::addLocalMac(string key, string op)

const std::string cmds = std::string("")
+ " bridge fdb " + op + " " + mac + " dev "
+ port_name + " master " + type + " vlan " + vlan + " extern_learn ";
+ port_name + " master " + type + " vlan " + vlan;

std::string res;
int ret = swss::exec(cmds, res);
Expand Down Expand Up @@ -432,7 +432,7 @@ void FdbSync::updateMclagRemoteMac (struct m_fdb_info *info)

if (fdb_type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand All @@ -441,7 +441,7 @@ void FdbSync::updateMclagRemoteMac (struct m_fdb_info *info)

const std::string cmds = std::string("")
+ " bridge fdb " + op + " " + info->mac + " dev "
+ port_name + " master " + type + " vlan " + info->vid.substr(4) + " extern_learn ";
+ port_name + " master " + type + " vlan " + info->vid.substr(4);

std::string res;
int ret = swss::exec(cmds, res);
Expand Down Expand Up @@ -469,7 +469,7 @@ void FdbSync::updateMclagRemoteMacPort(int ifindex, int vlan, std::string mac)
{
const std::string cmds = std::string("")
+ " bridge fdb replace" + " " + mac + " dev "
+ port_name + " master static vlan " + to_string(vlan) + " extern_learn ";
+ port_name + " master static vlan " + to_string(vlan);

std::string res;
int ret = swss::exec(cmds, res);
Expand Down Expand Up @@ -511,7 +511,7 @@ void FdbSync::macRefreshStateDB(int vlan, string kmac)

if (m_fdb_mac[key].type == FDB_TYPE_DYNAMIC)
{
type = "dynamic";
type = "dynamic extern_learn";
}
else
{
Expand All @@ -520,7 +520,7 @@ void FdbSync::macRefreshStateDB(int vlan, string kmac)

const std::string cmds = std::string("")
+ " bridge fdb " + "replace" + " " + kmac + " dev "
+ port_name + " master " + type + " vlan " + to_string(vlan) + " extern_learn ";
+ port_name + " master " + type + " vlan " + to_string(vlan);

std::string res;
int ret = swss::exec(cmds, res);
Expand Down

0 comments on commit aa094a0

Please sign in to comment.