Skip to content

cache the bvid to vlan translations #1523

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

Merged
merged 2 commits into from
Apr 10, 2021
Merged

cache the bvid to vlan translations #1523

merged 2 commits into from
Apr 10, 2021

Conversation

aystarik
Copy link
Contributor

Add lookup table for bvid to vlan translations.
bvid_tlb will store previous successful translations from slow get_vlan_id_from_bvid()
This patch does not change the output from the command, only speeds up it for case of 10k+ MAC tables.

Add lookup table for bvid to vlan translations.
@ghost
Copy link

ghost commented Mar 24, 2021

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

lgtm, request @qiluo-msft to review

@prsunny prsunny requested a review from qiluo-msft March 25, 2021 02:40
else:
try:
vlan_id = port_util.get_vlan_id_from_bvid(self.db, bvid)
if vlan_id is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

if vlan_id is None: [](start = 24, length = 19)

Even if vlan_id is None, you can still cache it to save future redis access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, updated patch

Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

As comment

@@ -87,6 +87,7 @@ class FdbShow(object):
if not fdb_str:
return

bvid_tlb = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

if you meant bvid table, please rename to bvid_tbl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant Translation lookaside buffer, as in MMU, thus TLB.

@aystarik
Copy link
Contributor Author

@qiluo-msft should I do something to complete those expected checks?

@qiluo-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@aystarik
Copy link
Contributor Author

aystarik commented Apr 5, 2021

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1523 in repo Azure/sonic-utilities

@prsunny
Copy link
Contributor

prsunny commented Apr 8, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lguohan
Copy link
Contributor

lguohan commented Apr 10, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft merged commit e57e7f7 into sonic-net:master Apr 10, 2021
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
Add lookup table for bvid to vlan translations.
bvid_tlb will store previous successful translations from slow get_vlan_id_from_bvid()
This patch does not change the output from the command, only speeds up it for case of 10k+ MAC tables.
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.

4 participants