Skip to content
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

add lacp_rate to portchannel #2036

Merged

Conversation

globaltrouble
Copy link
Contributor

@globaltrouble globaltrouble commented Jan 25, 2022

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

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

@globaltrouble globaltrouble marked this pull request as draft January 25, 2022 14:08
@globaltrouble globaltrouble force-pushed the feature/add-lacp-rate-to-portchannel branch 3 times, most recently from 5f6f702 to 86f00eb Compare January 27, 2022 10:12
@globaltrouble globaltrouble marked this pull request as ready for review January 28, 2022 15:01
@globaltrouble
Copy link
Contributor Author

@stcheng could you please review it?

@msosyak msosyak force-pushed the feature/add-lacp-rate-to-portchannel branch from 7b7a5fe to cc62984 Compare February 3, 2022 10:00
@msosyak msosyak force-pushed the feature/add-lacp-rate-to-portchannel branch 2 times, most recently from cf3037d to d5eeccd Compare February 16, 2022 18:35
@msosyak
Copy link

msosyak commented Feb 16, 2022

@msosyak
Copy link

msosyak commented Mar 21, 2022

@qiluo-msft @bingwang-ms Help to merge this and related PRs, Please.

@click.pass_context
def add_portchannel(ctx, portchannel_name, min_links, fallback):
def add_portchannel(ctx, portchannel_name, min_links, fallback, fast_rate):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@globaltrouble please add a UTs to cover this case

@bratashX
Copy link
Contributor

will be good to include these changes into 202111 branch

@qiluo-msft
Copy link
Contributor

Please solve the conflicts

@msosyak msosyak force-pushed the feature/add-lacp-rate-to-portchannel branch from 34549bb to 9037aa8 Compare July 4, 2022 10:28
@msosyak
Copy link

msosyak commented Jul 13, 2022

Sorry for the late reaction.

@qiluo-msft Conflicts resolved.
@nazariig UT added.

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@globaltrouble please remove all created objects on teardown. Also suggest to have parametrization for True/False values

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@msosyak msosyak force-pushed the feature/add-lacp-rate-to-portchannel branch 2 times, most recently from f266dfb to c76a2f4 Compare July 14, 2022 10:39
@@ -1946,8 +1946,11 @@ def portchannel(db, ctx, namespace):
@click.argument('portchannel_name', metavar='<portchannel_name>', required=True)
@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'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@globaltrouble IMHO, better to use flags or click.BOOL

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@msosyak
Copy link

msosyak commented Jul 19, 2022

@nazariig Do you have other comments?

@msosyak
Copy link

msosyak commented Jul 20, 2022

@nazariig @prsunny could we merge this?

@msosyak msosyak force-pushed the feature/add-lacp-rate-to-portchannel branch from c76a2f4 to a085315 Compare July 27, 2022 08:48
@msosyak
Copy link

msosyak commented Jul 27, 2022

@nazariig Could you approve, please?

nazariig
nazariig previously approved these changes Jul 27, 2022
@@ -6925,12 +6925,13 @@ When any port is already member of any other portchannel and if user tries to ad
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: flase

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

judyjoseph
judyjoseph previously approved these changes Jul 29, 2022
Copy link
Contributor

@judyjoseph judyjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thinking from db migration angle as this is a new field being added -- I guess is ok as the default is false.

@msosyak msosyak dismissed stale reviews from judyjoseph and nazariig via 6d769ea July 29, 2022 07:35
@msosyak
Copy link

msosyak commented Aug 9, 2022

/easycla

@msosyak
Copy link

msosyak commented Aug 9, 2022

@judyjoseph Could you help to merge this?

@msosyak
Copy link

msosyak commented Aug 12, 2022

@qiluo-msft Please, help to merge.

@qiluo-msft qiluo-msft merged commit 37eb2b3 into sonic-net:master Aug 13, 2022
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
#### 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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants