Skip to content

Commit 61e3cdd

Browse files
author
Anton
committed
add lacp_rate to teammgr addLag params
1 parent d9fa44f commit 61e3cdd

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

cfgmgr/teammgr.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ void TeamMgr::doLagTask(Consumer &consumer)
210210
string mtu = DEFAULT_MTU_STR;
211211
string learn_mode;
212212
string tpid;
213+
string lacp_rate;
213214

214215
for (auto i : kfvFieldsValues(t))
215216
{
@@ -247,12 +248,17 @@ void TeamMgr::doLagTask(Consumer &consumer)
247248
{
248249
tpid = fvValue(i);
249250
SWSS_LOG_INFO("Get TPID %s", tpid.c_str());
250-
}
251+
}
252+
else if (fvField(i) == "lacp_rate")
253+
{
254+
lacp_rate = fvValue(i);
255+
SWSS_LOG_INFO("Get lacp_rate `%s`", lacp_rate.c_str());
256+
}
251257
}
252258

253259
if (m_lagList.find(alias) == m_lagList.end())
254260
{
255-
if (addLag(alias, min_links, fallback) == task_need_retry)
261+
if (addLag(alias, min_links, fallback, lacp_rate) == task_need_retry)
256262
{
257263
it++;
258264
continue;
@@ -496,7 +502,7 @@ bool TeamMgr::setLagLearnMode(const string &alias, const string &learn_mode)
496502
return true;
497503
}
498504

499-
task_process_status TeamMgr::addLag(const string &alias, int min_links, bool fallback)
505+
task_process_status TeamMgr::addLag(const string &alias, int min_links, bool fallback, const string &lacp_rate)
500506
{
501507
SWSS_LOG_ENTER();
502508

@@ -541,7 +547,6 @@ task_process_status TeamMgr::addLag(const string &alias, int min_links, bool fal
541547
<< "\"hwaddr\":\"" << mac_boot.to_string() << "\","
542548
<< "\"runner\":{"
543549
<< "\"active\":true,"
544-
<< "\"fast_rate\":true,"
545550
<< "\"name\":\"lacp\"";
546551

547552
if (min_links != 0)
@@ -554,6 +559,11 @@ task_process_status TeamMgr::addLag(const string &alias, int min_links, bool fal
554559
conf << ",\"fallback\":true";
555560
}
556561

562+
if (lacp_rate == "fast")
563+
{
564+
conf << ",\"fast_rate\":true";
565+
}
566+
557567
conf << "}}'";
558568

559569
SWSS_LOG_INFO("Port channel %s teamd configuration: %s",

cfgmgr/teammgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class TeamMgr : public Orch
4040
void doLagMemberTask(Consumer &consumer);
4141
void doPortUpdateTask(Consumer &consumer);
4242

43-
task_process_status addLag(const std::string &alias, int min_links, bool fall_back);
43+
task_process_status addLag(const std::string &alias, int min_links, bool fall_back, const std::string &lacp_rate);
4444
bool removeLag(const std::string &alias);
4545
task_process_status addLagMember(const std::string &lag, const std::string &member);
4646
bool removeLagMember(const std::string &lag, const std::string &member);

0 commit comments

Comments
 (0)