-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[swss/cfgmgr] teammgr configure lacp rate #2121
[swss/cfgmgr] teammgr configure lacp rate #2121
Conversation
b75507c
to
7915fdf
Compare
doc/Configuration.md
Outdated
@@ -1139,21 +1139,25 @@ name as object key and member list as attribute. | |||
``` | |||
{ | |||
"PORTCHANNEL": { | |||
"PortChannel0003": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix formatting and reorder as in config utility for better readability, "PortChannel0003"
contains all mandatory attrs, "PortChannel0004"
additionally contains options attrs
@stcheng could you please review it? |
cfgmgr/teammgr.cpp
Outdated
@@ -553,6 +559,11 @@ task_process_status TeamMgr::addLag(const string &alias, int min_links, bool fal | |||
conf << ",\"fallback\":true"; | |||
} | |||
|
|||
if (lacp_rate == "fast") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In "teamd.conf", (LACP RUNNER SPECIFIC OPTIONS), fast_rate is defined to be a boolean,
runner.fast_rate (bool) Option specifies the rate at which our link partner is asked to transmit LACPDU packets. If this is true then packets will be sent once per second. Otherwise they will be sent every 30 seconds.
https://www.unix.com/man-page/centos/5/teamd.conf/
http://manpages.ubuntu.com/manpages/xenial/man5/teamd.conf.5.html
While spawning the teamd process with it's config file, "slow|fast" should be converted to "false|true". Instead why can't we define "fast_rate/lacp_rate" to be a boolean in consistent with "teamd" configuration ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Arthi, please use fast_rate in the config-DB as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answering your question:
- It's easier to read concreate status than to read a boolean flag and convert it to concreate status.
- Boolean flags are harder to maintain (update code base), in case new type need to be added - all code need to be change (boolean flags and conditions using them).
- If it's possible: modules should not depend on low level details. In this example for persion unfarmiliar with teamd it will be easier to find info only about lacp_rate, without dig in teamd.
@venkatmahalingam @ArthiSivanantham, thank you for the review, changed it to be consistent with links you pointed. Also changed config tool too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@venkatmahalingam / @ArthiSivanantham IMHO, the arguments provided by @globaltrouble seems to be reasonable. Do we have a strong opinion here? Although, the original approach is compliant with the teamd.conf
but it is not user friendly.
IMHO, lacp_rate
with SLOW/FAST
looks better to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any strong opinion @nazariig it's just a suggestion as well known teamd uses fast_rate to control the LACP rate and also we can avoid conversion (lacp_rate to fast_rate) in the back-end, some NOS vendors do use "[no] lacp fast rate" config knobs.
0cdaec9
to
74c52f4
Compare
@ArthiSivanantham @venkatmahalingam @prsunny Are there any other comments? If not, please, help to merge this and related PR |
3e38104
to
1107049
Compare
@ArthiSivanantham @venkatmahalingam @prsunny Could we merge this and related? |
@venkatmahalingam @ArthiSivanantham do you have other comments? If not, please approve. |
@qiluo-msft @prsunny @nazariig Please help review and merge |
tests/test_portchannel.py
Outdated
|
||
# Create PortChannels | ||
tbl = swsscommon.Table(self.cdb, "PORTCHANNEL") | ||
fvs_base = [("admin_status", "up"), ("mtu", "9100"), ("oper_status", "up"), ("lacp_key", "auto")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak why do we need oper_status
in Config DB?
tests/test_portchannel.py
Outdated
self.cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0) | ||
|
||
# Create PortChannels | ||
tbl = swsscommon.Table(self.cdb, "PORTCHANNEL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak please reuse LAG testing framework: https://github.com/Azure/sonic-swss/blob/master/tests/dvslib/dvs_lag.py
tests/test_portchannel.py
Outdated
time.sleep(1) | ||
|
||
# Add members to PortChannels | ||
tbl = swsscommon.Table(self.cdb, "PORTCHANNEL_MEMBER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak please reuse LAG testing framework: https://github.com/Azure/sonic-swss/blob/master/tests/dvslib/dvs_lag.py
tests/test_portchannel.py
Outdated
time.sleep(1) | ||
|
||
# test fast rate was not set on portchannel_slow | ||
output = dvs.runcmd("teamdctl {} state dump".format(portchannel_slow[0]))[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak suggest extending and reusing LAG testing framework: https://github.com/Azure/sonic-swss/blob/master/tests/dvslib/dvs_lag.py
tests/test_portchannel.py
Outdated
tbl = swsscommon.Table(self.cdb, "PORTCHANNEL_MEMBER") | ||
for portchannel in portchannel_slow, portchannel_fast: | ||
tbl._del(portchannel[0] + "|" + portchannel[1]) | ||
time.sleep(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak get_and_verify_port_channel_members
assert?
tests/test_portchannel.py
Outdated
tbl = swsscommon.Table(self.cdb, "PORTCHANNEL") | ||
for portchannel in portchannel_slow, portchannel_fast: | ||
tbl._del(portchannel[0]) | ||
time.sleep(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak get_and_verify_port_channel
assert?
@msosyak , changes looks good to me. Please address the outstanding comments and also get the dependent PRs in sonic-utilities, HLD merged. @nazariig , @venkatmahalingam , @ArthiSivanantham to signoff |
will be good to include these changes into 202111 branch |
de2d6d3
to
1a64d22
Compare
1a64d22
to
5565488
Compare
tests/test_portchannel.py
Outdated
@@ -89,6 +91,30 @@ def test_Portchannel(self, dvs, testlog): | |||
lagms = lagmtbl.getKeys() | |||
assert len(lagms) == 0 | |||
|
|||
def test_Portchannel_fast_rate(self, dvs, testlog): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msosyak please use test parametrization to avoid loops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
5565488
to
c38790c
Compare
@nazariig Do you have other comments? |
@prsunny Could we merge this? |
@judyjoseph , can you please review/signoff? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Can you also add the test results (the o/p of teamdctl state dump) in PR description with local/peer device having lacp rate configured as fast/slow rate respectively.
* add lacp_rate config * add lacp_rate to teammgr addLag params * docs for portchannel db config * add test Co-authored-by: Anton <antonx.novikau@intel.com> Co-authored-by: Myron Sosyak <myronx.sosyak@intel.com>
#### What I did Make lacp_rate configurable for portchannel. ``` Option specifying the rate in which we'll ask our link partner to transmit LACPDU packets in 802.3ad mode. Possible values are: slow Request partner to transmit LACPDUs every 30 seconds fast Request partner to transmit LACPDUs every 1 second The default is slow. ``` #### Why I did it In case of slow lacp_rate configuration link down will be detected in 60-90 seconds, it may be to long (for example for MCLAG high availability), in case of using ` --fast-rate=true` link down will be detected in 2-3 seconds. #### How I did it * add optional argument to `config portchannel` command, default=slow for backward compatibility. (this PR) * parse argument in `teammgr` and forward it to `teamd` (other PR: sonic-net/sonic-swss#2121) * update docs sonic-net/SONiC#937 #### How to verify it Confgiure bond on other side, then configure portchannel and sniff the traffic from it. ``` config portchannel add PortChannel0001 --fast-rate=true config portchannel member add PortChannel0001 Ethernet0 config interface ip add PortChannel0001 192.168.1.2/24 tcpdump -ne ```
#### What I did Make lacp_rate configurable for portchannel. ``` Option specifying the rate in which we'll ask our link partner to transmit LACPDU packets in 802.3ad mode. Possible values are: slow Request partner to transmit LACPDUs every 30 seconds fast Request partner to transmit LACPDUs every 1 second The default is slow. ``` #### Why I did it In case of slow lacp_rate configuration link down will be detected in 60-90 seconds, it may be to long (for example for MCLAG high availability), in case of using ` --fast-rate=true` link down will be detected in 2-3 seconds. #### How I did it * add optional argument to `config portchannel` command, default=slow for backward compatibility. (this PR) * parse argument in `teammgr` and forward it to `teamd` (other PR: sonic-net/sonic-swss#2121) * update docs sonic-net/SONiC#937 #### How to verify it Confgiure bond on other side, then configure portchannel and sniff the traffic from it. ``` config portchannel add PortChannel0001 --fast-rate=true config portchannel member add PortChannel0001 Ethernet0 config interface ip add PortChannel0001 192.168.1.2/24 tcpdump -ne ```
#### What I did Make lacp_rate configurable for portchannel. ``` Option specifying the rate in which we'll ask our link partner to transmit LACPDU packets in 802.3ad mode. Possible values are: slow Request partner to transmit LACPDUs every 30 seconds fast Request partner to transmit LACPDUs every 1 second The default is slow. ``` #### Why I did it In case of slow lacp_rate configuration link down will be detected in 60-90 seconds, it may be to long (for example for MCLAG high availability), in case of using ` --fast-rate=true` link down will be detected in 2-3 seconds. #### How I did it * add optional argument to `config portchannel` command, default=slow for backward compatibility. (this PR) * parse argument in `teammgr` and forward it to `teamd` (other PR: sonic-net/sonic-swss#2121) * update docs sonic-net/SONiC#937 #### How to verify it Confgiure bond on other side, then configure portchannel and sniff the traffic from it. ``` config portchannel add PortChannel0001 --fast-rate=true config portchannel member add PortChannel0001 Ethernet0 config interface ip add PortChannel0001 192.168.1.2/24 tcpdump -ne ```
What I did
Make lacp_rate configurable for portchannel.
Why I did it
In case of slow lacp_rate configuration link down will be detected in 60-90 seconds, it may be to long (for example for MCLAG high availability), in case of using
--fast-rate=true
link down will be detected in 2-3 seconds.How I did it
config portchannel
command, default=slow for backward compatibility. add lacp_rate to portchannel sonic-utilities#2036teammgr
and forward it toteamd
(this PR)How to verify it
Confgiure bond on other side, then configure portchannel and sniff the traffic from it.