diff --git a/config/main.py b/config/main.py index 996549ca3c6..2322a576315 100644 --- a/config/main.py +++ b/config/main.py @@ -1720,8 +1720,11 @@ def portchannel(ctx, namespace): @click.argument('portchannel_name', metavar='', 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'], + 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): """Add port channel""" if is_portchannel_name_valid(portchannel_name) != True: ctx.fail("{} is invalid!, name should have prefix '{}' and suffix '{}'" @@ -1732,9 +1735,12 @@ def add_portchannel(ctx, portchannel_name, min_links, fallback): if is_portchannel_present_in_db(db, portchannel_name): ctx.fail("{} already exists!".format(portchannel_name)) - fvs = {'admin_status': 'up', - 'mtu': '9100', - 'lacp_key': 'auto'} + fvs = { + 'admin_status': 'up', + 'mtu': '9100', + 'lacp_key': 'auto', + 'fast_rate': fast_rate.lower(), + } if min_links != 0: fvs['min_links'] = str(min_links) if fallback != 'false': diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index b1846d15513..5838dd18043 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -6738,12 +6738,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. A port channel can be deleted only if it does not have any members or the members are already deleted. When a user tries to delete a port channel and the port channel still has one or more members that exist, the deletion of port channel is blocked. - Usage: ``` - config portchannel (add | del) [min-links ] [fallback (true | false)] + config portchannel (add | del) [min-links ] [fallback (true | false)] [fast-rate (true | false)] ``` - Example (Create the portchannel with name "PortChannel0011"):