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

bridge: T7322: fix slow performance of allowed vlan #4444

Open
wants to merge 2 commits into
base: current
Choose a base branch
from

Conversation

l0crian1
Copy link
Contributor

@l0crian1 l0crian1 commented Apr 10, 2025

Change summary

Ranges that are configured in allowed-vlans (e.g. 1-4094), are deconstructed into all of their individual VLANs, which is unnecessary for the execution of these:
bridge vlan add dev {interface} vid {vlan} master
bridge vlan del dev {interface} vid {vlan} master

This leads to a very long commit time when doing large ranges. This change eliminates that unnecessary deconstruction.

Example:
Execution time of allowed-vlans 1-4094 in current state: 38.94 seconds
Execution time of allowed-vlans 1-4094 without unnecessary deconstruction of range: 4.94 seconds

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): Performance improvement

Related Task(s)

https://vyos.dev/T7322

Related PR(s)

How to test / Smoketest result

set interfaces bridge br0 member interface eth0 allowed-vlan 1-4094
You will see a massive improvement on commit times, especially on slower systems.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

l0crian1 added 2 commits April 10, 2025 11:03
Allowed VLAN ranges are unnecessarily deconstructed into individual vlans, and then added one by one to the bridge. This can take a long time if a large range like 1-4084 is used.

- python/vyos/configdict.py - Added get_vlans_ids_and_range function to return configured ranges
- python/vyos/ifconfig/bridge.py - Modified add and delete vlan section to not loop unnecessarily
Fix indentation error in get_vlans_ids_and_range function.
Copy link

github-actions bot commented Apr 10, 2025


PR title does not match the required format

@l0crian1 l0crian1 changed the title T7322 fix allowed vlan bridge: T7322: fix slow performance of allowed vlan Apr 10, 2025
Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@c-po c-po requested review from zdc, jestabro and sever-sever April 11, 2025 20:31
Copy link
Member

@c-po c-po left a comment

Choose a reason for hiding this comment

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

Improved logic feels better then before and there is a significant boost in performance

@c-po c-po added bp/sagitta Create automatic backport for sagitta LTS version bp/circinus Create automatic backport for circinus labels Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bp/circinus Create automatic backport for circinus bp/sagitta Create automatic backport for sagitta LTS version current
Development

Successfully merging this pull request may close these issues.

2 participants