add lacp_rate to portchannel#2036
Conversation
5f6f702 to
86f00eb
Compare
|
@stcheng could you please review it? |
7b7a5fe to
cc62984
Compare
cf3037d to
d5eeccd
Compare
|
@qiluo-msft @bingwang-ms Help to merge this and related PRs, Please. |
| case_sensitive=False)) | ||
| @click.pass_context | ||
| def add_portchannel(ctx, portchannel_name, min_links, fallback): | ||
| def add_portchannel(ctx, portchannel_name, min_links, fallback, fast_rate): |
There was a problem hiding this comment.
@globaltrouble please add a UTs to cover this case
|
will be good to include these changes into 202111 branch |
|
Please solve the conflicts |
34549bb to
9037aa8
Compare
|
Sorry for the late reaction. @qiluo-msft Conflicts resolved. |
tests/portchannel_test.py
Outdated
| obj = {'db':db.cfgdb} | ||
|
|
||
| # add a portchannel with fats rate | ||
| result = runner.invoke(config.config.commands["portchannel"].commands["add"], ["PortChannel0005", "--fast-rate", "True"], obj=obj) |
There was a problem hiding this comment.
@globaltrouble please remove all created objects on teardown. Also suggest to have parametrization for True/False values
There was a problem hiding this comment.
@nazariig Parametrization added. Regarding "remove all created objects on teardown" why it is needed? The DB is instantiated for each test from the template https://github.com/Azure/sonic-utilities/blob/3600639c16079f17089efd655c818022987032bb/tests/mock_tables/config_db.json
There was a problem hiding this comment.
Regarding "remove all created objects on teardown" why it is needed?
@msosyak just a common practise, can be omitted if you make sure auto cleanup is taking place
f266dfb to
c76a2f4
Compare
| @click.option('--min-links', default=1, type=click.IntRange(1,1024)) | ||
| @click.option('--fallback', default='false') | ||
| @click.option('--fast-rate', default='false', | ||
| type=click.Choice(['true', 'false'], |
There was a problem hiding this comment.
@globaltrouble IMHO, better to use flags or click.BOOL
There was a problem hiding this comment.
In the current implementation, the syntax is the same for fallback and for fast-rate. Booth requires an argument. If change type to bool or flags then I think it should be done for both options together is separate PR
|
@nazariig Do you have other comments? |
c76a2f4 to
a085315
Compare
|
@nazariig Could you approve, please? |
doc/Command-Reference.md
Outdated
| Command takes two optional arguements given below. | ||
| 1) min-links - minimum number of links required to bring up the portchannel | ||
| 2) fallback - true/false. LACP fallback feature can be enabled / disabled. When it is set to true, only one member port will be selected as active per portchannel during fallback mode. Refer https://github.com/Azure/SONiC/blob/master/doc/lag/LACP%20Fallback%20Feature%20for%20SONiC_v0.5.md for more details about fallback feature. | ||
| 3) fast-rate - true/false, default is flase (slow). Option specifying the rate in which we'll ask our link partner to transmit LACPDU packets in 802.3ad mode. slow - request partner to transmit LACPDUs every 30 seconds, fast - request partner to transmit LACPDUs every 1 second. In slow mode 60-90 seconds needed to detect linkdown, in fast mode only 2-3 seconds. |
judyjoseph
left a comment
There was a problem hiding this comment.
LGTM. Thinking from db migration angle as this is a new field being added -- I guess is ok as the default is false.
|
/easycla |
|
@judyjoseph Could you help to merge this? |
|
@qiluo-msft Please, help to merge. |
#### 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=truelink down will be detected in 2-3 seconds.How I did it
config portchannelcommand, default=slow for backward compatibility. (this PR)teammgrand forward it toteamd(other PR: [swss/cfgmgr] teammgr configure lacp rate sonic-swss#2121)How to verify it
Confgiure bond on other side, then configure portchannel and sniff the traffic from it.