-
Notifications
You must be signed in to change notification settings - Fork 712
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
Conversation
Add lookup table for bvid to vlan translations.
There was a problem hiding this 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
else: | ||
try: | ||
vlan_id = port_util.get_vlan_id_from_bvid(self.db, bvid) | ||
if vlan_id is None: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, updated patch
There was a problem hiding this 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 = {} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@qiluo-msft should I do something to complete those expected checks? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Commenter does not have sufficient privileges for PR 1523 in repo Azure/sonic-utilities |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
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.