Skip to content

Adding initial MSTP changes over PVST code#5

Open
wajahatrazi wants to merge 18 commits into
masterfrom
MSTP-Utilities
Open

Adding initial MSTP changes over PVST code#5
wajahatrazi wants to merge 18 commits into
masterfrom
MSTP-Utilities

Conversation

@wajahatrazi
Copy link
Copy Markdown
Owner

Currently adding CLI changes in the PVST code for MSTP

jhli-cisco and others added 5 commits December 3, 2024 14:07
…lities (sonic-net#3056)

[cisco|express-boot]: Add support for cisco express boot in sonic-utilities
…ch are not applicable to Supervisor (sonic-net#3646)

hat I did
On 202205 branch, execute "show techsupport " on Supervisor. It hung in the scripts which call "show queue counters". This PR filters out a list of command which are not applicable to Supervisor. Fixes Nokia-ION/ndk#60

How I did it
Modify generate_dump script by adding code to check if IS_SUPERVISOR, not to executes the "show queue counters".
And also return at the beginning of the following functions which are not applicable on Supervisor:
save_bfd_info()
save_bgp_info()
save_evpn_info()
save_frr_info()
Also fix some of the failure which are shown during the show techsupport.
a) check if file /etc//cron.d/logrote exists before access it in function disable_logrotate() and enable_logrotate()
b) check if directory /var/log/sai_failure_dump/ exists before using this directory.
Add "show reboot-cause history" to the generate_dump
Check if output of "show vrf" is empty, don't access the empty list with "awk" command
How to verify it
"show techsupport" shoudl work fine on Supervisor as well as on LC

Signed-off-by: mlok <marty.lok@nokia.com>
Comment thread config/stp.py Outdated
ctx.fail("MST is already configured")

if mode == "pvst":
disable_global_mst(db)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's throw a warning or error for any STP mode change, as this action should not be allowed. This approach ensures that users first disable the existing mode before configuring a new one, will better control and avoiding conflicts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

warning should be like "MSTP is already configured; please disable PVST before enabling MST" and viceversa

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
enable_stp_for_vlans(db) # Enable STP for VLAN by default

elif mode == "mst":
disable_global_pvst(db)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lets remove this disable api and add error message

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
}
db.mod_entry('STP', "GLOBAL", fvs)

bridge_mac = get_bridge_mac_address(db)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't need to set the default values for STP_MST table

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
}
db.set_entry('STP_MST', "GLOBAL", mst_fvs)

do_vlan_to_instance0(db) # VLANs to Instance 0 mapping as part of global configuration
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do_vlan_to_instance0 - this call is also not required. When MST mode is enabled , STPd will add all VLANs to CIST

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
print("PVST is disabled")
elif mode == "mst" and current_mode == "mst":
disable_global_mst(db)
print("MST is disabled")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove the print

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated

if mode == "pvst" and current_mode == "pvst":
disable_global_pvst(db)
print("PVST is disabled")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove this print

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated


# cmd: STP global root guard timeout
# MST CONFIGURATION IN THE STP_PORT TABLE
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Root guard timeout is not valid for MST mode

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
if param_type not in allowed_params:
ctx.fail("Invalid parameter")

mst_inst_table = db.get_table('STP_MST_INST')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This value should be added in STP_MST table (Global).
MSTP has only one timer which is global

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
db.mod_entry('STP', "GLOBAL", {'forward_delay': forward_delay})
elif current_mode == "mst":
db.mod_entry('STP_MST', "GLOBAL", {'forward_delay': forward_delay})
update_mst_instance_parameters(ctx, db, 'forward_delay', forward_delay)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We dnt need this call update_mst_instance_parameters

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
db.mod_entry('STP', "GLOBAL", {'hello_time': hello_interval})
elif current_mode == "mst":
db.mod_entry('STP_MST', "GLOBAL", {'hello_time': hello_interval})
update_mst_instance_parameters(ctx, db, 'hello_time', hello_interval)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We dnt need this instance update call

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
db.mod_entry('STP', "GLOBAL", {'max_age': max_age})
elif current_mode == "mst":
db.mod_entry('STP_MST', "GLOBAL", {'max_age': max_age})
update_mst_instance_parameters(ctx, db, 'max_age', max_age)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We dnt need this instance update call

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
db.mod_entry('STP', "GLOBAL", {'max_hops': max_hops})
if current_mode == "mst":
db.mod_entry('STP_MST', "GLOBAL", {'max_hops': max_hops})
update_mst_instance_parameters(ctx, db, 'max_hops', max_hops)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We dnt need this instance update call

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated

# Bridge priority cannot be set without Instance ID
# cmd: STP global bridge priority
# MST CONFIGURATIONS IN THE STP_MST_INST TABLE
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Global priority set is not applicable for MST

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py Outdated
ctx = click.get_current_context()
db = _db.cfgdb
check_if_global_stp_enabled(db, ctx)
if revision not in range(MST_MIN_REVISION, MST_MAX_REVISION + 1):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need +1?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py
ctx.fail("STP is not enabled for VLAN")


#config spanning_tree vlan enable <vlan-id>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command is valid only for PVST. Please add check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py
db.mod_entry('STP_VLAN_PORT', vlan_intf_key, vlan_intf_entry)


# config spanning_tree vlan disable <vlan-id>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command is valid only for PVST. Please add check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py
db.mod_entry('STP_VLAN', vlan_name, {'enabled': 'false'})


# config spanning_tree vlan forward_delay <vlan-id> <4-30 seconds>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command is valid only for PVST. Please add check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py
db.mod_entry('STP_VLAN', vlan_name, {'forward_delay': forward_delay})


# config spanning_tree vlan hello <vlan-id> <1-10 seconds>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command is valid only for PVST. Please add check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py
db.mod_entry('STP_VLAN', vlan_name, {'hello_time': hello_interval})


# config spanning_tree vlan max_age <vlan-id> <6-40 seconds>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command is valid only for PVST. Please add check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Comment thread config/stp.py
db.mod_entry('STP_VLAN', vlan_name, {'max_age': max_age})


# config spanning_tree vlan priority <vlan-id> <0-61440>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command is valid only for PVST. Please add check.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I have addressed this comment, please review

Copy link
Copy Markdown
Collaborator

@divyachandralekha divyachandralekha left a comment

Choose a reason for hiding this comment

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

Added review comments. Please check

bingwang-ms and others added 4 commits December 5, 2024 13:53
* Update PR checker pipeline to point to bookworm
What I did
The sonic vm image has yang validation issue with default config setup. Limit YANG check to golden config only before fix default factory config.

How I did it
Restrict YANG validation to golden config only.

How to verify it
Unit test and integration test.
* Revert "Speed up route_check script (sonic-net#3544)"

This reverts commit 7cbcfda.

* Revert Speed up route_check script
DavidZagury and others added 9 commits December 6, 2024 16:30
* Fix save_file command in generate_dump

* Fix save_file command in generate_dump
Update DB migrator script to next branch 202505
What I did
config_sonic_basedon_testbed.yml creates an empty golden_config_db.json file under /etc/sonic for non mx platforms.
When this empty file exist db_migration fails for all asics for non mx platforms.

How I did it
Update db_migrator to support empty golden config file.

How to verify it
Run unit test and end to end test
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.